Can Metamorphic Relations be Automatically Discovered?

04/15/2023
by   Congying Xu, et al.
0

Metamorphic testing alleviates the test oracle problem by defining oracles based on relations (i.e., metamorphic relations) that govern multiple related inputs and their expected outputs. However, designing MRs requires domain-specific knowledge, which may not be generally available. This hinders the widespread adoption of MT. Fortunately, we observe that developers often embed such domain knowledge that encodes MRs in test cases, even without the awareness of metamorphic testing. These encoded MRs might be generalized and useful for testing the original programs (where these MRs are found) and other programs with similar functionalities. In this paper, we propose MR-Extractor, to automatically discover metamorphic relations from existing test cases in open-source software (OSS) projects. MR-Extractor firstly identifies MR-encoded test cases in OSS, and then generalizes encoded MRs and codifies them into parameterized methods (called codified MR) for MT. Finally, MR-Extractor validates the reusability of codified MRs for new test generation. Experimental results show that (i) over 12,000 MR-encoded test cases are identified by MR-Extractor, accounting for 1.26 discovered by MR-Extractor can effectively improve test coverage. Compared with developer-written test suites, codified-MR-based test suites leads to a 25.97 and 25.83 Evosuite-generated test suites, codified-MR-based test suites even achieves an 83.11

READ FULL TEXT
research
09/20/2021

Metamorphic Relation Prioritization for Effective Regression Testing

Metamorphic testing (MT) is widely used for testing programs that face t...
research
07/28/2023

Exploring a Test Data-Driven Method for Selecting and Constraining Metamorphic Relations

Identifying and selecting high-quality Metamorphic Relations (MRs) is a ...
research
08/05/2021

Using Metamorphic Relations to Verify and Enhance Artcode Classification

Software testing is often hindered where it is impossible or impractical...
research
04/26/2022

Systematicity, Compositionality and Transitivity of Deep NLP Models: a Metamorphic Testing Perspective

Metamorphic testing has recently been used to check the safety of neural...
research
05/16/2023

Bug or not Bug? Analysing the Reasons Behind Metamorphic Relation Violations

Metamorphic Testing (MT) is a testing technique that can effectively all...
research
10/01/2019

Adaptive Metamorphic Testing with Contextual Bandits

Metamorphic Testing is a software testing paradigm which aims at using n...
research
02/19/2018

Predicting Metamorphic Relation for Matrix Calculation Programs

Matrices often represent important information in scientific application...

Please sign up or login with your details

Forgot password? Click here to reset