Frama-C/LTest: LUncov

Infeasible test requirement detection

Frama-C/LTest (or LTest for short) is a generic and integrated toolkit for automation of white-box testing of C programs. This toolkit provides a unified support of many different testing criteria as well as an easy integration of new criteria. LUncov is the module of LTest in charge of detecting infeasible (or uncoverable) test requirements. As the rest of the toolkit, this module requires that your test requirements are encoded as labels.

LUncov is a Frama-C plugin.

LUncov offers three ways to detect infeasible requirements:

Installation

LUncov requires Frama-C 24.0 (Chromium) and OCaml 4.08.1 to be installed. To install it run the following commands in LUncov's directory:

    autoconf
./configure
make
make install

Depending of your system and your Frama-C installation, the latter command may need to be run as root or sudo-ed.

Usage

Three modes

Running the detection

To start detecting infeasible (or uncoverable) labels simply run:

frama-c -luncov-eva file.c -main fun

where file.c is the name of the file under test and fun is the name of the function under test.

N.B. LUncov automatically updates (or creates one if missing) the label coverage file (here test.labels).

Value analysis (Eva)-based detection

You may specify Eva analysis' parameters. See frama-c -eva-help and/or Eva's manual for details. It may be useful to limit the verbosity of the analysis (-eva-verbose), or to increase its precision, e.g.:

frama-c -luncov-eva -eva-verbose 0 -eva-precision 4 test.c

Label pruning will be based on a more precise value analysis, with -eva-precision 4 instructing Eva to tune some parameters towards more precision.

Other useful parameters include:

Weakest precondition (WP)-based detection

You may specify additional weakest precondition parameters. The most useful parameter is without a doubt -wp-model model to choose the actual model used by WP, for instance typed or hoare with options such as int (vs. nat) or cast. Recommended value: typed+int. See frama-c -wp-help or the WP manual for details.

Note that LUncov considers each annotation already present in the code as valid.

Hybrid approach: value analysis and weakest precondition

In addition to flags relevant to both approaches, the hybrid approach uses an additional parameter -luncov-strategy s. Indeed, the hybrid approach transfers some information computed by the value analysis to the weakest precondition calculus. The strategy s specifies what information to transfer. Accepted strategies are:

Label database initialization

LUncov assumes a label database is present. If you need to generate one from the source file on-the-fly, simply add -luncov-init to the command line. Alternatively, it can be run alone:

frama-c -luncov-init myfile.c

Debug info

frama-c -luncov-value -luncov-debug 1 test.c

Authors

Also many thanks to the rest of LTest's team: