arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1909.01679cs.SE
收藏

学习测试痕迹

Learning Test Traces

Eyal Hadad, Roni Stern

摘要:

现代软件项目包括自动化测试,用于检查程序的功能。测试调用的函数集称为测试的跟踪,获取跟踪的动作称为跟踪。有许多跟踪工具,因为跟踪对于各种软件工程任务都很有用,例如测试生成、故障定位和测试执行计划。使用测试迹线的一个主要缺点是获得它们,即,跟踪在计算资源和运行时间方面可能是昂贵的。先前的工作试图以各种方式解决这个问题,例如,通过选择性地仅跟踪某些软件组件或压缩运行中的跟踪。然而,所有这些方法仍然需要构建项目并执行测试,以获得其(部分,可能是压缩的)跟踪。这在许多情况下仍然非常昂贵。在这项工作中,我们提出了一种方法来预测每个测试的痕迹,而不执行它,只基于静态属性的测试和测试程序,以及过去的经验,在不同的测试。这种预测是通过应用监督学习来学习测试和函数的各种静态特征之间的关系以及一个将另一个包含在其轨迹中的可能性来完成的。然后,我们将展示如何使用预测的痕迹,在最近的自动故障排除范例称为学习诊断和计划(LDP),而不是实际的,成本高昂,以获得,测试痕迹。在对现实世界的开源项目的初步评估中,我们观察到我们的预测质量是合理的。此外,在LDP中使用我们的跟踪预测与使用真实跟踪时产生几乎相同的结果,同时需要更少的开销。

英文摘要:

Modern software projects include automated tests written to check the programs' functionality. The set of functions invoked by a test is called the trace of the test, and the action of obtaining a trace is called tracing. There are many tracing tools since traces are useful for a variety of software engineering tasks such as test generation, fault localization, and test execution planning. A major drawback in using test traces is that obtaining them, i.e., tracing, can be costly in terms of computational resources and runtime. Prior work attempted to address this in various ways, e.g., by selectively tracing only some of the software components or compressing the trace on-the-fly. However, all these approaches still require building the project and executing the test in order to get its (partial, possibly compressed) trace. This is still very costly in many cases. In this work, we propose a method to predict the trace of each test without executing it, based only on static properties of the test and the tested program, as well as past experience on different tests. This prediction is done by applying supervised learning to learn the relation between various static features of test and function and the likelihood that one will include the other in its trace. Then, we show how to use the predicted traces in a recent automated troubleshooting paradigm called Learn Diagnose and plan (LDP), instead of the actual, costly-to-obtain, test traces. In a preliminary evaluation on real-world open-source projects, we observe that our prediction quality is reasonable. In addition, using our trace predictions in LDP yields almost the same results comparing to when using real traces, while requiring less overhead.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑