CoViewDeveloper: Getting Started

CoViewDeveloper is an Eclipse plug-in that lets you create JUnit tests, improve code testability, and measure path coverage. Through the CoView JUnit Developer view, you can highlight your paths, identify per method coverage, and create additional JUnit, DbUnit and HttpUnit test cases.

CoViewDeveloper is a multi-paned Eclipse product that lets you create and manage JUnit tests. CoViewDeveloper comes with a JUnit Editor, advanced JUnit Test Case Wizard , and the CoViewDeveloper view. The view contains a number of features, including:

  • Path Coverage
  • Branch Coverage
  • Mock Object Creation using JMockit
  • Tested/Untested Code Highlighting
  • Ignore Unrealizable Paths
  • An Advanced Java Editor
  • Support for both JUnit 3.8 & 4
  • Support for both JDK 1.4 & 5
  • A JUnit Runner
  • A JUnit Plug-in Runner to support testing Eclipse plug-ins
  • A JUnit Debugger
  • A JUnit Plug-in Debugger
  • Creation and deletion of JUnit tests
  • Path Identification
  • Path Highlighting

To open CoViewDeveloper

  • 1. Click Windows > Show View > Other > Codign > CoViewDeveloper View . OR
  • 2. Right click on an existing JUnit Test Case and select Open With > CoView Editor. A JUnit Test Case opened in the CoView Editor will start CoViewDeveloper as well. OR
  • 3. Open the CoView perspective: Window > Open Perspective > Other...  and select CoView

CoViewDeveloper is part of the CoViewDeveloper product and is comprised of two panes. The top pane is an expandable tree that contains the class, method and test case displayed in the CoView Editor. Following each method name, CoView reports the number of tested paths for that method in a 'tested/total paths' notation. The bottom pane contains a list of data flow, logic and exception paths found within the method under test.

  • Path: A path is a complete flow of execution from a method's entry to its exit. A path is either a Data Flow Path, Logic Path or Exception Path.
  • Data Flow Paths : Data flow paths are paths that cover both the definition and a specific use of the same data element. Note that there can be multiple uses of the same data definition, possibly resulting in distinct paths.
  • Logic (Basis) Paths: Logic (or Basis) paths are a set of linearly independent paths that, taken together, ensure that each decision in a method is tested independently of all others.
  • Exception Paths: Exception paths are a subset of basis paths that exercise exception logic in catch clauses.

If you open a JUnit test case that was not annotated with CoView, then the top pane will display the tests. Selecting a test will open that test in the CoView Editor.

If you open a JUnit test case that is annotated, then the bottom pane is populated as well. Running the test case via the CoView JUnit Runner will populate the top pane with the number of tested paths and highlight the tested paths in the bottom pane. Right-clicking on a test case in the top pane will invoke a sub-menu of items.

As you select a test case in the top pane, the tested path in the bottom pane is bolded. Double-clicking on a path in the bottom pane results in that path being displayed in the CoView Editor. Note that there are circumstances where a test case does not execute a recommended path, meaning no paths would be in bold with a selected test case.

CoView JUnit Outline View

In the above example, notice that Path 5 is bolded. This indicates that the test case testGetRentalIntInt executed this path. Double click this path (or any other displayed path) to view the path details in the CoView Editor.

Path Highlighting

This illustration identifies the flow of control for Path 5. Decisions highlighted in RED indicate that the decision evaluated FALSE. This means that testGetRentalIntInt executed the path where driverAge >= 25 was FALSE and isweekend() was FALSE as well. Other paths test other decision combinations.