当前位置:
X-MOL 学术
›
ACM Trans. Softw. Eng. Methodol.
›
论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Using Relative Lines of Code to Guide Automated Test Generation for Python
ACM Transactions on Software Engineering and Methodology ( IF 4.4 ) Pub Date : 2020-09-26 , DOI: 10.1145/3408896 Josie Holmes 1 , Iftekhar Ahmed 2 , Caius Brindescu 3 , Rahul Gopinath 4 , He Zhang 3 , Alex Groce 1
ACM Transactions on Software Engineering and Methodology ( IF 4.4 ) Pub Date : 2020-09-26 , DOI: 10.1145/3408896 Josie Holmes 1 , Iftekhar Ahmed 2 , Caius Brindescu 3 , Rahul Gopinath 4 , He Zhang 3 , Alex Groce 1
Affiliation
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.
中文翻译:
使用相对代码行来指导 Python 的自动测试生成
原始代码行 (LOC) 是一个指标,乍一看,它似乎对自动化测试生成非常有用。在一种语言中,它既高度依赖语言,又在语义上不是非常有意义:一个编码器可以用比另一个编码器少得多的行来产生相同的效果。然而,相对位置 ,在同一个项目的组件之间,结果证明是自动化测试的一个非常有用的指标。在本文中,我们使用基于 LOC 计数的启发式方法来测试功能,以显着提高自动化测试生成的有效性。这种方法在收集代码覆盖率数据以指导测试具有非常高的开销的语言中特别有价值。我们使用 TSTL(模板脚本测试语言)工具将启发式应用于基于属性的 Python 测试。在我们的实验中,简单的 LOC 启发式可以大幅度提高分支和语句覆盖率(通常超过 20%,高达 40% 或更多),并以更大的幅度(通常超过 75% 和高达 400 % 或者更多)。LOC 启发式也很容易与其他方法结合使用,并且可以与,
更新日期:2020-09-26
中文翻译:
使用相对代码行来指导 Python 的自动测试生成
原始代码行 (LOC) 是一个指标,乍一看,它似乎对自动化测试生成非常有用。在一种语言中,它既高度依赖语言,又在语义上不是非常有意义:一个编码器可以用比另一个编码器少得多的行来产生相同的效果。然而,