mlsanityData to 7 Oct 2026

JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language Models

arXiv 2406.12902 ↗First posted 10 Jun 2024cs.LG cs.AI cs.PLcited by 10

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

  1. 2021Program Synthesis with Large Language Modelscited by 3,509
  2. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  3. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  4. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  6. 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
  7. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  10. 2021Measuring Coding Challenge Competence With APPScited by 879
  11. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  12. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
22 more
  1. 2019MathQA: Towards Interpretable Math Word Problem Solving with Operation-Based Formalismscited by 653
  2. 2024DeepSeek LLM: Scaling Open-Source Language Models with Longtermismcited by 621
  3. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  4. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  5. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
  6. 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
  7. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
  8. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
  9. 2023Time Travel in LLMs: Tracing Data Contamination in Large Language Modelscited by 175
  10. 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
  11. 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
  12. 2022Large Language Models Meet NL2Code: A Surveycited by 135
  13. 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
  14. 2018Mapping Language to Code in Programmatic Contextcited by 104
  15. 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 89
  16. 2022CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generationcited by 87
  17. 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
  18. 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
  19. 2022Training and Evaluating a Jupyter Notebook Data Science Assistantcited by 31
  20. 2021Code Structure Guided Transformer for Source Code Summarizationcited by 29
  21. 2024Concerned with Data Contamination? Assessing Countermeasures in Code Language Modelcited by 14
  22. 2018FrAngel: Component-Based Synthesis with Control Structurescited by 10

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 5; 2026: 4.

10 papers.