TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Category: JUnit

Synopsis:These rules deal with different problems that can occur with JUnit tests.


Description:
These rules deal with different problems that can occur with JUnit tests.

Coding Rules

NameCheckedSynopsis
JUnit1 Checked automatically with code checker You have a suite() method that is not both public and static, so JUnit won't call it to get your TestSuite. Is that what you wanted to do?
JUnit2 Checked automatically with code checker You may have misspelled a JUnit framework method (setUp or tearDown)
JUnit3 Checked automatically with code checker JUnit assertions should include a message
JUnit4 Checked automatically with code checker JUnit tests should include assert() or fail()
JUnit5 Checked automatically with code checker This class name ends with 'Test' but contains no test cases
JUnit6 Checked automatically with code checker assertTrue(true) or similar statements are unnecessary
JUnit7 Checked automatically with code checker Use assertEquals(x, y) instead of assertTrue(x.equals(y))
JUnit8 Checked automatically with code checker Use assertSame(x, y) instead of assertTrue(x==y), or assertNotSame(x,y) vs assertFalse(x==y)
JUnit9 Checked automatically with code checker Use assertNull(x) instead of assertTrue(x==null), or assertNotNull(x) vs assertFalse(x==null)
JUnit10 Checked automatically with code checker assertTrue(!expr) can be replaced by assertFalse(expr)