《计算机应用》唯一官方网站 ›› 2024, Vol. 44 ›› Issue (9): 2863-2870.DOI: 10.11772/j.issn.1001-9081.2023091319

• 计算机软件技术 • 上一篇    下一篇

基于程序依赖关系的变异体生成策略

田甜, 邵阳阳(), 王苗苗, 杨欢   

  1. 山东建筑大学 计算机科学与技术学院,济南 250101
  • 收稿日期:2023-09-25 修回日期:2023-11-16 接受日期:2023-11-20 发布日期:2023-12-01 出版日期:2024-09-10
  • 通讯作者: 邵阳阳
  • 作者简介:田甜(1987—),女,山东德州人,副教授,博士,CCF会员,主要研究方向:程序分析与测试
    王苗苗(2000—),女,河南济源人,硕士研究生,主要研究方向:变异测试
    杨欢(1997—),男,江苏苏州人,硕士研究生,CCF会员,主要研究方向:程序分析、缺陷检测。
  • 基金资助:
    山东省自然科学基金资助项目(ZR2020MF084)

Mutant generation strategy based on program dependencies

Tian TIAN, Yangyang SHAO(), Miaomiao WANG, Huan YANG   

  1. School of Computer Science and Technology,Shandong Jianzhu University,Jinan Shandong 250101,China
  • Received:2023-09-25 Revised:2023-11-16 Accepted:2023-11-20 Online:2023-12-01 Published:2024-09-10
  • Contact: Yangyang SHAO
  • About author:TIAN Tian, born in 1987, Ph. D., associate professor. Her research interests include program analysis and testing.
    WANG Miaomiao, born in 2000, M. S. candidate. Her research interests include mutation testing.
    YANG Huan, born in 1997, M. S. candidate. His research interests include program analysis, defect detection.
  • Supported by:
    Shandong Provincial Natural Science Foundation(ZR2020MF084)

摘要:

针对数量庞大的变异体导致高昂变异测试代价的问题,提出一种基于程序依赖关系的变异体生成(PDMG)策略,选择满足一定约束条件的变异实施对象用于变异体生成。首先,基于数据依赖和控制依赖生成程序依赖图;其次,基于变异对象选择策略和程序依赖图选择被依赖语句作为变异对象;最后,对选择的变异对象注入变异算子生成变异体。将所提策略用于8个基准测试程序的变异测试。实验结果表明,与随机选择(RS)和变异算子选择(MOS)策略相比,PDMG策略在不降低变异测试有效性的前提下,平均减少了52.20%的变异体,提高了变异测试的执行效率。

关键词: 变异测试, 数据依赖, 控制依赖, 变异对象, 变异体约减

Abstract:

Aiming at the problem of large numbers of mutants leading to high mutation testing cost, a Program Dependency based Mutant Generation (PDMG) strategy was proposed to select the mutation implementation objects satisfying certain constraint conditions for mutation generation. Firstly, program dependency graphs were generated based on data dependencies and control dependencies. Then, based on the mutation object selection strategy and program dependency graphs, the dependency statements were selected as mutation objects. Finally, the mutation operator was injected to the selected mutation objects in order to generate mutants. The proposed method was applied to mutation testing of 8 benchmark test programs. Experimental results show that compared with Random Selection (RS) and Mutation Operator Selection (MOS) strategies, PDMG strategy can reduce the mutants by 52.20% on average, improving the execution efficiency of mutation testing without reducing the effectiveness of mutation testing.

Key words: mutation testing, data dependence, control dependence, mutation object, mutant reduction

中图分类号: