forked from Suresoft-GLaDOS/bugscpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.rst.template
196 lines (125 loc) · 5.55 KB
/
README.rst.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
BugsCpp
===========
.. begin abstract
|gitHub-actions-badge| |taxonomy-badge| |docs| |tests-badge| |coverage-badge|
`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`_.
.. _`Defects4J`: https://github.com/rjust/defects4j
.. |github-actions-badge| image:: https://github.com/Suresoft-GLaDOS/bugscpp/actions/workflows/build.yml/badge.svg
:alt: Build
.. |taxonomy-badge| image:: https://github.com/Suresoft-GLaDOS/bugscpp/actions/workflows/taxonomy.yml/badge.svg
:alt: Taxonomy
.. |docs| image:: https://github.com/Suresoft-GLaDOS/bugscpp/actions/workflows/deploy-gh-pages.yml/badge.svg
:alt: Docs
.. |tests-badge| image:: https://suresoft-glados.github.io/bugscpp/reports/junit/tests-badge.svg?dummy=8484744
:target: https://suresoft-glados.github.io/bugscpp/reports/junit/report.html
:alt: Tests
.. |coverage-badge| image:: https://suresoft-glados.github.io/bugscpp/reports/coverage/coverage-badge.svg?dummy=8484744
:target: https://suresoft-glados.github.io/bugscpp/reports/coverage/index.html
:alt: Coverage Status
.. end abstract
Requirements
============
.. begin 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
.. end requirements
Installation
============
.. begin installation
Please install the required dependencies by running the following command:
::
make install
.. end installation
Example
=======
.. begin 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.
.. _`tags`: https://github.com/Suresoft-GLaDOS/bugscpp/wiki/tags_bugscpp
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.
.. end example
Table of Defects
================
@TABLE_OF_DEFECTS@
Documentation
=============
For full documentation, please see `github.io`_.
.. _`github.io`: https://suresoft-glados.github.io/bugscpp/
Bugs/Requests/Contributing
==========================
.. begin contribute
If you want to report a bug, request features or submit a pull request,
please use the gitHub issue tracker to submit them.
.. end contribute
Change Log
==========
.. begin changelog
.. end changelog
License
=======
.. begin license
Copyright `Suresoft Technologies Inc`_, 2021.
Distributed under the terms of the `MIT`_ license, BugsCpp is free and open source software.
.. _`MIT`: https://github.com/Suresoft-GLaDOS/bugscpp/blob/main/LICENSE
.. _`Suresoft Technologies Inc`: http://www.suresofttech.com/en/main/index.php
.. end license