论文标题
将它们放在显微镜下:一种用于检测自然语言冗余测试用例的细粒度方法
Putting Them under Microscope: A Fine-Grained Approach for Detecting Redundant Test Cases in Natural Language
论文作者
论文摘要
自然语言(NL)文档是软件经理和测试人员之间的桥梁,NL测试用例在系统级测试和其他质量保证活动中很普遍。由于诸如需求冗余,并行测试和测试仪的流动之类的原因,不可避免地会有很多冗余的测试用例,这大大增加了成本。以前的冗余检测方法通常将文本描述整体视为比较它们的相似性并遭受低精度。我们的观察结果表明,测试案例可以具有明确的面向测试的实体,例如测试的功能组件,约束等;这些实体之间也有特定的关系。这激发了我们的潜在机会进行准确的冗余检测。在本文中,我们首先定义了五个面向测试的实体类别和四个相关的关系类别,并将NL测试案例冗余检测问题重新构建为对以测试为导向的实体和关系指导的详细测试内容的比较。在此之后,我们提出了TSCOPE,这是一种通过将测试用例剖析到原子测试元组中的冗余NL测试案例检测方法的细粒方法,该方法与受相关关系限制的实体。为了作为测试案例解剖,TSCOPE设计了一个自动实体和关系提取的上下文感知模型。对十个项目的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.