MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing
Congying Xu, Songqiang Chen, Jiarong Wu, Shing-Chi Cheung, Valerio Terragni, Hengcheng Zhu, Jialun Cao

TL;DR
MR-Adopt automatically deduces input transformations from hard-coded test cases using LLMs, enabling reuse of metamorphic relations to improve test coverage and mutation scores.
Contribution
It introduces an LLM-based approach to automatically generate input transformations from encoded MRs, enhancing test case reusability and effectiveness.
Findings
MR-Adopt applies to 72% of encoded MRs, outperforming vanilla GPT-3.5 by 33.33%.
Test cases with MR-Adopt increase line coverage by 10.62%.
Mutation score improves by 18.91% with MR-Adopt transformations.
Abstract
While a recent study reveals that many developer-written test cases can encode a reusable Metamorphic Relation (MR), over 70% of them directly hard-code the source input and follow-up input in the encoded relation. Such encoded MRs, which do not contain an explicit input transformation to transform the source inputs to corresponding follow-up inputs, cannot be reused with new source inputs to enhance test adequacy. In this paper, we propose MR-Adopt (Automatic Deduction Of inPut Transformation) to automatically deduce the input transformation from the hard-coded source and follow-up inputs, aiming to enable the encoded MRs to be reused with new source inputs. With typically only one pair of source and follow-up inputs available in an MR-encoded test case as the example, we leveraged LLMs to understand the intention of the test case and generate additional examples of source-followup…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
