Leveraging Conditional Statement to Generate Acceptance Tests Automatically via Traceable Sequence Generation

Published: 01 Jan 2023, Last Modified: 15 May 2025QRS 2023EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: In software development, testing is critical in guaranteeing software quality, with test case design at the core of the testing phase. However, generating effective test cases requires deep expertise and significant time and effort. Therefore, much prior research has turned to methods of Natural Language Processing, utilizing generative deep learning methods to automate test case generation. These earlier studies, however, have largely ignored the crucial role of conditional statements within software requirements - a factor we believe is indispensable for generating high-quality test cases. To bridge this gap, we introduce a pioneering approach for automatically deriving antecedents and consequents from requirements, termed as Traceable Sequence Generation (TSG). The TSG generates conditional statements first and then generates corresponding test cases by constructing a Cause-Effect-Graph. To verify the effectiveness of TSG, we constructed a requirement-to-test-case dataset, called Code Test Case Eval (CTCE). The dataset also includes annotated conditional statements for each segment of the requirement text, so we can utilize them to improve test case generation easily. Our experimental results indicate that TSG notably surpasses traditional and NLP-based methods, excelling in conditional statement extraction and generating high-coverage test cases.
Loading