Dataset Viewer
Auto-converted to Parquet Duplicate
ID
int64
0
2.65k
Language
stringclasses
1 value
Repository Name
stringclasses
14 values
File Name
stringlengths
2
48
File Path in Repository
stringlengths
11
111
File Path for Unit Test
stringlengths
16
116
Code
stringlengths
411
31.4k
Unit Test - (Ground Truth)
stringlengths
40
32.1k
0
cpp
google/cel-cpp
kind
common/kind.cc
common/kind_test.cc
#ifndef THIRD_PARTY_CEL_CPP_BASE_KIND_H_ #define THIRD_PARTY_CEL_CPP_BASE_KIND_H_ #include "common/kind.h" #include "common/type_kind.h" #include "common/value_kind.h" #endif #include "common/kind.h" #include "absl/strings/string_view.h" namespace cel { absl::string_view KindToString(Kind kind) { switc...
#include "common/kind.h" #include <limits> #include <type_traits> #include "common/type_kind.h" #include "common/value_kind.h" #include "internal/testing.h" namespace cel { namespace { static_assert(std::is_same_v<std::underlying_type_t<TypeKind>, std::underlying_type_t<ValueKind>>, ...
1
cpp
google/cel-cpp
value_factory
common/value_factory.cc
common/value_factory_test.cc
#ifndef THIRD_PARTY_CEL_CPP_COMMON_VALUE_FACTORY_H_ #define THIRD_PARTY_CEL_CPP_COMMON_VALUE_FACTORY_H_ #include <cstdint> #include <string> #include <utility> #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/cord.h" #include "absl/strings/string_view.h" #include "absl/time/time....
#include "common/value_factory.h" #include <ostream> #include <sstream> #include <string> #include <tuple> #include <utility> #include <vector> #include "absl/strings/cord.h" #include "absl/types/optional.h" #include "common/casting.h" #include "common/json.h" #include "common/memory.h" #include "common/memory_testing....
2
cpp
google/cel-cpp
value_testing
common/value_testing.cc
extensions/protobuf/value_testing_test.cc
#ifndef THIRD_PARTY_CEL_CPP_EXTENSIONS_PROTOBUF_VALUE_TESTING_H_ #define THIRD_PARTY_CEL_CPP_EXTENSIONS_PROTOBUF_VALUE_TESTING_H_ #include <ostream> #include "absl/status/status.h" #include "common/value.h" #include "extensions/protobuf/internal/message.h" #include "extensions/protobuf/value.h" #include "internal/testi...
#include "extensions/protobuf/value_testing.h" #include "common/memory.h" #include "common/value.h" #include "common/value_testing.h" #include "extensions/protobuf/memory_manager.h" #include "extensions/protobuf/value.h" #include "internal/proto_matchers.h" #include "internal/testing.h" #include "proto/test/v1/proto2/t...
3
cpp
google/cel-cpp
type_introspector
extensions/protobuf/type_introspector.cc
extensions/protobuf/type_introspector_test.cc
#ifndef THIRD_PARTY_CEL_CPP_EXTENSIONS_PROTOBUF_TYPE_INTROSPECTOR_H_ #define THIRD_PARTY_CEL_CPP_EXTENSIONS_PROTOBUF_TYPE_INTROSPECTOR_H_ #include "absl/base/nullability.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "common/type.h" #include "common/...
#include "extensions/protobuf/type_introspector.h" #include "absl/types/optional.h" #include "common/type.h" #include "common/type_testing.h" #include "internal/testing.h" #include "proto/test/v1/proto2/test_all_types.pb.h" #include "google/protobuf/descriptor.h" namespace cel::extensions { namespace { using ::google::...
4
cpp
google/cel-cpp
constant
extensions/protobuf/internal/constant.cc
common/constant_test.cc
#ifndef THIRD_PARTY_CEL_CPP_EXTENSIONS_PROTOBUF_INTERNAL_CONSTANT_H_ #define THIRD_PARTY_CEL_CPP_EXTENSIONS_PROTOBUF_INTERNAL_CONSTANT_H_ #include "google/api/expr/v1alpha1/syntax.pb.h" #include "absl/base/nullability.h" #include "absl/status/status.h" #include "common/constant.h" namespace cel::extensions::protobuf_in...
#include "common/constant.h" #include <cmath> #include <string> #include "absl/strings/has_absl_stringify.h" #include "absl/strings/str_format.h" #include "absl/time/time.h" #include "internal/testing.h" namespace cel { namespace { using testing::IsEmpty; using testing::IsFalse; using testing::IsTrue; TEST(Constant, Nu...
5
cpp
google/cel-cpp
expr
common/expr.cc
common/expr_test.cc
#ifndef THIRD_PARTY_CEL_CPP_BASE_AST_INTERNAL_EXPR_H_ #define THIRD_PARTY_CEL_CPP_BASE_AST_INTERNAL_EXPR_H_ #include <cstddef> #include <cstdint> #include <memory> #include <string> #include <utility> #include <vector> #include "absl/container/flat_hash_map.h" #include "absl/types/optional.h" #include "absl/types/varia...
#include "base/ast_internal/expr.h" #include <memory> #include <string> #include <utility> #include "absl/types/variant.h" #include "common/ast.h" #include "internal/testing.h" namespace cel { namespace ast_internal { namespace { TEST(AstTest, ParsedExpr) { ParsedExpr parsed_expr; auto& expr = parsed_expr.mutable_e...
6
cpp
google/cel-cpp
decl
common/decl.cc
common/decl_test.cc
#ifndef THIRD_PARTY_CEL_CPP_COMMON_DECL_H_ #define THIRD_PARTY_CEL_CPP_COMMON_DECL_H_ #include <cstddef> #include <string> #include <utility> #include <vector> #include "absl/algorithm/container.h" #include "absl/base/attributes.h" #include "absl/container/flat_hash_set.h" #include "absl/hash/hash.h" #include "absl/sta...
#include "common/decl.h" #include "absl/status/status.h" #include "common/constant.h" #include "common/memory.h" #include "common/type.h" #include "internal/testing.h" namespace cel { namespace { using testing::ElementsAre; using testing::IsEmpty; using testing::UnorderedElementsAre; using cel::internal::StatusIs; TEST...
7
cpp
google/cel-cpp
type_factory
null
null
#ifndef THIRD_PARTY_CEL_CPP_COMMON_TYPE_FACTORY_H_ #define THIRD_PARTY_CEL_CPP_COMMON_TYPE_FACTORY_H_ #include "absl/strings/string_view.h" #include "common/memory.h" #include "common/sized_input_view.h" #include "common/type.h" namespace cel { namespace common_internal { class PiecewiseValueManager; } class TypeFactor...
#include "common/type_factory.h" #include <ostream> #include <sstream> #include <string> #include <tuple> #include "absl/types/optional.h" #include "common/memory.h" #include "common/memory_testing.h" #include "common/type.h" #include "common/type_introspector.h" #include "common/type_manager.h" #include "common/types/...
8
cpp
google/cel-cpp
ast_traverse
eval/public/ast_traverse.cc
eval/public/ast_traverse_test.cc
#ifndef THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_AST_TRAVERSE_H_ #define THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_AST_TRAVERSE_H_ #include "google/api/expr/v1alpha1/syntax.pb.h" #include "eval/public/ast_visitor.h" namespace google::api::expr::runtime { struct TraversalOptions { bool use_comprehension_callbacks; TraversalOptions() :...
#include "eval/public/ast_traverse.h" #include "eval/public/ast_visitor.h" #include "internal/testing.h" namespace google::api::expr::runtime { namespace { using google::api::expr::v1alpha1::Constant; using google::api::expr::v1alpha1::Expr; using google::api::expr::v1alpha1::SourceInfo; using testing::_; using Ident =...
9
cpp
google/cel-cpp
source
common/source.cc
common/source_test.cc
#ifndef THIRD_PARTY_CEL_CPP_COMMON_SOURCE_H_ #define THIRD_PARTY_CEL_CPP_COMMON_SOURCE_H_ #include <cstdint> #include <memory> #include <string> #include <utility> #include "absl/base/attributes.h" #include "absl/base/nullability.h" #include "absl/status/statusor.h" #include "absl/strings/cord.h" #include "absl/strings...
#include "common/source.h" #include "absl/strings/cord.h" #include "absl/types/optional.h" #include "internal/testing.h" namespace cel { namespace { using testing::ElementsAre; using testing::Eq; using testing::Ne; using testing::Optional; TEST(SourceRange, Default) { SourceRange range; EXPECT_EQ(range.begin, -1); ...
End of preview. Expand in Data Studio

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]

Downloads last month
19

Collection including Nutanix/CPP-UNITTEST-BENCH