LLMorpheus: Mutation Testing Using Large Language Models
Top Cited Papers
- 25 April 2025
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 51 (6) , 1645-1665
Abstract
In mutation testing, the quality of a test suite is evaluated by introducing faults into a program and determining whether the program’s tests detect them. Most existing approaches for mutation testing involve the application of a fixed set of mutation operators, e.g., replacing a “+” with a “-”, or removing a function’s body. However, certain types of real-world bugs cannot easily be simulated by such approaches, limiting their effectiveness. This paper presents a technique for mutation testing where placeholders are introduced at designated locations in a program’s source code and where a Large Language Model (LLM) is prompted to ask what they could be replaced with. The technique is implemented in LLMorpheus, a mutation testing tool for JavaScript, and evaluated on 13 subject packages, considering several variations on the prompting strategy, and using several LLMs. We find LLMorpheus to be capable of producing mutants that resemble existing bugs that cannot be produced by StrykerJS, a state-of-the-art mutation testing tool. Moreover, we report on the running time, cost, and number of mutants produced by LLMorpheus, demonstrating its practicality.Keywords
All Related Versions
Funding Information
- National Science Foundation (CCF-2100037, CCF-2307742, CNS-2100015)
This publication has 49 references indexed in Scilit:
- Effective test generation using pre-trained Large Language Models and mutation testingInformation and Software Technology, 2024
- Enhancing Genetic Improvement Mutations Using Large Language Models2023
- Fuzzing for CPS Mutation Testing2023
- Mutation Testing Advances: An Analysis and Survey2019
- Higher order mutation testing: A Systematic Literature ReviewComputer Science Review, 2017
- Does choice of mutation tool matter?Software Quality Journal, 2016
- Higher accuracy and lower run time: efficient mutation analysis using non‐redundant mutation operatorsSoftware Testing, Verification and Reliability, 2014
- Judy – a mutation testing tool for JavaIET Software, 2010
- Higher Order Mutation TestingInformation and Software Technology, 2009
- Constraint-based automatic test data generationIEEE Transactions on Software Engineering, 1991