Analyze code coverage
The Coverage tools display a summary of code that has run. This feature/function is particularly useful when designing and running test cases because you can see what has been tested.
Run the Code Coverage tool
- Set two or more breakpoints in your code.
- Run the application to the first breakpoint.
- On the View menu, click Coverage.
- To reset information to 0, in the coverage pane, click Clear.
- Run the application to the next breakpoint.
- To display the percentage of code that has been run since you clicked Clear, in the coverage pane, click Refresh.
The Coverage pane displays the percentage of code that has been run. It displays a nested view of packages, classes, and methods, with the percentage of code executed in each.
View source code
> In the coverage pane, double-click a method.
Green bars in the source code indicate that the source code was run, and red bars in the source code indicate that the source code was not run.
Related topic