15 Mutation testing15 Mutation testing
Top Top
17 LaTeX support 17 LaTeX support
16 Test coverage support

16 Test coverage support

This section assumes you have installed emacs. It also assumes you are familiar with the test case feature recently added to RSL: see section 1.7.

The tool supports test coverage analysis with the SML translator and SML run-time system. When you run the translated SML code to execute some test cases you may see messages of the form

Unexecuted expressions in X.rsl
or
Complete expression coverage of X.rsl

There may be several such messages if the system being tested involves several RSL modules. The first indicates that not all expressions in X.rsl were executed; the second indicates that they all were.

In the first case, to see the unexecuted expressions, open the file X.rsl and select the RSL menu item Show test coverage. The unexecuted expressions will be highlighted in red. The highlighting can be cancelled again by selecting the RSL menu item Cancel test coverage. It is possible that several coverage files from different tests are being merged to create an overall coverage, and the result of the merge may be to show that all expressions were in fact executed, in which case instead of some highlighting you will see the message Coverage is complete.

It is possible to run several tests (i.e. translate and run several different RSL files containing test cases) and combine the results. This is done automatically. The coverage results from executing X.rsl are held in files X.rsl.eln, where n may be missing or may be an integer.

If the file X.rsl is edited in any way then the coverage results are redundant, as the behaviour may have changed. Even editing such as pretty printing, which makes no functional changes, invalidates the coverage results as they are based on the positions in the buffer of the unexecuted expressions. So as soon as you change X.rsl you will get the RSL menu item Delete old coverage results, which should be selected to remove the X.rsl.eln files. It is sensible but not critical to remove such old coverage files: any coverage file X.rsl.eln older than X.rsl is ignored when calculating the coverage.

Note that the support for test coverage analysis currently depends on all the RSL files needed being stored in one directory.


Chris George, April 17, 2008

16 Test coverage support
15 Mutation testing15 Mutation testing
Top Top
17 LaTeX support 17 LaTeX support