Collecting Code Coverage Results
When you are running an application within the JADE development environment, you can use menu options from the JADE User Interrupt Code Coverage submenu to dynamically collect and report on code coverage results. For details, see "Determining Code Coverage", in Chapter 1 of the JADE Runtime Application Guide.
When determining code coverage by using the JADE User Interrupt submenu, the application must already be running. Only those methods that are executed after code coverage has started are reported on.
You can also code instructions within your application that use methods provided in the JadeProfiler class to start and stop collecting code coverage results and to report on the statistics.
Whilst you can gather code coverage results for any application, the main use is in measuring the quality of a suite of software testing methods.
The code coverage methods in the JadeProfiler class are used as follows.
-
The startCodeCoverage method is called in the setup method before the testing starts.
-
The stopCodeCoverage method is called in the teardown method after the testing ends.
-
The reportCodeCoverage method is called to output the code coverage results to a file. If there is an existing file, records are appended to the file.
-
The viewCodeCoverage method is called to stop the code coverage session, automatically initiate the code coverage application, and display the created code coverage result file in the Code Coverage Results Browser.
For details, see Volume 1 of the JADE Encyclopaedia of Classes.