JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language Models
Not on the map. Why?
Abstract (arXiv)
Code generation benchmarks such as HumanEval are widely adopted to evaluate LLMs' capabilities. However, after consolidating the latest 24 benchmarks, we noticed three significant imbalances. First, imbalanced programming language. 95.8% of benchmarks involve Python, while only 5 benchmarks involve Java. Second, imbalanced code granularity. Function-/statement-level benchmarks account for over 83.3% of benchmarks. Only a mere handful extends to class-/project-levels, and all are limited to Python. Third, lacking advanced features. Existing benchmarks primarily assess basic coding skills, while overlooking advanced Object-Oriented Programming (OOP) features (i.e., encapsulation, inheritance, and polymorphism). To fill these gaps, we propose JavaBench, a project-level Java benchmark that exercises OOP features. It comprises four Java projects with 389 methods in 106 Java classes. The test coverage is up to 92%, and JavaBench is attested by 282 undergraduate students, reaching a 90.93/100 average score (i.e., pass rate against the test suite), ensuring the quality of documentation, code skeleton, and tests. To better evaluate LLM's capability against JavaBench, we introduce a systematic evaluation design covering three context settings and five synthesis strategies at two granularities using three hierarchical metrics. Our extensive experiment yields several interesting findings. First, we noticed that regarding project-level Java programming, LLMs are far behind undergraduate students (no project can be correctly completed by any studied LLMs, and at most 41.17% Pass@5 in a more relaxed evaluation). Second, using method signature as prompt context may strike an ideal balance for project-level code generation. JavaBench is publicly available at https://github.com/java-bench/JavaBench.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 34 of its 63 references that are in the map. First posted on arXiv 10 Jun 2024.
Builds on
34 of 63 references.
References · 34
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
22 more
- 2019MathQA: Towards Interpretable Math Word Problem Solving with Operation-Based Formalismscited by 653
- 2024DeepSeek LLM: Scaling Open-Source Language Models with Longtermismcited by 621
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2023Time Travel in LLMs: Tracing Data Contamination in Large Language Modelscited by 175
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
- 2022Large Language Models Meet NL2Code: A Surveycited by 135
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2018Mapping Language to Code in Programmatic Contextcited by 104
- 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 89
- 2022CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generationcited by 87
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
- 2022Training and Evaluating a Jupyter Notebook Data Science Assistantcited by 31
- 2021Code Structure Guided Transformer for Source Code Summarizationcited by 29
- 2024Concerned with Data Contamination? Assessing Countermeasures in Code Language Modelcited by 14
- 2018FrAngel: Component-Based Synthesis with Control Structurescited by 10
Built on by
Citing papers per year: 2024: 1; 2025: 5; 2026: 4.
10 papers.
- 2024CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Executioncited by 31
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2025LLM Benchmarking with LLaMA2: Evaluating Code Development Performance Across Multiple Programming Languagescited by 5
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Qualitycited by 3
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptationcited by 1
- 2026Benchmarking Large Language Models for ABAP Code Generation: An Empirical Study on Iterative Improvement by Compiler Feedbackcited by 1
- 2025SwiftEval: Developing a Language-Specific Benchmark for LLM-generated Code Evaluationcited by 0
- 2025CrossPL: Evaluating Large Language Models on Cross Programming Language Code Generationcited by 0
- 2026MobileDev-Bench: A Benchmark for Issue Resolution in Mobile Application Developmentcited by 0
- 2026Do Uncertainty Signals Help? A Systematic Study of Uncertainty-Aware Decoding with Rollback Mechanismscited by 0
- 2026Do Uncertainty Signals Help? A Systematic Study of Uncertainty-Aware Decoding with Rollback Mechanisms31 Jul 2026
- 2026MobileDev-Bench: A Benchmark for Issue Resolution in Mobile Application Development26 Mar 2026
- 2026Benchmarking Large Language Models for ABAP Code Generation: An Empirical Study on Iterative Improvement by Compiler Feedback21 Jan 2026
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation8 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025CrossPL: Evaluating Large Language Models on Cross Programming Language Code Generation26 Jul 2025
- 2025SwiftEval: Developing a Language-Specific Benchmark for LLM-generated Code Evaluation30 May 2025
- 2025LLM Benchmarking with LLaMA2: Evaluating Code Development Performance Across Multiple Programming Languages24 Mar 2025
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Quality7 Mar 2025
- 2024CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution23 Aug 2024