Hey guys, I have been having this interesting conversation with a colleague about a situation with valid points on both sides. Dev A writes a PR that involved adding some validation into a class X1 similar to another X2. Dev A extracts some code from X2 towards a static class X3 now used by both X1 and X2. However, Dev A doesn’t add tests for the static class arguing that the code merely moved to a static class. Dev B wants Dev A to write tests for the static class to cover all possible scenarios. To be fair to Dev A a SonarQube report shows 100% coverage both for branches and instructions. However, Dev B thinks about potential future bugs that could occur when the implementation changes. I don’t know that there is a black or white answer but which side are you on guys and why? Do you think like Dev A doesn’t need to add more tests for that already covered code or should there be independent unit tests for the static class regardless of it being covered as Dev B thinks?

submitted by /u/iamnguele
[link] [comments]