工业信息安全2024,Issue(2) :21-31.

基于神经机器翻译的测试用例协同演化方法研究

Research on Co-evolution Methods for Test Cases Based on Neural Machine Translation

许道远 孙明明 李蓉
工业信息安全2024,Issue(2) :21-31.

基于神经机器翻译的测试用例协同演化方法研究

Research on Co-evolution Methods for Test Cases Based on Neural Machine Translation

许道远 1孙明明 1李蓉1
扫码查看

作者信息

  • 1. 恒安嘉新(北京)科技股份公司,北京,100086
  • 折叠

摘要

软件测试在软件安全保障和质量保证流程中扮演着关键角色,为了降低软件的维护成本,提高软件的安全性,需要尽早地发现和修复漏洞和问题.因此在软件版本迭代的过程中,测试代码需要在生产代码修改后及时更新.然而,测试代码往往难以和生产代码同步更新,导致测试效果不佳.协同演化方法被用于解决这一问题,但维持这一模式的成本较高.本文分析了现有研究,利用关联规则挖掘技术,研究了生产代码和测试代码之间的协同演化关系,提出了一种基于神经机器翻译(Neural Machine Translation,NMT)的测试用例协同演化方法(NMT-based Test Case Co-evolution,NTCC).通过分析生产代码和测试代码的历史提交来提取测试用例的特征,在历史提交的生产代码和测试上进行训练,然后在一个较小的生产代码数据集上进行调整,最后通过集束搜索的方法产生测试代码.实验结果表明,NTCC方法可以有效地识别生产-测试代码协同演化,准确率达到了78.33%,在正类和负类上的F1-分数分别为80.10%和76.22%,优于基线方法.

Abstract

Software testing plays a crucial role in ensuring software security and quality assurance processes.In order to reduce software maintenance costs and improve software security,it is necessary to identify and fix vulnerabilities as early as possible.Therefore,during the software version iteration process,the test code needs to be updated in a timely manner after production code modifications.However,testing code often finds it difficult to synchronize updates with production code,resulting in poor testing results.The co-evolution method is used to solve this problem,but its maintenance cost is relatively high.This article analyzes existing research and utilizes association rule mining technology to study the co-evolution relationship between production code and test code,as well as proposed the neural machine translation(NMT)based test case co-evolution method NTCC(NMT-based Test Case Co evolution).Extract the characteristics of test cases by analyzing the historical submissions of production code and test code,train on the historical submissions of production code and testing,then adjust on a smaller production code dataset,and finally generate test code through beam search.The experimental results show that the NTCC method can effectively identify the co evolution of production test code,with an accuracy of 78.33%.The F1 scores on positive and negative classes are 80.10%and 76.22%,respectively,which is better than the baseline method.

关键词

软件安全/软件测试/协同演化/神经机器翻译

Key words

Software Security/Software Testing/Co-evolution/Neural Machine Translation

引用本文复制引用

基金项目

工业互联网创新发展工程项目(2022)(TC220H055)

出版年

2024
工业信息安全
国家工业信息安全发展研究中心

工业信息安全

ISSN:2097-1176
参考文献量16
段落导航相关论文