Unit Testing

Code coverage metrics and Functional Test Coverage

Thumbnail image for Code coverage metrics and Functional Test Coverage

Code coverage can be a very useful metric. However you need to know how, and when, to use it. The link between code coverage and test quality is tenuous at best – in short, high code coverage is, in itself, no guarantee of well tested code. And increasing code coverage for the sake of code [...]

Parameterized jUnit Test

Thumbnail image for Parameterized jUnit Test

When you are writing unit tests, you want to test all the border cases. You can create a method for every border case, but sometimes this is a very repetitive job. JUnit has a more pragmatic approach for these sorts of tests, called Parameterized tests. The idea is simple. You create your testcase with your [...]

Continuous Testing Tools (not only) for Java – Infinitest vs JUnit Max

Thumbnail image for Continuous Testing Tools (not only) for Java – Infinitest vs JUnit Max

Tools like Infinitest and JUnit Max run Java unit tests as early as possible, immediately after a relevant code change has taken place. This way you get an immediate feedback and errors and their causes can be identified immediately. Especially when doing test driven development (TDD), this saves you a lot of keystrokes, because you [...]

Automated Javascript Unit Testing With JsTestDriver

Thumbnail image for Automated Javascript Unit Testing With JsTestDriver

In a previous post about unit testing your Javascript, I explained how you can unit test your own Javascript library code with the QUnit test suite. Now that we can unit test our Javascript, it would be cool to automate the process. We’ll accomplish that by using JsTestDriver, a Javascript test runner, built in Java. [...]