18
uuid
6y

The fucker complains when someone doesn't write unit tests, meanwhile he tops any new code he writes with a @codeCoverageIgnore annotation ... 😒😒

Comments
  • 1
  • 1
    why does such an annotation even exist??!!
  • 1
    @CrashOverride I do honestly find it useful when for example I'm implementing an Interface but I'm not interested in implementing a specific method, that sometimes can mess with the coverage percentage, so I just add @codeCoverageIgnore to the method's doc.

    The problem is when the code to which that's added is easily testable, yet you choose to ignore it to keep the coverage at 100% giving the illusion that every line is tested 😐😒😬
  • 2
    Probably because unit tests are important, but code coverage is a useless metric that doesn’t actually improve quality.
  • 0
    @uuid The problem with that is it violates the interface segregation principle. It would be preferable to split the interface into smaller ones so that you don’t have a scenario where you have to stub out a method that you didnt need. Of course this is only possible with interfaces that you control.
  • 0
    @CrashOverride exactly, I don't control the interface, I have to use it as it is.
  • 2
    @gblues I agree, code coverage is not a good metric to assess the code quality, but when you see that all your unit tests are covering +70 % of your code, you're at least sure that a good part of your code has been tested and covered. Ofc there might be bugs hidden but that's because your unit tests didn't handle all scenarios.

    Coverage is just a side effect of unit tests, not the end goal.
Add Comment