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

Guoliang Zhao,Gexiang Fang,Dongdong Du,Qing Gao,Minghui Zhang
DOI: https://doi.org/10.1109/qrs60937.2023.00046
2023-01-01
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.
What problem does this paper attempt to address?