基于程序约束的细粒度JVM测试程序约简方法
作者:
作者简介:

杜义恒(2000—),男,硕士生,CCF学生会员,主要研究领域为软件测试;王赞(1979—),男,博士,教授,CCF专业会员,主要研究领域为软件测试,机器学习;赵英全(1994—),男,博士生,主要研究领域为编译器测试,JVM测试,并发测试;陈俊洁(1992—),男,博士,副教授,CCF高级会员,主要研究领域为软件分析与测试;陈翔(1980—),男,博士,副教授,CCF高级会员,主要研究领域为智能软件工程,软件仓库挖掘,经验软件工程;侯德俊(1979—),男,高级工程师,主要研究领域为网络与空间安全,软件开发及安全;郑开(1999—),男,硕士生,主要研究领域为软件测试.

通讯作者:

侯德俊,E-mail:hdj@tju.edu.cn

基金项目:

国家自然科学基金(62232001,62002256)


Fine-grained JVM Test Program Reduction Method Based on Program Constraints
Author:
  • 摘要
  • | |
  • 访问统计
  • |
  • 参考文献 [41]
  • |
  • 相似文献 [20]
  • | | |
  • 文章评论
    摘要:

    为了对Java虚拟机(JVM)进行测试, 开发人员通常需要手工设计或利用测试生成工具生成复杂的测试程序, 从而检测JVM中潜在的缺陷. 然而, 复杂的测试程序给开发人员定位及修复缺陷带来了极高的成本. 测试程序约简技术旨在保障测试程序缺陷检测能力的同时, 尽可能地删减测试程序中与缺陷检测无关的代码. 现有研究工作基于Delta调试在C程序和XML输入上可以取得较好的约简效果, 但是在JVM测试场景中, 具有复杂语法和语义依赖关系的Java测试程序约简仍存在粒度较粗、约简效果较差的问题, 导致约简后的程序理解成本依然很高. 因此, 针对具有复杂程序依赖关系的Java测试程序, 提出一种基于程序约束的细粒度测试程序约简方法JavaPruner. 首先, 在语句块级别设计细粒度的代码度量方法; 随后, 在Delta调试技术上引入语句块之间的依赖约束关系来对测试程序进行约简. 以Java字节码测试程序为实验对象, 从现有的针对JVM测试的测试程序生成工具中筛选出具有复杂依赖关系的50个测试程序作为基准数据集, 并在这些数据集上验证JavaPruner的有效性. 实验结果表明, JavaPruner可以有效删减Java字节码测试程序中的冗余代码. 与现有方法相比, 在所有基准数据集上, 约简能力平均可提升37.7%. 同时, JavaPruner可以在保障程序有效性及缺陷检测能力的同时, 将Java字节码测试程序最大约简至其原有大小的1.09%, 有效降低了测试程序的分析和理解成本.

    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. Nevertheless, 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 sound 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 study 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 with 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.

    参考文献
    [1] Chen JJ, Patra J, Pradel M, et al. A survey of compiler testing. ACM Computing Surveys, 2020, 53(1): Article No.4.
    [2] Chen Y, Su T, Sun C, et al. Coverage-directed differential testing of JVM implementations. In: Proc. of the 37th ACM SIGPLAN Conf. on Programming Language Design and Implementation. 2016. 85-99.
    [3] Chen Y, Su T, Su Z. Deep differential testing of JVM implementations. In: Proc. of the 41st IEEE/ACM Int'l Conf. on Software Engineering (ICSE). IEEE, 2019. 1257-1268.
    [4] Zhao Y, Wang Z, Chen J, et al. History-driven test program synthesis for JVM testing. In: Proc. of the 44th Int'l Conf. on Software Engineering. 2022. 1133-1144.
    [5] Gao T, Chen J, Zhao Y, et al. Vectorizing program ingredients for better JVM testing. In: Proc. of the 32st ACM SIGSOFT Int'l Symp. on Software Testing and Analysis. 2023. 526-537.
    [6] Zhang Y, Wang Z, Jiang J, et al. Toward improving the robustness of deep learning models via model transformation. In: Proc. of the 37th IEEE/ACM Int'l Conf. on Automated Software Engineering. 2022. 1-13.
    [7] Yang C, Chen J, Fan X, et al. Silent compiler bug de-duplication via three-dimensional analysis. In: Proc. of the 32nd ACM SIGSOFT Int'l Symp. on Software Testing and Analysis. 2023. 677-689.
    [8] Hammoudi M, Burg B, Bae G, et al. On the use of Delta debugging to reduce recordings and facilitate debugging of Web applications. In: Proc. of the 10th Joint Meeting on Foundations of Software Engineering. 2015. 333-344.
    [9] Kalhauge CG, Palsberg J. Binary reduction of dependency graphs. In: Proc. of the 27th ACM Joint Meeting on European Software Engineering Conf. and Symp. on the Foundations of Software Engineering. 2019. 556-566.
    [10] McDermid J. Software engineering: A practitioner's approach [book review]. Software Engineering Journal, 1995, 10(6): 266-266.
    [11] Moller KH, Paulish DJ. An empirical investigation of software fault distribution. In: Proc. of the 1st Int'l Software Metrics Symp. IEEE, 1993. 82-90.
    [12] Zeller A. Where do bugs come from? In: Yorav K, ed. Proc. of the 3rd Int'l Haifa Verification Conf. on Hardware and Software: Verification and Testing (HVC 2007). 2007.
    [13] Yang Y, Zhou Y, Sun H, et al. Hunting for bugs in code coverage tools via randomized differential testing. In: Proc. of the 41st IEEE/ACM Int'l Conf. on Software Engineering (ICSE). IEEE, 2019. 488-499.
    [14] Chen Y, Su T, Su Z. Deep differential testing of JVM implementations. In: Proc. of the 41st IEEE/ACM Int'l Conf. on Software Engineering (ICSE). IEEE, 2019. 1257-1268.
    [15] JavaPruner. 2023. https://github.com/sail-repos/JavaPruner
    [16] 龚丹丹, 苏小红, 王甜甜, 等. 面向软件错误定位的测试用例约简技术综述. 智能计算机与应用, 2014, 4(3): 39-41.
    Gong DD, Su XH, Wang TT, et al. A survey of test cases reduction approach oriented to software fault localization. Intelligent Computer and Applications, 2014, 4(3): 39-41(in Chinese with English abstract).
    [17] Yu Y, Jones JA, Harrold MJ. An empirical study of the effects of test-suite reduction on fault localization. In: Proc. of the 30th Int'l Conf. on Software Engineering. 2008. 201-210.
    [18] Zhong H, Zhang L, Mei H. An experimental study of four typical test suite reduction techniques. Information and Software Technology, 2008, 50(6): 534-546.
    [19] Zhang L, Marinov D, Zhang L, et al. An empirical study of JUnit test-suite reduction. In: Proc. of the 22nd IEEE Int'l Symp. on Software Reliability Engineering. IEEE, 2011. 170-179.
    [20] 顾庆, 唐宝, 陈道蓄. 一种面向测试需求部分覆盖的测试用例集约简技术. 计算机学报, 2011, 34(5): 879-888.
    Gu Q, Tang B, Chen DX. A test suite reduction technique for partial coverage of test requirements. Chinese Journal of Computers, 2011, 34(5): 879-888(in Chinese with English abstract).
    [21] Fraser G, Wotawa F. Redundancy based test-suite reduction. In: Proc. of the Int'l Conf. on Fundamental Approaches to Software Engineering. Berlin, Heidelberg: Springer, 2007. 291-305.
    [22] Zeller A, Hildebrandt R. Simplifying and isolating failure-inducing input. IEEE Trans. on Software Engineering, 2002, 28(2): 183-200.
    [23] Regehr J, Chen Y, Cuoq P, et al. Test-case reduction for C compiler bugs. In: Proc. of the 33rd ACM SIGPLAN Conf. on Programming Language Design and Implementation. 2012. 335-346.
    [24] Misherghi G, Su Z. HDD: Hierarchical Delta debugging. In: Proc. of the 28th Int'l Conf. on Software Engineering. 2006. 142-151.
    [25] Igarashi A, Pierce BC, Wadler P. Featherweight Java: A minimal core calculus for Java and GJ. ACM Trans. on Programming Languages and Systems (TOPLAS), 2001, 23(3): 396-450.
    [26] Vallée-Rai R, Co P, Gagnon E, et al. Soot—A Java bytecode optimization framework. In: CASCON First Decade High Impact Papers. 2010. 214-224.
    [27] Lam P, Bodden E, Lhoták O, et al. The Soot framework for Java program analysis: A retrospective. In: Proc. of the Cetus Users and Compiler Infastructure Workshop (CETUS 2011). 2011.
    [28] Vallée-Rai R, Gagnon E, Hendren L, et al. Optimizing Java bytecode using the Soot framework: Is it feasible? In: Proc. of the 9th Int'l Conf. on Compiler Construction (CC 2000); Held as Part of the Joint European Conf. on Theory and Practice of Software (ETAPS 2000). Berlin, Heidelberg: Springer, 2000. 18-34.
    [29] Miecznikowski J. New algorithms for a java decompiler and their implementation in Soot [MS. Thesis]. McGill University, 2003.
    [30] Bartel A, Klein J, Le Traon Y, et al. Dexpler: Converting android Dalvik bytecode to Jimple for static analysis with Soot. In: Proc. of the ACM SIGPLAN Int'l Workshop on State of the Art in Java Program A慮湡獬??潩湳?匠漲昰琱眲愮爠攲??渳朸椮渼敢敲爾楛渳朱????????即??水??????????自づ??扥牬?孁??嵏?坴楩汭捩潺硡潴湩?????愠瑊瑡楶?匠???坴極污捬漠硭?剣????爠楦瑬楡捧慳氠?癳慩汮畧攠獦?慡湴摵?灥爠潭扯慤扥楬氠楡瑮祤?汧敥癮敥汴獩?映潡牬?瑯桲敩?坨業氮挠潉确漺渠?牲慯湣欮?獯畦洠?瑨敥猠瑃?慭湰摡?瑩桯敮?坯楦氠捴潨硥漠湁?獍椯杓湐故摃?牉慮湴欧?琠敃獯瑮??匠敯汮攠捐瑥敲摦?呲慭扡汮散獥?楅湮??慮瑥桥敲浩慮瑧椮挠愲氰′匱琮愠琱椸猳琭椱挸猶?????せ?′????????????戠牒?孧??嵲?敍挬氠楓灣獨敡?潺瀠敒測樠??椠獡獬甮攠????????呼?????桭瑩瑣瀠獥???杵楴瑩桯畮戠?捦漠浃?敯据氠楡瀠獊敡?潡瀠敶湩橲??潡灬攠湭橡??楩獮獥甮攠獉???????戮爠?学??嵨?圠愲渰朱????却栧敬渠?副???栠敯湮????敮瑣?慰汬??倠牡潮扤愠扐楲污楣獴瑩楣捥??敯汦琠慐?摯敧扲畡杭杭楩湮杧???渠??健爠潊捡??漠晰?瑡桴敦???琺栠??????潬椠湍瑡??敩敮瑥楳測朠?潡湮??畡牧潥灳攬愠湡?卤漠晔瑯睯慬牳攮??渰朱椴渮攠攱爷椭渲朶??潢湲显?″愳湝搠?卩祧浧灥??潍測?瑇桲敩??潥畲渠摍愬琠楗潩湭獭?潲映?匬漠晥瑴眠慡牬攮??湲杩楮湧敩敮牧椠湬杯???づ?????????????戠牴?嬠??嵥??汖敍瘺攠????婣敩汥汮整爠?????楴湩摯楮渠杯?映慌楌汖畍爠敉?挠慯畮猠整獲?瑦桦牬潥甮朠桉?愺甠瑐潲浯慣琮攠摯?琠整獨瑥椠游杴??慉牮塴椧癬?捗獯?にび??ば?????どひぴ?al Machines and Intermediate Languages. 2016. 6-15.
    [34] Smith J, Nair R. Virtual Machines: Versatile Platforms for Systems and Processes. Elsevier, 2005.
    [35] Allen FE. Control flow analysis. In: Proc. of the Symp. on Compiler Optimization. 1970. 1-19.
    [36] Bruschi D, Martignoni L, Monga M. Detecting self-mutating malware using control-flow graph matching. In: Proc. of the 3rd Int'l Conf. on Detection of Intrusions and Malware & Vulnerability Assessment (DIMVA 2006). Berlin, Heidelberg: Springer, 2006. 129-143.
    [37] Nandi A, Mandal A, Atreja S, et al. Anomaly detection using program control flow graph mining from execution logs. In: Proc. of the 22nd ACM SIGKDD Int'l Conf. on Knowledge Discovery and Data Mining. 2016. 215-224.
    [38] Kotzmann T, Wimmer C, Mössenböck H, et al. Design of the Java HotSpotTM client compiler for Java 6. ACM Trans. on Architecture and Code Optimization (TACO), 2008, 5(1): 1-32.
    [39] IBM. IBM developer kits. 2023. https://developer.ibm.com/javasdk/
    [40] Groce A, Holzmann G, Joshi R. Randomized differential testing as a prelude to formal verification. In: Proc. of the 29th Int'l Conf. on Software Engineering (ICSE 2007). IEEE, 2007. 621-631.
    [41] McKeeman WM. Differential testing for software. Digital Technical Journal, 1998, 10(1): 100-107.
    [42] McCabe TJ. A complexity measure. IEEE Tr????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
    引证文献
    网友评论
    网友评论
    分享到微博
    发 布
引用本文

杜义恒,王赞,赵英全,陈俊洁,陈翔,侯德俊,郑开.基于程序约束的细粒度JVM测试程序约简方法.软件学报,2024,35(7):3204-3226

复制
分享
文章指标
  • 点击次数:431
  • 下载次数: 2576
  • HTML阅读次数: 896
  • 引用次数: 0
历史
  • 收稿日期:2023-09-10
  • 最后修改日期:2023-10-30
  • 在线发布日期: 2024-01-05
  • 出版日期: 2024-07-06
文章二维码
您是第20054682位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号