Litcius/Paper detail

GenMorph: Automatically Generating Metamorphic Relations via Genetic Programming

Jon Ayerdi, Valerio Terragni, Gunel Jahangirova, Aitor Arrieta, Paolo Tonella

2024IEEE Transactions on Software Engineering18 citationsDOIOpen Access PDF

Abstract

Metamorphic testing is a popular approach that aims to alleviate the oracle problem in software testing. At the core of this approach are Metamorphic Relations (MRs), specifying properties that hold among multiple test inputs and corresponding outputs. Deriving MRs is mostly a manual activity, since their automated generation is a challenging and largely unexplored problem. This paper presents <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">GenMorph</small> , a technique to automatically generate MRs for Java methods that involve inputs and outputs that are boolean, numerical, or ordered sequences. <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">GenMorph</small> uses an evolutionary algorithm to search for <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">effective</i> test oracles, i.e., oracles that trigger no false alarms and expose software faults in the method under test. The proposed search algorithm is guided by two fitness functions that measure the number of false alarms and the number of missed faults for the generated MRs. Our results show that <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">GenMorph</small> generates effective MRs for 18 out of 23 methods (mutation score >20%). Furthermore, it can increase <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Randoop</small> ’s fault detection capability in 7 out of 23 methods, and <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Evosuite</small> ’s in 14 out of 23 methods. When compared with AUTOMR, a state-of-the-art MR generator, <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">GenMorph</small> also outperformed its fault detection capability in 9 out of 10 methods.

Topics & Concepts

Computer scienceGenetic programmingProgramming languageTheoretical computer scienceArtificial intelligenceEvolutionary Algorithms and ApplicationsReinforcement Learning in RoboticsMetaheuristic Optimization Algorithms Research
GenMorph: Automatically Generating Metamorphic Relations via Genetic Programming | Litcius