Creating a C Fault Matrix
A fault matrix file contains information about the faults exposed by the test cases present in a STImpL file for a particular version. It gives the mapping between the fault and the test cases which expose that fault. The steps to generate a fault matrix file are given below.
Steps to generate a fault matrix file:
- Make sure that the
mtsandgen_fault_matrixtools are present in the current path. To download these tools see: tools. - Set environment variable
experiment_rootto point to the parent directory of the object's directory by typingsetenv experiment_root <path>For example, suppose your objects directory containing all the objects is located at "/nfs/phantom/u10/goel/objects", then the experiment_root is set by typingsetenv experiment_root /nfs/phantom/u10/goel. - Run the tool to create the fault matrix file, by typing:
make_fault_matrix_with_names.sh <prog> <version start>
<number of versions> <test STImpL file> <fault matrix file><prog>: name of object program.
<version start>: the version starting from which we want to create a fault-matrix file.
<versions>: the total number of versions for which we want to create fault-matrix files.
<test STImpL file>: name of the test STImpL file (either .tsl.universe or .cov.universe file)
<fault matrix file>: name of the fault matrix file to create.
We will look at the flex object as an example.
In flex, faults are seeded from version v1 onwards and the STImpL file
v0.tsl.universe is inherited accross all the versions, i.e. from v1 to v5.
But version v5 does not have any seeded faults, therefore the number of
versions for which the tool will create a fault matrix file will be 4,
i.e. from v1 to v4.
The name of the fault matrix file to create is fault-matrix.v0.tsl.universe (described in object-dir-spec). To run the tool we type:
make_fault_matrix_with_names.sh flex 1 4 v0.tsl.universe fault-matrix.v0.tsl.universe
This command creates the fault matrix files for the test STImpL file v0.tsl.universe on versions v1 to v4 and stores them in the object's info directory, under subdirectories v1 to v4.
Now suppose we want to create the fault matrices for the test STImpL file v2.tsl.universe. Since it is inherited across all the versions from v2 to v5 and version v5 does not have any seeded faults, we type:
make_fault_matrix_with_names.sh flex 2 3 v2.tsl.universe fault-matrix.v2.tsl.universe
Note that to create a fault matrix, this tool executes each version on each test in the STImpL file and this may take some time!