Twitter

Clean Test Class Code Review

As a bonus Xmas gift this week, I completed my part of a code review of a developer’s code before heading out Friday. The code review primarily covered a JSF backing bean/controller and a corresponding test case. Even though the tests had mostly been written after the test case was just a joy to read:

  • Clear test names.
  • Only 2-4 lines of code for most of the tests.
  • Thorough testing of negative conditions like
    1
    testDuplicateRefundsOnlyCountOnce()

    .

  • 99% unit test coverage according to Clover.

The only thing I was able to catch was a

1
printLines()

method that had been used when writing the tests to output something to the console. The method was still hanging around and didn’t actually do anything because the

1
System.out.println()s

had already been removed.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>