一句话:提出仓库感知的LLM流水线,自动生成并精炼AR应用蜕变关系,并验证其可转化为测试断言。
AR 应用因虚拟内容、物理环境与代码动态交互而难以定义测试预言;蜕变测试依赖人工构造蜕变关系(MR),耗时费力。本文提出上下文感知流水线,利用仓库级上下文与推理编排生成并精炼 MR。在 142 个移动 AR 仓库上,三种上下文配置共生成 14,916 个候选 MR,分层上下文覆盖最广且冗余更低;智能体审议调和了 79.0% 的冲突,并在 88.2% 的结果中选择上下文感知关系。人工预言研究(n=141)表明精炼关系逻辑有效且足够具体,可直接转为测试断言;初步案例(n=5)显示生成 MR 的可执行测试能检测真实代码中的非等价变异。结果表明该方法可扩展地构建可靠、领域相关的测试预言。
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.
@inproceedings{abs-2607-28775,
title = {Repository-Aware Metamorphic Relation Generation for Augmented Reality Applications using Large Language Models},
author = {Dibyendu Brinto Bose and Jiawei Qin and Chris Brown},
booktitle = {ASE},
year = {2026},
doi = {10.1145/3832783.3837502}
}