Menu

#489 New rule: JUnit tests should not contain control statements

open
nobody
None
5
2012-10-07
2007-08-10
No

Most of the time JUnit tests should not contain control statements: if, while, for, etc. This usually indicates that the test is either:

  1. Not always testing what it's supposed to be testing
  2. Is not really a unit test.

I propose a new rule to flag such test cases. I may play around with writing this test myself.

Discussion


Log in to post a comment.