{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/testeval-benchmarking-large-language-models","title":"TESTEVAL: Benchmarking Large Language Models for Test Case Generation","arxiv_id":"2406.04531","date":"2024-06-06","proceeding":null,"authors":["Wenhan Wang","Chenyuan Yang","Zhijie Wang","Yuheng Huang","Zhaoyang Chu","Da Song","Lingming Zhang","An Ran Chen","Lei Ma"],"abstract":"Testing plays a crucial role in the software development cycle, enabling the detection of bugs, vulnerabilities, and other undesirable behaviors. To perform software testing, testers need to write code snippets that execute the program under test. Recently, researchers have recognized the potential of large language models (LLMs) in software testing. However, there remains a lack of fair comparisons between different LLMs in terms of test case generation capabilities. In this paper, we propose TESTEVAL, a novel benchmark for test case generation with LLMs. We collect 210 Python programs from an online programming platform, LeetCode, and design three different tasks: overall coverage, targeted line/branch coverage, and targeted path coverage. We further evaluate sixteen popular LLMs, including both commercial and open-source ones, on TESTEVAL. We find that generating test cases to cover specific program lines/branches/paths is still challenging for current LLMs, indicating a lack of ability to comprehend program logic and execution paths. We have open-sourced our dataset and benchmark pipelines at https://github.com/LLM4SoftwareTesting/TestEval.","url_abs":"https://arxiv.org/abs/2406.04531v2","url_pdf":"https://arxiv.org/pdf/2406.04531v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"testeval-benchmarking-large-language-models","repo_url":"https://github.com/llm4softwaretesting/testeval","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.04531","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.04531"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/llm4softwaretesting/testeval","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":10,"unverified":5},"by_repo_kind":{"official":{"samples":15,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"f4e5ad618a9a9cbb","entry":"add_lineno","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"data_utils.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f4e5ad618a9a9cbb"}},{"code_sha256_prefix":"65d02e229f9a78b7","entry":"add_lineno_comment","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"data_utils.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"65d02e229f9a78b7"}},{"code_sha256_prefix":"337d5c7705c284c3","entry":"change_function_name","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"format.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/format.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"337d5c7705c284c3"}},{"code_sha256_prefix":"8671b30e9a445afa","entry":"execute","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"eval_base.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/eval_base.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8671b30e9a445afa"}},{"code_sha256_prefix":"d95b2ac22f4237ce","entry":"execute","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"eval_branchcov.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/eval_branchcov.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d95b2ac22f4237ce"}},{"code_sha256_prefix":"092972ae0ca5e520","entry":"generate_completion","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"gen_linecov_cot_hf.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/gen_linecov_cot_hf.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"092972ae0ca5e520"}},{"code_sha256_prefix":"2d783fc0a836c6b1","entry":"match_path","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"eval_pathcov.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/eval_pathcov.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2d783fc0a836c6b1"}},{"code_sha256_prefix":"60c584f55c9451fc","entry":"read_jsonl","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"data_utils.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"60c584f55c9451fc"}},{"code_sha256_prefix":"b4a15f613c2098bb","entry":"reformat_case_byrules","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"format.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/format.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b4a15f613c2098bb"}},{"code_sha256_prefix":"4959d7997d3a14f1","entry":"remove_extra","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"format.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/format.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4959d7997d3a14f1"}},{"code_sha256_prefix":"14f35d21477c79fd","entry":"check_correctness","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"eval_overall.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/eval_overall.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"14f35d21477c79fd"}},{"code_sha256_prefix":"db775593a397c583","entry":"coverage_at_k_sample","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"eval_overall.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/eval_overall.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"db775593a397c583"}},{"code_sha256_prefix":"b524c61a6f2dd835","entry":"eval_correctness","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"eval_linecov.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/eval_linecov.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b524c61a6f2dd835"}},{"code_sha256_prefix":"ab6bc90d53359b17","entry":"testgeneration_multiround","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"generate_cov_gemini.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/generate_cov_gemini.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab6bc90d53359b17"}},{"code_sha256_prefix":"75b3c705e3d449e4","entry":"testgeneration_multiround","repo":"llm4softwaretesting/testeval","repo_kind":"official","path":"generate_cov_hf.py","file_url":"https://github.com/llm4softwaretesting/testeval/blob/HEAD/generate_cov_hf.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"75b3c705e3d449e4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}