Using Relative Lines of Code to Guide Automated Test Generation for Python

Author:

Holmes Josie1,Ahmed Iftekhar2ORCID,Brindescu Caius3,Gopinath Rahul4,Zhang He3,Groce Alex1

Affiliation:

1. School of Informatics, Computing 8 Cyber Systems, Northern Arizona University

2. Donald Bren School of Information and Computer Sciences, University of California, Irvine

3. School of Electrical Engineering and Computer, Oregon State University

4. Center for IT-Security, Privacy and Accountability (CISPA), University of Saarbrücken

Abstract

Raw lines of code (LOC) is a metric that does not, at first glance, seem extremely useful for automated test generation. It is both highly language-dependent and not extremely meaningful, semantically, within a language: one coder can produce the same effect with many fewer lines than another. However, relative LOC , between components of the same project, turns out to be a highly useful metric for automated testing. In this article, we make use of a heuristic based on LOC counts for tested functions to dramatically improve the effectiveness of automated test generation. This approach is particularly valuable in languages where collecting code coverage data to guide testing has a very high overhead. We apply the heuristic to property-based Python testing using the TSTL (Template Scripting Testing Language) tool. In our experiments, the simple LOC heuristic can improve branch and statement coverage by large margins (often more than 20%, up to 40% or more) and improve fault detection by an even larger margin (usually more than 75% and up to 400% or more). The LOC heuristic is also easy to combine with other approaches and is comparable to, and possibly more effective than, two well-established approaches for guiding random testing.

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Cited by 7 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. From Manual to Automatic: The Evolution of Test Case Generation Methods and the Role of GitHub Copilot;2023 International Conference on Frontiers of Information Technology (FIT);2023-12-11

2. DyFuzz: Skeleton-based Fuzzing for Python Libraries;2023 IEEE 23rd International Conference on Software Quality, Reliability, and Security (QRS);2023-10-22

3. On the Reproducibility of Software Defect Datasets;2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE);2023-05

4. Learning Deep Semantics for Test Completion;2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE);2023-05

5. Let a thousand flowers bloom: on the uses of diversity in software testing;Proceedings of the 2021 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software;2021-10-17

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3