Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
uuid25567y@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 😐😒😬 -
gblues6187yProbably because unit tests are important, but code coverage is a useless metric that doesn’t actually improve quality.
-
LLAMS36637y@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.
-
uuid25567y@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.
Related Rants
The fucker complains when someone doesn't write unit tests, meanwhile he tops any new code he writes with a @codeCoverageIgnore annotation ... 😒😒
rant
coverage
unit testing
seriously wtf?