Skip to content

A database of real-world C/C++ defaults to experiment in software engineering research

License

Notifications You must be signed in to change notification settings

Suresoft-GLaDOS/bugscpp

Repository files navigation

BugsCpp

Build Taxonomy Docs Tests Coverage Status

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.

Requirements

Hardware Requirement

  • CPU architecture: AMD64

Software Requirements

  • Docker: - Please make sure that the Docker daemon is running in the background.
  • Python version >= 3.9

Installation

Please install the required dependencies by running the following command:

make install

Example

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

Searching Defects by Tags

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.

Table of Defects

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

Documentation

For full documentation, please see github.io.

Bugs/Requests/Contributing

If you want to report a bug, request features or submit a pull request, please use the gitHub issue tracker to submit them.

Change Log

License

Copyright Suresoft Technologies Inc, 2021.

Distributed under the terms of the MIT license, BugsCpp is free and open source software.

About

A database of real-world C/C++ defaults to experiment in software engineering research

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published