Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

100% means testing things getters and setters in Java. At some point you're testing nothing.

If you tell people that 95% is just as inadequate as 0%, they'll tend towards 0%.





There are two possibilities

1. The getters and setters are not called anywhere in application logic. In that case, delete the getters / setters and get to 100%.

2. The getters and setters are called somewhere in the application logic. In that case, they should have already been covered in the test for the application.

There is really no excuse to not write tests to get to 100%.


> The getters and setters are not called anywhere in application logic

It's common that getters and setters will be called by serialization library. The fact that they are "grey" in IntelliJ doesn't matter.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: