arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1907.08490cs.SE
收藏

基于NLP的用例规格说明自动生成验收测试用例

Automatic Generation of Acceptance Test Cases from Use Case Specifications: an NLP-based Approach

Chunhui Wang, Fabrizio Pastore, Arda Goknil, Lionel C. Briand

摘要:

验收测试是一项确认活动,旨在确保软件系统符合其功能需求。在安全关键系统中,它起着至关重要的作用,因为它是由软件标准强制执行的。测试工程师需要从需求中识别出所有有代表性的测试执行场景,确定触发这些场景的运行时条件,并最终提供满足这些条件的输入数据。考虑到需求规格说明通常很大,并且通常用自然语言提供,验收测试用例的生成往往是昂贵的和容易出错的。在本文中,我们提出了UMTG,一种方法,支持生成可执行的,系统级的,验收测试用例的需求规格在自然语言,减少所需的手工工作来生成测试用例,并确保需求覆盖率的目标。更具体地说,UMTG基于用例规范和被测系统的领域模型自动生成验收测试用例,这些用例规范和领域模型通常在许多开发环境中生成。与现有的方法不同,它不会对用例规范的表达能力施加很强的限制。我们依靠自然语言处理的最新进展来自动识别测试场景,并生成正式的约束条件,捕获触发执行的情况下,从而使生成的测试数据。在两个工业案例研究中,UMTG自动并正确地将95%的用例规范步骤转换为测试数据生成所需的正式约束;此外,它生成的测试用例不仅可以执行专家手动实现的所有测试场景,还可以执行一些以前没有考虑过的关键场景。

英文摘要:

Acceptance testing is a validation activity performed to ensure the conformance of software systems with respect to their functional requirements. In safety critical systems, it plays a crucial role since it is enforced by software standards. Test engineers need to identify all the representative test execution scenarios from requirements, determine the runtime conditions that trigger these scenarios, and finally provide the input data that satisfy these conditions. Given that requirements specifications are typically large and often provided in natural language, the generation of acceptance test cases tends to be expensive and error-prone. In this paper, we present UMTG, an approach that supports the generation of executable, system-level, acceptance test cases from requirements specifications in natural language, with the goal of reducing the manual effort required to generate test cases and ensuring requirements coverage. More specifically, UMTG automates the generation of acceptance test cases based on use case specifications and a domain model for the system under test, which are commonly produced in many development environments. Unlike existing approaches, it does not impose strong restrictions on the expressiveness of use case specifications. We rely on recent advances in natural language processing to automatically identify test scenarios and to generate formal constraints that capture conditions triggering the execution of the scenarios, thus enabling the generation of test data. In two industrial case studies, UMTG automatically and correctly translated 95% of the use case specification steps into formal constraints required for test data generation; furthermore, it generated test cases that exercise not only all the test scenarios manually implemented by experts, but also some critical scenarios not previously considered.

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

↑