Saved in:
Bibliographic Details
Main Authors: Tip, Frank, Bell, Jonathan, Schaefer, Max
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2404.09952
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929746526339072
author Tip, Frank
Bell, Jonathan
Schaefer, Max
author_facet Tip, Frank
Bell, Jonathan
Schaefer, Max
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2404_09952
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LLMorpheus: Mutation Testing using Large Language Models
Tip, Frank
Bell, Jonathan
Schaefer, Max
Software Engineering
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.
title LLMorpheus: Mutation Testing using Large Language Models
topic Software Engineering
url https://arxiv.org/abs/2404.09952