Methods2Test: A dataset of focal methods mapped to test cases
Not on the map. Why?
Abstract (arXiv)
Unit testing is an essential part of the software development process, which helps to identify issues with source code in early stages of development and prevent regressions. Machine learning has emerged as viable approach to help software developers generate automated unit tests. However, generating reliable unit test cases that are semantically correct and capable of catching software bugs or unintended behavior via machine learning requires large, metadata-rich, datasets. In this paper we present Methods2Test: A dataset of focal methods mapped to test cases: a large, supervised dataset of test cases mapped to corresponding methods under test (i.e., focal methods). This dataset contains 780,944 pairs of JUnit tests and focal methods, extracted from a total of 91,385 Java open source projects hosted on GitHub with licenses permitting re-distribution. The main challenge behind the creation of the Methods2Test was to establish a reliable mapping between a test case and the relevant focal method. To this aim, we designed a set of heuristics, based on developers' best practices in software testing, which identify the likely focal method for a given test case. To facilitate further analysis, we store a rich set of metadata for each method-test pair in JSON-formatted files. Additionally, we extract textual corpus from the dataset at different context levels, which we provide both in raw and tokenized forms, in order to enable researchers to train and evaluate machine learning models for Automated Test Generation. Methods2Test is publicly available at: https://github.com/microsoft/methods2test
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). First posted on arXiv 23 Mar 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 3; 2024: 2; 2025: 3; 2026: 2.
10 papers.
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2023The Program Testing Ability of Large Language Models for Codecited by 11
- 2024A System for Automated Unit Test Generation Using Large Language Models and Assessment of Generated Test Suitescited by 8
- 2023Domain Adaptation for Code Model-based Unit Test Case Generationcited by 7
- 2023Assessing Evaluation Metrics for Neural Test Oracle Generationcited by 7
- 2025RepoTransAgent: Multi-Agent LLM Framework for Repository-Aware Code Translationcited by 3
- 2025Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generationcited by 1
- 2025LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Frameworkcited by 1
- 2026RefactorAssist: Agentic Refinement for Reliable Code Refactoringcited by 1
- 2026Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflowscited by 0
- 2026RefactorAssist: Agentic Refinement for Reliable Code Refactoring2 Aug 2026
- 2026Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflows10 Jul 2026
- 2025LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework25 Nov 2025
- 2025RepoTransAgent: Multi-Agent LLM Framework for Repository-Aware Code Translation25 Aug 2025
- 2025Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generation21 Mar 2025
- 2024A System for Automated Unit Test Generation Using Large Language Models and Assessment of Generated Test Suites14 Aug 2024
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar 2024
- 2023Assessing Evaluation Metrics for Neural Test Oracle Generation11 Oct 2023
- 2023The Program Testing Ability of Large Language Models for Code9 Oct 2023
- 2023Domain Adaptation for Code Model-based Unit Test Case Generation15 Aug 2023