Requirements

Previous to using MuCPP

To avoid unintentional changes in your code: it is recommended to create a copy of the system under test before testing it with MuCPP; files will be under the version control system git once the mutation tool is executed.

Before using MuCPP, you should check that:
  1. Every file pertaining to the system under test is placed in the root directory or in its subdirectories, deleting the files not needed as much as possible to create a clean copy of the program.
  2. The system under test is not under a version control system. Also check that there is no a ".gitignore" file, as it might impede the correct operation of MuCPP.
  3. The files to be mutated should have write permission.
  4. The root directory, from where MuCPP will be executed, should not contain:
    • A directory called "reports_analyze".
    • A file called "tests_output.txt", "times_output.txt" or "comparison_results.txt".
  5. Remove/rename these files in case they exist before using MuCPP as they will be created when running the tool.

    In addition, MuCPP processes a file called list_operators.txt which is in the root directory of the system under test. The purpose of these files will be explained later on in this document.

Analysis

In case of using headers located in other directories (out of the root directory), those header files should be added as system headers and not as user headers. Thus, MuCPP will not consider these files for mutating them as they are not under the version control system git. To that end:
  • Use option –I for directories with user header files (they will be under git and can be mutated).
  • Use option –isystem for directories with system header files (they will not be under git and cannot be mutated).
MuCPP can be executed through two different methods:
  • Method 1: fixed compilation. Provide "--" at the end of the different commands (see Section "Options"). After "--", clang++ compiler options can be supplied to indicate how the files are compiled. Example: -I for a location of a header file (type clang++ --help to see the options).
  • Method 2: using a compilation database file created previously in the root directory (with the name "compile_commands.json"). In this way, indicating the command to compile the files is not needed.
    Visit http://clang.llvm.org/docs/JSONCompilationDatabase.html to know how to create the compilation database file.
For a correct execution of MuCPP, header files should not be included in the source code files using a path with "./" or "../", but using the same relative path to the root directory of the program any time the header file is included in another file. In case of using the method 2, every file analyzed in the same execution should have the same "directory", which is the root directory of the system under test.

Testing

MuCPP is not subject to a testing framework. Nevertheless, to execute the test suite it is necessary that you have a "Makefile" which includes the following rules:
  • mucpp_clean: clean all files that should be regenerated to execute the test suite.
  • mucpp_compilation: compile the mutated program.
  • mucpp_test: compile the test suite, generating executable files.
  • mucpp_execute: execute the test suite.
The tester must ensure that a file "tests_output.tmp" with the results of the test suite execution is generated in the process. Each line of that file contains, in the order of the execution of the tests, the result of each test case:
  • "0" means that the program passes the test case.
  • "1" means that the program fails the test case.
Optionally, a file "times_output.tmp" can be also generated by the tester, where each line represents the time spent by each test case. The unit of measure depends on the mechanism for the measurement of the times used by the tester.

MuCPP is provided along with a test library that automatically produce both files. See section "Test suite execution" in "Download and install" and section "Example program" for further information.