微观化:一种细粒度的自然语言冗余测试用例检测方法
Putting Them under Microscope: A Fine-Grained Approach for Detecting Redundant Test Cases in Natural Language
摘要:
自然语言文档是软件管理人员和测试人员之间的桥梁,自然语言测试用例在系统级测试和其他质量保证活动中非常普遍。由于需求冗余、并行测试、测试人员更替等原因,在软件开发过程中不可避免地会产生大量的冗余测试用例,从而大大增加了软件开发的成本。以往的冗余检测方法通常将文本描述作为一个整体来比较它们之间的相似性,精度不高。我们的观察表明,一个测试用例可以有明确的面向测试的实体,如测试功能组件,约束等;这些实体之间也有特定的关系。这给我们提供了一个精确冗余检测的潜在机会。本文首先定义了5种面向测试的实体类别和4种关联关系类别,将NL测试用例冗余检测问题重新表述为在面向测试的实体和关联关系指导下的详细测试内容的比较。在此基础上,我们提出了一种细粒度的冗余NL测试用例检测方法Tscope,该方法通过将测试用例分解为具有关联关系限制的实体的原子测试元组。作为测试用例的解剖,Tscope设计了一个上下文感知的自动实体和关系抽取模型。对10个项目的3,467个测试用例的评估表明,Tscope可以达到91.8%的准确率,74.8%的召回率和82.4%的F1,显著优于最先进的方法和常用的分类器。这种新的NL测试用例冗余检测问题的提法可以激励后续的研究,以进一步改善这一任务和其他相关的任务,涉及NL描述。
英文摘要:
Natural language (NL) documentation is the bridge between software managers and testers, and NL test cases are prevalent in system-level testing and other quality assurance activities. Due to reasons such as requirements redundancy, parallel testing, and tester turnover within long evolving history, there are inevitably lots of redundant test cases, which significantly increase the cost. Previous redundancy detection approaches typically treat the textual descriptions as a whole to compare their similarity and suffer from low precision. Our observation reveals that a test case can have explicit test-oriented entities, such as tested function Components, Constraints, etc; and there are also specific relations between these entities. This inspires us with a potential opportunity for accurate redundancy detection. In this paper, we first define five test-oriented entity categories and four associated relation categories and re-formulate the NL test case redundancy detection problem as the comparison of detailed testing content guided by the test-oriented entities and relations. Following that, we propose Tscope, a fine-grained approach for redundant NL test case detection by dissecting test cases into atomic test tuple(s) with the entities restricted by associated relations. To serve as the test case dissection, Tscope designs a context-aware model for the automatic entity and relation extraction. Evaluation on 3,467 test cases from ten projects shows Tscope could achieve 91.8% precision, 74.8% recall, and 82.4% F1, significantly outperforming state-of-the-art approaches and commonly-used classifiers. This new formulation of the NL test case redundant detection problem can motivate the follow-up studies to further improve this task and other related tasks involving NL descriptions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。