Repository-Aware Metamorphic Relation Generation for Augmented Reality Applications using Large Language Models

📅 2026-07-30
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenges in testing augmented reality (AR) applications, where dynamic virtual–physical interactions complicate oracle definition and manual metamorphic relation (MR) construction is costly. To overcome these issues, the authors propose a novel approach that automatically generates and refines MRs by integrating repository-level code context with a multi-agent negotiation mechanism. For the first time, large language model–based reasoning is orchestrated with contextual awareness at the repository scale to enhance MR coverage and reduce redundancy. Evaluation on 142 mobile AR projects shows that hierarchical context modeling covers 7,004 out of 14,916 candidate MRs; 88.2% of the refined MRs are contextually relevant and conflict-free. Manual validation confirms that the generated MRs are logically sound, executable, and successfully detect real nonequivalent bugs.
📝 Abstract
Metamorphic Testing (MT) provides a promising approach for testing software without defined test oracles by specifying expected relations between inputs and outputs, instead of relying on exact outputs. For example, testing Augmented Reality (AR) applications is challenging due to dynamic interactions between virtual content, physical environments, and code, which make traditional test oracles difficult to define. However, formulating metamorphic relations (MRs) is time-consuming and burdensome. We introduce a context-aware pipeline that generates and refines MRs using repository-level context and reasoning orchestration, evaluated on a dataset of 142 mobile AR system repositories. Across three context configurations generating 14,916 candidate MRs, hierarchical context yielded the broadest coverage (7,004 MRs across 142 repositories and 5,167 class--method pairs) and lower redundancy. An agentic deliberation process then reconciled conflicting candidates---observed in 79.0% of cases---reducing duplication and selecting context-aware relations in 88.2% of outcomes. A manual oracle study shows refined relations (n = 141) are both logically valid and sufficiently concrete to be directly translated into test assertions, and a preliminary case study reveals converting generated MRs (n = 5) into executable tests can detect non-equivalent mutations in real-world code. Overall, our results show that combining repository-aware MR generation with reasoning-based refinement enables scalable construction of reliable, domain-relevant test oracles.
Problem

Research questions and friction points this paper is trying to address.

Metamorphic Testing
Augmented Reality
Test Oracle
Metamorphic Relations
Repository-Aware
Innovation

Methods, ideas, or system contributions that make the work stand out.

Metamorphic Testing
Large Language Models
Repository-Aware Context
Augmented Reality
Test Oracle Generation