Back to search

Hong Kong University of Science and Technology

Automated and Effective Metamorphic Testing: Relation Discovery, Deduction, and Generation

Abstract

dc:description

<p>Software testing is a fundamental process for ensuring the reliability and correctness of software systems. Metamorphic Testing (MT), as a powerful technique, has been applied in diverse domains to address the oracle problem—a fundamental problem in software testing. However, its broader adoption remains limited due to the difficulty of constructing effective metamorphic relations (MRs), which requires domain-specific expertise. This thesis addresses this challenge by proposing automated approaches for deriving effective MRs.</p> <p>This thesis makes three main contributions. First, this thesis introduces a novel direction of discovering and synthesizing MRs from existing tests. Building on the observation that developer-written test cases often embed domain knowledge that encodes MRs, we propose MR-Scout, an approach that automatically discovers and synthesizes MRs encoded in existing test cases. Using this approach, we discovered over 11,000 MR-encoded test cases from 701 open-source projects.</p> <p>Second, we focus on deducing input relations from output relations and example input-output pairs. While MR-Scout reveals that thousands of test cases can encode MRs, over 70% of them lack explicit input relations, which hinders their applicability. To address this, we propose MR-Adopt, which leverages large language models to generate input transformation functions that complement these incomplete MRs. Our evaluation shows that MR-Adopt successfully generates valid input transformations for 72% of incomplete MRs.</p> <p>Finally, we explore generating MRs directly from a target program via functional coupling analysis. Although MR-Scout and MR-Adopt effectively derive MRs from existing tests, such MR-encoded tests are relatively few in number, accounting for only 1% of test cases. To overcome this limitation, we propose MR-Coupler, an automated and domain-agnostic approach that generates metamorphic test cases via functional coupling analysis. The key insight is that functional coupling between methods, which is readily available in program code, can be formulated as MRs. This approach successfully generated concrete metamorphic test cases for over 90% of target programs. The generated test cases successfully revealed 22 real-world bugs.</p> <p>In summary, this thesis advances automated MT through relation discovery, deduction, and generation. These contributions advance the practical and effective adoption of MT across diverse software systems.</p>

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Xu, Congying
Contributors dc:contributor
  • Cheung, Shing-chi

Rights

Language dc:language
English

Identifiers

dc:identifier.*

Chain of custody

source
Harvested from
Hong Kong University of Science and Technology
Base URL
repository.ust.hk/ir/OAI/Server
Last updated
2026-11-26
Source record
OAI-PMH GetRecord
related terms
citation

Xu, Congying. Automated and Effective Metamorphic Testing: Relation Discovery, Deduction, and Generation. 2026. http://repository.hkust.edu.hk/ir/Record/1783.1-171496