Skip to main content
QUICK REVIEW

[Paper Review] AixBench: A Code Generation Benchmark Dataset

Yiyang Hao, Ge Li|arXiv (Cornell University)|Jun 27, 2022
Software Engineering ResearchComputer Science11 citations
TL;DR

AixBench is a method-level code generation benchmark for Java that includes 175 samples for automated correctness evaluation via unit tests and 161 samples for manual quality assessment. It introduces a new automatic metric (AvgPassRatio) and manual evaluation criteria, showing that both aiXcoder XL and GitHub Copilot achieve high correctness (pass@1: ~46-49%) and strong code quality, with Copilot slightly outperforming on maintainability.

ABSTRACT

We present a benchmark dataset for evaluating method-level code generation task. The benchmark contains a dataset of 175 samples for automated evaluation and a dataset of 161 samples for manual evaluation. We also present a new metric for automatically evaluating the correctness of the generated code, and a set of criteria to manually evaluating the overall quality of the generated code.

Motivation & Objective

  • To address the lack of benchmarks that evaluate code generation models on real-world, functional Java method descriptions with testable correctness.
  • To provide a dataset that supports both automated and manual evaluation of code generation models, including non-English prompts (Chinese and English).
  • To develop a new automatic metric, AvgPassRatio, that better reflects real-world utility than pass@k by measuring partial test pass rates.
  • To establish a standardized manual evaluation framework with three dimensions: correctness, code quality, and maintainability.
  • To evaluate state-of-the-art code generation models like aiXcoder XL and GitHub Copilot on a realistic, production-oriented benchmark.

Proposed method

  • The Automated Test Dataset contains 175 function descriptions with signatures and hand-crafted unit tests to enable automated correctness evaluation.
  • The NL Task Description Dataset contains 161 function descriptions with varying clarity and ambiguity to assess model robustness and manual evaluation quality.
  • A new metric, AvgPassRatio, is introduced to measure the average ratio of passed test cases per sample, offering a more practical measure than pass@k.
  • Manual evaluation uses a 3-dimensional scoring system: correctness (1–4 points), code quality (1–3 points), and maintainability (1–5 points).
  • Natural language descriptions are curated from open-source Java projects, with improvements to ensure testability and clarity while preserving natural language variations.
  • Models are evaluated on both datasets using automated test pass rates and manual scoring by human annotators.

Experimental results

Research questions

  • RQ1How well do code generation models perform on a realistic, production-oriented Java benchmark with automated test cases?
  • RQ2Can the AvgPassRatio metric better reflect the practical utility of generated code compared to pass@k?
  • RQ3How do models like aiXcoder XL and GitHub Copilot compare in correctness and code quality when evaluated on ambiguous or incomplete natural language descriptions?
  • RQ4To what extent do non-English prompts (Chinese) affect model performance in code generation tasks?
  • RQ5How do manual evaluation criteria for correctness, code quality, and maintainability correlate with automated test results?

Key findings

  • aiXcoder XL achieved a pass@1 score of 49.14% on the 175-sample automated test set, while GitHub Copilot scored 46.29%.
  • The AvgPassRatio for aiXcoder XL was 68.68%, and for GitHub Copilot, it was 69.55%, indicating both models generate code that passes a high proportion of test cases.
  • In manual evaluation, GitHub Copilot scored higher on maintainability (3.0931) than aiXcoder XL (2.9937), suggesting better code structure and readability.
  • Both models showed similar correctness scores (2.9503 vs. 2.9875), indicating strong performance on functional requirements.
  • Code quality scores were slightly higher for aiXcoder XL (2.2049) than GitHub Copilot (2.1739), though the difference is marginal.
  • The benchmark successfully captures real-world development challenges, including ambiguous descriptions and non-English prompts, and provides a reliable evaluation framework for code generation models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.