CPP-UNITTEST-BENCH / README.md
vaishnavi0777's picture
Update README.md
2c55938 verified
metadata
dataset_info:
  features:
    - name: ID
      dtype: int64
    - name: Language
      dtype: string
    - name: Repository Name
      dtype: string
    - name: File Name
      dtype: string
    - name: File Path in Repository
      dtype: string
    - name: File Path for Unit Test
      dtype: string
    - name: Code
      dtype: string
    - name: Unit Test - (Ground Truth)
      dtype: string
  splits:
    - name: train
      num_bytes: 52934692
      num_examples: 2653
  download_size: 13965160
  dataset_size: 52934692
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*

Dataset Card for Open Source Code and Unit Tests

Dataset Details

Dataset Description

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.

  • Curated by: Vaishnavi Bhargava
  • Language(s): C++
image/png

Dataset Structure

from datasets import Dataset, load_dataset

# Load the dataset
dataset = load_dataset("Nutanix/cpp_unit_tests_benchmark_dataset")

# View dataset structure

DatasetDict({
    train: Dataset({
        features: ['ID', 'Language', 'Repository Name', 'File Name', 'File Path in Repository', 'File Path for Unit Test', 'Code', 'Unit Test - (Ground Truth)'],
        num_rows: 2653
    })
})

The dataset consists of the following columns:

  • ID: A unique identifier for each entry in the dataset. [Example: "0"]
  • Language: The programming language of the file. [Example: "cpp"]
  • Repository Name: The name of the GitHub repository, formatted as organisation/repository. [Example: "google/googletest"]
  • File Name: The base name of the file (without extension) where the code or test is located. [Example: "sample1"]
  • File Path in Repository: The relative path to the file within the GitHub repository. [Example: "googletest/samples/sample1.cc"]
  • File Path for Unit Test: The relative path to the unit test file, if applicable. [Example: "googletest/samples/sample1_unittest.cc"]
  • Code: The code content of the file, excluding any documentation or comments.
  • Unit Test - (Ground Truth): The content of the unit test file that tests the code.

Dataset Sources

Some analysis of the dataset:

The box plot representation depicting number of Code and Unit Test lines across different repositories

Uses

Direct Use

This dataset is suitable for :

  • Developing and evaluating automated testing tools.
  • Analyzing code quality by comparing code with its corresponding unit tests.
  • Training and testing LLM models for automated unit test generation.

Dataset Creation

Curation Rationale

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.

Source Data

Data Collection and Processing

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.

Who are the source data producers?

The source data producers are the contributors to the respective open-source GitHub repositories.

Bias, Risks, and Limitations

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.

Citation [optional]