arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2001.02444cs.SEcs.LG
收藏

学习对测试执行进行编码与分类

Learning to Encode and Classify Test Executions

University of Edinburgh(爱丁堡大学);Microsoft Research(微软研究院)

Foivos Tsimpourlas, Ajitha Rajan, Miltiadis Allamanis

AI总结:

针对自动化测试中的测试预言问题,提出基于测试执行轨迹监督学习的神经网络方法,仅用少量标注轨迹训练即可在多领域案例中实现95%以上的分类精度、召回率和特异度。

摘要:

自动判定测试执行正确性的挑战被称为测试预言问题,是自动化测试领域现存的核心问题之一。本文的目标是以通用、可扩展且准确的方式解决测试预言问题。为实现这一目标,我们对测试执行轨迹采用监督学习方法。我们为一小部分执行轨迹标注通过或失败的判定结果,利用这些带标注的轨迹训练神经网络(NN)模型,使其学会区分给定程序通过与失败执行的运行时模式。构建该神经网络模型的方法包含以下步骤:1. 对程序进行插桩,将执行轨迹记录为方法调用和全局状态组成的序列;2. 为一小部分执行轨迹标注判定结果;3. 设计神经网络组件,将执行轨迹中的信息嵌入为固定长度向量;4. 设计利用轨迹信息进行分类的神经网络模型;5. 在来自该程序的未见过的执行轨迹上评估推导得到的分类模型。\n我们使用来自不同应用领域的案例研究评估该方法:1. 以太坊区块链的模块;2. PyTorch深度学习框架的模块;3. 微软SEAL加密库组件;4. Sed流编辑器;5. 值指针库;6. 来自Linux数据包识别器L7-Filter的9种网络协议。我们发现,所有目标程序的分类模型都实现了超过95%的高精度、召回率和特异度,而训练仅使用了总轨迹数平均9%的数据。实验表明,所提出的神经网络模型作为测试预言非常有效,能够学习运行时模式,以区分来自不同应用领域的系统和测试的通过与失败测试执行。

英文摘要:

The challenge of automatically determining the correctness of test executions is referred to as the test oracle problem and is one of the key remaining issues for automated testing. The goal in this paper is to solve the test oracle problem in a way that is general, scalable and accurate. To achieve this, we use supervised learning over test execution traces. We label a small fraction of the execution traces with their verdict of pass or fail. We use the labelled traces to train a neural network (NN) model to learn to distinguish runtime patterns for passing versus failing executions for a given program. Our approach for building this NN model involves the following steps, 1. Instrument the program to record execution traces as sequences of method invocations and global state, 2. Label a small fraction of the execution traces with their verdicts, 3. Designing a NN component that embeds information in execution traces to fixed length vectors, 4. Design a NN model that uses the trace information for classification, 5. Evaluate the inferred classification model on unseen execution traces from the program. We evaluate our approach using case studies from different application domains: 1. Module from Ethereum Blockchain, 2. Module from PyTorch deep learning framework, 3. Microsoft SEAL encryption library components, 4. Sed stream editor, 5. Value pointer library and 6. Nine network protocols from Linux packet identifier, L7-Filter. We found the classification models for all subject programs resulted in high precision, recall and specificity, over 95%, while only training with an average 9% of the total traces. Our experiments show that the proposed neural network model is highly effective as a test oracle and is able to learn runtime patterns to distinguish passing and failing test executions for systems and tests from different application domains.

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

↑