Don’t write useless Junit tests

Wednesday, 11 August 2004

This may seem obvious, but many JUnit tests are written that don’t really test anything useful.

Don’t write tests cases for code that’s too simple to fail on its own: that would be a waste of time. You’re supposed to write tests that test your application code, not the test framework or the compiler.

Tags: ,


You can leave a comment, or trackback from your own site.

  1. Yes, I do agree. The junit test cases are useless. Also log4 and junit does not work so logging get wasted.

  2. jeck, OP is not saying that JUnit tests are useless, but that one should not write tests that are overly simple and does not really test the code.

Leave a comment