Defects4Cpp is another collection of reproducible bugs for C/C++ and a supporting infrastructure with the goal of automatic program debugging research inspired by Defects4J.
Docker daemon must be running in background in order to run.
A list of defect taxonomy can be displayed via the following:
python3 defects4cpp/d++.py show
For the rest commands to work, you need to checkout one of projects in the list displayed in the previous step. For instance, if you want to checkout cpp_peglib project:
$ python3 defects4cpp/d++.py checkout cpp_peglib 1
Finally, to build and test cpp_peglib, or any project you've just cloned, run the following sequence of commands:
$ python3 defects4cpp/d++.py build /path/to/cpp_peglib/fixed#1 $ python3 defects4cpp/d++.py test /path/to/cpp_peglib/fixed#1
You can run some test cases separately like this:
$ python3 defects4cpp/d++.py test /path/to/cpp_peglib/fixed#1 --case 1-4,7
However, you are probably interested in a snapshot where a buggy commit is just made.
The command is exactly the same except that --buggy
flag is set.
$ python3 defects4cpp/d++.py checkout cpp_peglib 1 --buggy
Set --coverage
to generate .gcov data.
$ python3 defects4cpp/d++.py build /path/to/cpp_peglib/buggy#1 --coverage $ python3 defects4cpp/d++.py test /path/to/cpp_peglib/buggy#1 --coverage
You'll see the artifact is generated in the current directory.
$ ls /path/to/cpp_peglib-fixed#1-1 /path/to/cpp_peglib-fixed#1-2 /path/to/cpp_peglib-fixed#1-3 ...
You can also see the buggy artifact is generated in the current directory.
$ ls /path/to/cpp_peglib-buggy#1-1 /path/to/cpp_peglib-buggy#1-2 /path/to/cpp_peglib-buggy#1-3 ...
Project | # of bugs | Short Description |
---|---|---|
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 | 210 | 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, Defects4Cpp is free and open source software.