COVIEW for eclipse
Create JUnit tests and mocks, measure coverage

Details | Download

purchase CoView and Comet
COMET for ant
Measure coverage and metrics in a CI environment

Details | Download

purchase CoView and Comet

JUnit Test Generation

Unit testing and coding go together like peanut butter and jelly. Each good by themself, but together? Now that's a good sandwich!

Now you can benefit by easily creating the right JUnit test the first time. CoView provides a solution that makes sense, is unique and completely understandable. And it only takes 3 steps to have a complete set of JUnit tests for each of your classes.

Step 1: Pick Your Class

The first step is simple. From the Package Explorer, pick the class you want to unit test. Right click on the class and select CoView > Create CoView JUnit Test Case.

Creating JUnit tests with CoView

Step 2: Answer A Few Questions

Notice that a wizard appears.

Creating JUnit tests with CoView

Answer a few questions and pick the methods you want to test, and CoView does the rest. Wait, you may say, why am I picking methods? Because CoView is different - CoView creates 1 JUnit test case per path in a method. Read more if you want.

Step 3: Define Parameters & Pick Assertions

Notice the test class is created, and you have 1 test case per method path, which is a very effective, maintainable and consistent way to create JUnit tests.

Creating JUnit tests with CoView

What's next? Well, take a closer look at the test cases. Notice that the decisions for each path are defined in the comments, and that CoView inserts a fail as an assertion. You, the developer, have to modify the assertion and change the test case parameters to match the path. What about mock objects? Don't worry, CoView does that too.