Assertion-Aware Test Code Summarization with Large Language Models
Not on the map. Why?
Abstract (arXiv)
Unit tests often lack concise summaries that convey test intent, especially in auto-generated or poorly documented codebases. Large Language Models (LLMs) offer a promising solution, but their effectiveness depends heavily on how they are prompted. Unlike generic code summarization, test-code summarization poses distinct challenges because test methods validate expected behavior through assertions rather than implementing functionality. This paper presents a new benchmark of 91 real-world Java test cases paired with developer-written summaries and conducts a controlled ablation study to investigate how test code-related components-such as the method under test (MUT), assertion messages, and assertion semantics-affect the performance of LLM-generated test summaries. We evaluate four code LLMs (Codex, Codestral, DeepSeek, and Qwen-Coder) across seven prompt configurations using n-gram metrics (BLEU, ROUGE-L, METEOR), semantic similarity (BERTScore), and LLM-based evaluation. Results show that prompting with assertion semantics improves summary quality by an average of 0.10 points (2.3%) over full MUT context (4.45 vs. 4.35) while requiring fewer input tokens. Codex and Qwen-Coder achieve the highest alignment with human-written summaries, while DeepSeek underperforms despite high lexical overlap. The replication package is publicly available at https://doi.org/10. 5281/zenodo.17067550
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 22 of its 38 references that are in the map. First posted on arXiv 9 Nov 2025.
Builds on
22 of 38 references.
References · 22
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
- 2023A Survey of Large Language Modelscited by 2,537
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2023Distilled GPT for Source Code Summarizationcited by 30
10 more
- 2024Source Code Summarization in the Era of Large Language Modelscited by 30
- 2024Prompting in the Wild: An Empirical Study of Prompt Evolution in Software Repositoriescited by 16
- 2024Can Large Language Models Serve as Evaluators for Code Summarization?cited by 12
- 2024Leveraging Large Language Models for Enhancing the Understandability of Generated Unit Testscited by 11
- 2024PromptSet: A Programmer's Prompting Datasetcited by 9
- 2024ASSERTIFY: Utilizing Large Language Models to Generate Assertions for Production Codecited by 4
- 2021Test Smell Detection Tools: A Systematic Mapping Studycited by 3
- 2024Icing on the Cake: Automatic Code Summarization at Ericssoncited by 2
- 2023An Exploratory Study on the Usage and Readability of Messages Within Assertion Methods of Test Casescited by 1
- 2025Assertion Messages with Large Language Models (LLMs) for Codecited by 1
Built on by
Not cited yet.