Benchmarks and Metrics for Evaluations of Code Generation: A Critical Review
Debalina Ghosh Paul, Hong Zhu, Ian Bayley
TL;DR
This paper provides a critical survey of benchmarks and metrics used to evaluate large language models for code generation, highlighting the fragmentation and conflicting conclusions across evaluations. It analyzes how benchmarks are constructed (procurement, data extraction/processing, structure, and metadata) and how quality attributes are measured (functional correctness, syntactic closeness, usability) while exposing the limitations of traditional similarity metrics such as BLEU/ROUGE and even code-specific measures like CodeBLEU. The authors argue that test-based correctness offers a more reliable signal of real-world performance, but test adequacy and scenario-based evaluation remain unresolved challenges, necessitating more diverse benchmarks and metadata-driven feedback loops. They call for research directions that emphasize usability, automation in benchmarking, and scenario-aware evaluation to better predict developer usefulness and productivity in practical coding tasks.
Abstract
With the rapid development of Large Language Models (LLMs), a large number of machine learning models have been developed to assist programming tasks including the generation of program code from natural language input. However, how to evaluate such LLMs for this task is still an open problem despite of the great amount of research efforts that have been made and reported to evaluate and compare them. This paper provides a critical review of the existing work on the testing and evaluation of these tools with a focus on two key aspects: the benchmarks and the metrics used in the evaluations. Based on the review, further research directions are discussed.
