Defects4cpp User Guide¶
Displaying a List of Defects¶
To view a list of defects, execute the following command:
python bugscpp/bugscpp.py show
Project Checkout¶
Before using the other commands, you need to checkout one of the projects from the displayed list. The available projects are: To checkout a project, use the following command:
python bugscpp/bugscpp.py checkout <PROJECT> <INDEX> [-b|--buggy] [-t|--target <WORKSPACE>]
Replace <PROJECT>
with the name of the project you want to checkout, and <INDEX>
with the index of the defect.
The project will be stored in either ./<WORKSPACE>/fixed-<INDEX>
or ./<PROJECT>/buggy-<INDEX>
(if the option``-b`` is provided).
If -t
is not given, <WORKSPACE>
is automatically set to ./<PROJECT>
.
For example, to checkout the first buggy version of the cpp_peglib
project, use the following command:
python bugscpp/bugscpp.py checkout cpp_peglib 1 --buggy
By default, the project will be stored in ./cpp_peglib/buggy-1
.
Building and Testing a Project¶
To build and test a project, use the following commands:
python bugscpp/bugscpp.py build <PATH>
python bugscpp/bugscpp.py test <PATH>
Replace <PATH>
with the path to the checkout directory of the project. For example, to build and test the buggy version of cpp_peglib-1
, you can use the following commands:
python bugscpp/bugscpp.py build ./cpp_peglib/buggy-1
python bugscpp/bugscpp.py test ./cpp_peglib/buggy-1
Running Specific Test Cases¶
You can run specific test cases separately using the following command:
python bugscpp/bugscpp.py test <PATH> --case <EXPR>
Replace <PATH>
with the path to the checkout directory of the project, and <EXPR>
with the test case IDs. For example, to run test cases 1 to 4 and 7 of the cpp_peglib
project, use the following command:
python bugscpp/bugscpp.py test ./cpp_peglib/buggy-1 --case 1-4,7
Generating Code Coverage Data¶
To generate code coverage data, add the --coverage
flag to the build and test commands:
python bugscpp/bugscpp.py build <PATH> --coverage
python bugscpp/bugscpp.py test <PATH> --coverage
For example, to generate code coverage data for the cpp_peglib
project, you can use the following commands:
python bugscpp/bugscpp.py build ./cpp_peglib/buggy-1 --coverage
python bugscpp/bugscpp.py test ./cpp_peglib/buggy-1 --coverage