Category TDD

Test Behaviour, Not Methods

JUnit4 introduced @Test annotations and removes the need to prefix test method names with ‘test’. Take advantage of this and use a different test case naming convention to test the class behaviour, not it’s implementation Compare the two units test below…

Forget Code Coverage

Forget chasing code coverage, in my view it is a somewhat pointless statistic and chasing it can (in some cases) lead to poor quality tests and a lot of wasted time. It can also lead to a false sense of…

Test Driven Development Benefits

8 Benefits of Using Test Driven Development Focus on behaviour of a system Shorter feedback loop when coding Identify defects earlier in lifecycle Provide freedom to refactor Codebase should be easier to maintain & understand Tests act as documentation Quicker…