BugsCpp is another collection of reproducible bugs for C/C++ and a supporting infrastructure with the goal of automatic program debugging research inspired by Defects4J.
- CPU architecture: AMD64
- Docker: - Please make sure that the Docker daemon is running in the background.
- Python version >= 3.9
Please install the required dependencies by running the following command:
make install
To view a list of defects, execute the following command:
python bugscpp/bugscpp.py show
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
.
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
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
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
To search for defects using specific tags, use the following command:
python bugscpp/bugscpp.py search <TAG1> <TAG2> ...
Replace <TAG1>
, <TAG2>
, and so on, with the specific tags you want to search for.
For example, to search for defects related to "cve", "single-line", and "memory-error", use the following command:
python bugscpp/bugscpp.py search cve single-line memory-error
The command will display the projects that match the specified tags.
Project | # of bugs | Short Description |
---|---|---|
berry | 5 | A ultra-lightweight embedded scripting language optimized for microcontrollers. |
coreutils | 2 | GNU core utilities(the union of the GNU fileutils, sh-utils, and textutils packages). |
cpp_peglib | 10 | A single file C++ header-only PEG (Parsing Expression Grammars) library. |
cppcheck | 30 | Cppcheck is a static analysis tool for C/C++ code. |
dlt_daemon | 1 | GENIVI DLT provides a log and trace interface, based on the standardised protocol specified in the AUTOSAR |
example | 1 | Example test repo |
exiv2 | 20 | Exiv2 is a C++ library and a command-line utility to read, write, delete and modify Exif, IPTC, XMP and ICC image metadata |
jerryscript | 11 | JerryScript is a lightweight JavaScript engine for resource-constrained devices such as microcontrollers. |
libchewing | 8 | The Chewing (酷音) is an intelligent phonetic (Zhuyin/Bopomofo) input method, one of the most popular choices for Traditional Chinese users. |
libssh | 1 | libssh is a multiplatform C library implementing the SSHv2 protocol on client and server side. |
libtiff | 5 | This software provides support for the Tag Image File Format (TIFF), a widely used format for storing image data. |
libtiff_sanitizer | 4 | This software provides support for the Tag Image File Format (TIFF), a widely used format for storing image data. Sanitizer enabled. |
libucl | 6 | Universal configuration library parser |
libxml2 | 7 | libxml2 is an XML toolkit implemented in C, originally developed for the GNOME Project. |
md4c | 10 | MD4C stands for "Markdown for C", markdown parser implementation in C |
ndpi | 4 | nDPI® is an open source LGPLv3 library for deep-packet inspection. |
openssl | 28 | OpenSSL is a robust, commercial-grade, full-featured Open Source Toolkit for the Transport Layer Security (TLS) protocol formerly known as the Secure Sockets Layer (SSL) protocol. |
proj | 28 | PROJ is a generic coordinate transformation software, that transforms coordinates from one coordinate reference system (CRS) to another. |
wget2 | 3 | GNU Wget2 is the successor of GNU Wget, a file and recursive website downloader. |
wireshark | 6 | Wireshark is a network traffic analyzer, or "sniffer", for Linux, macOS, BSD and other Unix and Unix-like operating systems and for Windows. |
xbps | 5 | The X Binary Package System (in short XBPS) is a binary package system designed and implemented from scratch. |
yaml_cpp | 10 | A YAML parser and emitter in C++ |
yara | 5 | YARA is a tool aimed at (but not limited to) helping malware researchers to identify and classify malware samples. |
zsh | 5 | Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. |
SUM | 215 | Sum of all defects |
For full documentation, please see github.io.
If you want to report a bug, request features or submit a pull request, please use the gitHub issue tracker to submit them.
Copyright Suresoft Technologies Inc, 2021.
Distributed under the terms of the MIT license, BugsCpp is free and open source software.