首页 | 本学科首页   官方微博 | 高级检索  
     

基于程序约束的细粒度JVM测试程序约简方法
引用本文:杜义恒,王赞,赵英全,陈俊洁,陈翔,侯德俊,郑开. 基于程序约束的细粒度JVM测试程序约简方法[J]. 软件学报, 2024, 35(7)
作者姓名:杜义恒  王赞  赵英全  陈俊洁  陈翔  侯德俊  郑开
作者单位:天津大学 智能与计算学部, 天津 300350;南通大学 信息科学技术学院, 江苏 南通 226019;中国科学院信息工程研究所, 信息安全国家重点实验室, 北京 100093;天津大学 信息与网络中心, 天津 300072
基金项目:国家自然科学基金(62232001、62002256)
摘    要:为了对Java虚拟机(JVM)进行测试,开发人员通常需要手工设计或利用测试生成工具生成复杂的测试程序,从而检测JVM中潜在的缺陷。然而,复杂的测试程序给开发人员定位及修复缺陷带来了极高的成本。测试程序约简技术旨在保障测试程序缺陷检测能力的同时,尽可能的删减测试程序中与缺陷检测无关的代码。现有研究工作基于Delta调试在C程序和XML输入上可以取得较好的约简效果,但是在JVM测试场景中,具有复杂语法和语义依赖关系的Java测试程序约减仍存在粒度较粗、约简效果较差的问题,导致约简后的程序理解成本依然很高。因此,针对具有复杂程序依赖关系的Java测试程序,本文提出一种基于程序约束的细粒度测试程序约简方法JavaPruner。首先在语句块级别设计细粒度的代码度量方法,随后在Delta调试技术上引入语句块之间的依赖约束关系来对测试程序进行约简。以Java字节码测试程序为实验对象,通过从现有的针对JVM测试的测试程序生成工具中筛选出具有复杂依赖关系的50个测试程序作为基准数据集,并在这些数据集上验证JavaPruner的有效性。实验结果表明,JavaPruner可以有效删减Java字节码测试程序中的冗余代码。与现有方法相比,在所有基准数据集上约减能力平均可提升37.7%。同时,JavaPruner可以在保障程序有效性及缺陷检测能力的同时将Java字节码测试程序最大约简至其原有大小的1.09% ,有效降低了测试程序的分析和理解成本。

关 键 词:Java虚拟机  JVM测试  测试程序约简  Delta调试
收稿时间:2023-09-10
修稿时间:2023-10-30

A Fine-grained JVM Test Program Reduction Method Based on Program Constraints
DU Yi-Heng,WANG Zan,ZHAO Ying-Quan,CHEN Jue-Jie,CHEN Xiang,HOU De-Jun,ZHENG Kai. A Fine-grained JVM Test Program Reduction Method Based on Program Constraints[J]. Journal of Software, 2024, 35(7)
Authors:DU Yi-Heng  WANG Zan  ZHAO Ying-Quan  CHEN Jue-Jie  CHEN Xiang  HOU De-Jun  ZHENG Kai
Affiliation:College of Intelligence and Computing, Tianjin University, Tianjin 300350, China;School of Information Science and Technology, Nantong University, Nantong 226019, China;State Key Laboratory of Information Security, Institute of Information Engineering, Chinese Academy of Sciences, Beijing 100093, China;Network and Information Center, Tianjin University, Tianjin 300072, China
Abstract:In order to test the Java Virtual Machine (JVM), developers often need to manually design or use test generation tools to create complex test programs to detect potential defects in the JVM. However, complex test programs bring high costs to developers in terms of locating and fixing defects. Test program reduction techniques aim to minimize the amount of code in test programs that is unrelated to defect detection, while maintaining the program''s defect detection ability. Existing research has achieved good reduction results based on Delta Debugging in C programs and XML inputs, but in the JVM testing scenario, Java test programs with complex syntax and semantic dependencies still have problems with coarse granularity and poor reduction effects, resulting in high comprehension costs even after reduction. Therefore, this paper proposes a fine-grained test program reduction method, called JavaPruner, based on program constraints for Java test programs with complex program dependencies. JavaPruner first designs a fine-grained code measurement method at the statement block level, and then introduces dependency constraint relationships between statement blocks based on Delta Debugging to reduce the test program. This work targets Java bytecode test programs, and selects 50 test programs with complex dependencies from existing test program generation tools for JVM testing as the benchmark dataset to evaluate the effectiveness of JavaPruner. Experimental results show that JavaPruner can effectively reduce redundant code in Java bytecode test programs. Compared to existing methods, the reduction capability can be improved by an average of 37.7% on all benchmark datasets. At the same time, JavaPruner can maximize the reduction of Java bytecode test programs to 1.09% of their original size while ensuring program effectiveness and defect detection ability, effectively reducing the analysis and comprehension costs of test programs.
Keywords:Java Virtual Machine  JVM Testing  Test Program Reduction  Delta Debugging
点击此处可从《软件学报》浏览原始摘要信息
点击此处可从《软件学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号