vaishnavi0777
commited on
Commit
•
2c55938
1
Parent(s):
c78bb6c
Update README.md
Browse files
README.md
CHANGED
@@ -29,3 +29,121 @@ configs:
|
|
29 |
- split: train
|
30 |
path: data/train-*
|
31 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
- split: train
|
30 |
path: data/train-*
|
31 |
---
|
32 |
+
---
|
33 |
+
# Dataset Card for Open Source Code and Unit Tests
|
34 |
+
|
35 |
+
## Dataset Details
|
36 |
+
|
37 |
+
### Dataset Description
|
38 |
+
|
39 |
+
This dataset contains c++ code snippets and their corresponding ground truth unit tests collected from various open-source GitHub repositories. The primary purpose of this dataset is to aid in the development and evaluation of automated testing tools, code quality analysis, and LLM models for test generation.
|
40 |
+
|
41 |
+
- **Curated by:** Vaishnavi Bhargava
|
42 |
+
- **Language(s):** C++
|
43 |
+
|
44 |
+
|
45 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6658bb3acf5fc31e3a0bd24a/hyIhFHmrjUzypFgNPU2UX.png" alt="image/png" width="800" height="600"/>
|
46 |
+
|
47 |
+
## Dataset Structure
|
48 |
+
|
49 |
+
```python
|
50 |
+
from datasets import Dataset, load_dataset
|
51 |
+
|
52 |
+
# Load the dataset
|
53 |
+
dataset = load_dataset("Nutanix/cpp_unit_tests_benchmark_dataset")
|
54 |
+
|
55 |
+
# View dataset structure
|
56 |
+
|
57 |
+
DatasetDict({
|
58 |
+
train: Dataset({
|
59 |
+
features: ['ID', 'Language', 'Repository Name', 'File Name', 'File Path in Repository', 'File Path for Unit Test', 'Code', 'Unit Test - (Ground Truth)'],
|
60 |
+
num_rows: 2653
|
61 |
+
})
|
62 |
+
})
|
63 |
+
```
|
64 |
+
|
65 |
+
The dataset consists of the following columns:
|
66 |
+
- `ID`: A unique identifier for each entry in the dataset. [Example: "0"]
|
67 |
+
- `Language`: The programming language of the file. [Example: "cpp"]
|
68 |
+
- `Repository Name`: The name of the GitHub repository, formatted as organisation/repository. [Example: "google/googletest"]
|
69 |
+
- `File Name`: The base name of the file (without extension) where the code or test is located. [Example: "sample1"]
|
70 |
+
- `File Path in Repository`: The relative path to the file within the GitHub repository. [Example: "googletest/samples/sample1.cc"]
|
71 |
+
- `File Path for Unit Test`: The relative path to the unit test file, if applicable. [Example: "googletest/samples/sample1_unittest.cc"]
|
72 |
+
- `Code`: The code content of the file, excluding any documentation or comments.
|
73 |
+
- `Unit Test - (Ground Truth)`: The content of the unit test file that tests the code.
|
74 |
+
|
75 |
+
|
76 |
+
### Dataset Sources
|
77 |
+
|
78 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6658bb3acf5fc31e3a0bd24a/jE8b8wf1uV_boMaHxsmnP.png" width="800" height="600" />
|
79 |
+
|
80 |
+
- **Repository:** The dataset is sourced from the following GitHub repositories: [Latest Commit before 2 July 24]
|
81 |
+
- [Pytorch](https://github.com/pytorch/pytorch)
|
82 |
+
- [Abseil Absl](https://github.com/abseil/abseil-cpp)
|
83 |
+
- [Google Test](https://github.com/google/googletest)
|
84 |
+
- [Libphonenumber](https://github.com/google/libphonenumber)
|
85 |
+
- [Tensorstore](https://github.com/google/tensorstore)
|
86 |
+
- [TensorFlow](https://github.com/tensorflow/tensorflow)
|
87 |
+
- [Glog](https://github.com/google/glog/tree/master/src/glog)
|
88 |
+
- [Cel-cpp](https://github.com/google/cel-cpp/tree/master)
|
89 |
+
- [LevelDB](https://github.com/google/leveldb)
|
90 |
+
- [Libaddressinput](https://github.com/google/libaddressinput/tree/master)
|
91 |
+
- [Langsvr](https://github.com/google/langsvr/tree/main)
|
92 |
+
- [tsl](https://github.com/google/tsl.git)
|
93 |
+
- [cel-cpp](https://github.com/google/cel-cpp.git)
|
94 |
+
- [quiche](https://github.com/google/quiche.git)
|
95 |
+
|
96 |
+
### Some analysis of the dataset:
|
97 |
+
|
98 |
+
|
99 |
+
The box plot representation depicting number of Code and Unit Test lines across different repositories
|
100 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6658bb3acf5fc31e3a0bd24a/E7aoKCvyRBjBR89sbetrR.png" width="800" height="600" />
|
101 |
+
|
102 |
+
<!-- The histogram visualizes the distribution of the number of lines in the "Code" and "Unit Test-(Ground Truth)" column of the dataset.
|
103 |
+
|
104 |
+
<div style="display: flex;">
|
105 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6658bb3acf5fc31e3a0bd24a/pm9VHIoIJgSBTWcmfXPOO.png" width="300" height="300" style="margin-right: 10px;" />
|
106 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6658bb3acf5fc31e3a0bd24a/Fo48OZiHeiVLQZ9yA5qch.png" width="300" height="300" />
|
107 |
+
</div>
|
108 |
+
|
109 |
+
The histogram visualizes the distribution of the number of tokens in the "Code" and "Unit Test-(Ground Truth)" column of the dataset.
|
110 |
+
|
111 |
+
<div style="display: flex;">
|
112 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6658bb3acf5fc31e3a0bd24a/UWb5i1bh5keq8hd7NdT6E.png" width="300" height="300" style="margin-right: 10px;" />
|
113 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6658bb3acf5fc31e3a0bd24a/bAgGzQGmrVrMxm-uHxffv.png" width="300" height="300" />
|
114 |
+
</div>
|
115 |
+
-->
|
116 |
+
|
117 |
+
## Uses
|
118 |
+
|
119 |
+
### Direct Use
|
120 |
+
|
121 |
+
This dataset is suitable for :
|
122 |
+
- Developing and evaluating automated testing tools.
|
123 |
+
- Analyzing code quality by comparing code with its corresponding unit tests.
|
124 |
+
- Training and testing LLM models for automated unit test generation.
|
125 |
+
|
126 |
+
|
127 |
+
## Dataset Creation
|
128 |
+
|
129 |
+
### Curation Rationale
|
130 |
+
|
131 |
+
The motivation for creating this dataset is to provide a comprehensive collection of code and unit tests from various reputable open-source projects. This can facilitate research and development in the areas of automated testing, code quality analysis, and LLM for software engineering.
|
132 |
+
|
133 |
+
### Source Data
|
134 |
+
|
135 |
+
#### Data Collection and Processing
|
136 |
+
|
137 |
+
The data was collected from public GitHub repositories. The selection criteria included repositories with well-documented code and corresponding unit tests. The data was filtered and normalized to ensure consistency.
|
138 |
+
|
139 |
+
#### Who are the source data producers?
|
140 |
+
|
141 |
+
The source data producers are the contributors to the respective open-source GitHub repositories.
|
142 |
+
|
143 |
+
## Bias, Risks, and Limitations
|
144 |
+
|
145 |
+
The dataset may have biases based on the coding practices and testing methodologies of the included repositories. It may not cover all possible scenarios and edge cases in software testing.
|
146 |
+
|
147 |
+
## Citation [optional]
|
148 |
+
|
149 |
+
|