节点文献
基于LLM的热工水力程序蜕变关系识别方法
An LLM-based approach for identifying metamorphic relations in thermo-hydraulic programs
【Author】 HUANG Jun;LI Meng;YANG Xiaohua;LIU Jie;YAN Shiyu;School of Computing University of South China;Hunan Engineering Research Center of Software Evaluation and Testing for Intellectual Equipment;CNNC Key Laboratory on High Trusted Computing;
【机构】 南华大学计算机学院; 湖南省智能装备软件评测工程技术研究中心; 中核集团高可信计算重点学科实验室;
【摘要】 蜕变测试是一种有效缓解测试Oracle问题的技术,蜕变关系是其核心。但现阶段蜕变关系的识别主要依赖于领域知识,测试人员在识别过程中存在效率低下、关系质量不稳定及主观性强等问题。大语言模型(LLMs)具备广泛的知识储备,推理能力强。本文首次将LLM应用于热工水力程序的蜕变关系识别,提出单样本蜕变关系启发式识别方法。通过设计包含物理约束模板和热工行为特征的层次化提示框架,创新性地采用单样本学习范式激活LLM的领域推理能力,有效克服小样本场景下的知识迁移难题。构建一个提示增强框架,通过"假设生成—约束验证—反馈修正"的递进式提示流程,提高蜕变关系识别准确率和全面性。在热工水力程序的耦合、热工和事故程序上实验表明,不仅完整识别出专家推导的所有蜕变关系,而且在这三个程序上识别出的隐含蜕变关系准确率分别达到81.81%、80.00%、84.61%。有力地推进了蜕变测试研究,为研究者提供了良好示范与启发。
【Abstract】 Metamorphic testing is an effective technique for mitigating the test oracle problem,and metamorphic relations lie at its core.Currently,identifying these relations depends heavily on domain expertise,resulting in low efficiency,unstable relation quality,and intense subjectivity among testers.Large Language Models(LLMs) offer vast knowledge repositories and powerful reasoning capabilities.In this paper,we apply LLMs to the identification of metamorphic relations in thermo-hydraulic software for the first time,and we propose a single-sample heuristic method for relation discovery.By designing a hierarchical prompting framework that integrates physicalconstraint templates with thermo-hydraulic behavioral features,we innovatively adopt a singlesample learning paradigm to activate the LLM’s domain reasoning ability,effectively overcoming the knowledge-transfer challenges inherent in low-sample scenarios.We further develop a promptenhanced framework featuring a progressive "hypothesis generation-constraint validation-feedback correction" cycle to boost the accuracy and completeness of relation identification.Experiments on MULTI,NTHERMIX,and TACR modules reveal that our approach fully recovers all expertderived metamorphic relations and achieves accuracy rates of 81.81%,80.00%,and 84.61%,respectively,for implicitly inferred relations.This work advances metamorphic testing research and offers researchers valuable guidance and inspiration.
【Key words】 Large Language Models; metamorphic relation identification; thermal-hydraulic safety analysis;
- 【会议录名称】 中国核科学技术进展报告(第九卷)中国核学会2025年学术年会论文集 第2册
- 【会议名称】中国核学会2025年学术年会
- 【会议时间】2025-09-16
- 【会议地点】中国甘肃兰州
- 【分类号】TP18;TL33
- 【主办单位】中国核学会