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

Test2Vec:一种用于测试用例优先级确定的执行跟踪嵌入方法

Test2Vec: An Execution Trace Embedding for Test Case Prioritization

University of Calgary(卡尔加里大学);Chalmers University of Technology(查尔姆斯理工大学)

Emad Jabbar, Soheila Zangeneh, Hadi Hemmati, Robert Feldt

摘要:

大多数自动化的软件测试任务都可以从测试用例的抽象表示中受益。传统上,这是通过基于代码覆盖率编码测试用例来完成的。规范级标准可以代替代码覆盖率来更好地表示测试用例的行为,但它们通常不具有成本效益。在本文中,我们假设测试用例的执行轨迹可以是抽象自动化测试任务行为的一个很好的替代方案。我们提出了一种新的嵌入方法,Test2Vec,将测试执行痕迹映射到潜在空间。我们在测试用例优先级(TP)任务中评估这种表示。我们默认的TP方法是基于嵌入向量与历史失败测试向量的相似性。我们还研究了基于测试向量的多样性的替代方案。最后,我们提出了一种方法来决定选择TP,对于一个给定的测试套件。该实验是基于几个真实的和种子故障超过一百万的执行跟踪。结果表明,我们提出的TP提高了41.80%的第一个失败的测试用例(FFR)的中位数归一化排名的最佳选择。在中位APFD和中位归一化FFR方面,它比传统的基于代码覆盖率的方法高出25.05%和59.25%。

英文摘要:

Most automated software testing tasks can benefit from the abstract representation of test cases. Traditionally, this is done by encoding test cases based on their code coverage. Specification-level criteria can replace code coverage to better represent test cases' behavior, but they are often not cost-effective. In this paper, we hypothesize that execution traces of the test cases can be a good alternative to abstract their behavior for automated testing tasks. We propose a novel embedding approach, Test2Vec, that maps test execution traces to a latent space. We evaluate this representation in the test case prioritization (TP) task. Our default TP method is based on the similarity of the embedded vectors to historical failing test vectors. We also study an alternative based on the diversity of test vectors. Finally, we propose a method to decide which TP to choose, for a given test suite. The experiment is based on several real and seeded faults with over a million execution traces. Results show that our proposed TP improves best alternatives by 41.80% in terms of the median normalized rank of the first failing test case (FFR). It outperforms traditional code coverage-based approaches by 25.05% and 59.25% in terms of median APFD and median normalized FFR.

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

↑