Skip to main content
QUICK REVIEW

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

Chunhui Wang, Fabrizio Pastore|arXiv (Cornell University)|Jul 19, 2019
Software Engineering ResearchComputer Science102 references12 citations
TL;DR

This paper presents UMTG, an NLP-based approach that automatically generates executable, system-level acceptance test cases from natural language use case specifications and a domain model, using semantic role labeling and constraint mining to extract test scenarios and conditions. In two industrial case studies, UMTG achieved 95% accuracy in translating use case steps into formal constraints and uncovered previously missed critical test scenarios.

ABSTRACT

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.

Motivation & Objective

  • To reduce manual effort and improve coverage in acceptance testing for safety-critical systems by automating test case generation from natural language requirements.
  • To address the limitations of existing approaches that require controlled natural language, formal models, or extensive manual modeling.
  • To enable automatic generation of executable test cases without additional behavioral modeling, leveraging existing development artifacts like use case specifications and class diagrams.
  • To ensure traceability and completeness of test coverage by mining formal constraints from natural language steps.

Proposed method

  • Uses semantic role labeling (SRL) to analyze use case steps and extract predicate-argument structures for test scenario identification.
  • Applies constraint mining techniques to transform natural language conditions into formal constraints for test data generation.
  • Constructs use case test models (UCTMs) as directed graphs representing execution paths, including loops and branches.
  • Employs a coverage-driven algorithm to maximize subtype and condition coverage during test scenario generation.
  • Integrates the Alloy constraint solver to generate executable test inputs based on formalized constraints.
  • Uses a domain model (class diagram) to validate and enrich the semantic interpretation of use case elements.

Experimental results

Research questions

  • RQ1Can NLP techniques be effectively used to extract executable test scenarios from natural language use case specifications?
  • RQ2To what extent can formal constraints be automatically derived from natural language requirements to support test data generation?
  • RQ3How effective is the proposed approach in achieving comprehensive test coverage without requiring controlled natural language or additional modeling?
  • RQ4Can the approach uncover critical test scenarios missed by manual test design in industrial settings?

Key findings

  • UMTG successfully translated 95% of use case specification steps into formal constraints required for test data generation in two industrial case studies.
  • The approach generated test cases that covered all scenarios manually implemented by experts, as well as previously overlooked critical scenarios.
  • Despite a theoretical worst-case time complexity of O(N³) for scenario generation, practical performance was feasible due to low numbers of condition steps and leaves in real-world use cases.
  • The number of condition steps leading to loops was on average only 18% of total steps, and leaves accounted for just 8%, reducing computational overhead.
  • The largest UCTM generated had 154 nodes, demonstrating that practical systems remain manageable even with high theoretical complexity.
  • The approach demonstrated feasibility on real industrial systems (BodySense and HOD), showing that NLP-based test generation is viable in industrial contexts.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.