Automated test case generation from requirements specifications remains challenging, especially in DevOps workflows where continuous validation demands fast and reliable test creation. This paper proposes FSTG, a few-shot approach for generating test cases from Cockburn-style use cases using large language models. FSTG extracts semantic information from use cases and leverages schema-guided prompting to produce semantically consistent test cases with only a small number of demonstrations. To assess the effectiveness of the generated tests, the proposed approach includes an automated evaluation pipeline for measuring coverage and redundancy. Experiments on 112 use cases from five real-world systems show that FSTG achieves 89.2% transition coverage and detects 31.2 faults on average, showing improvements over both model-based and zero-shot baselines while reducing test generation time. These results indicate that FSTG reduces the gap between informal requirements and automated testing, enabling practical integration of AI-assisted test generation into DevOps workflows.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

FSTG: Few-Shot Test Case Generation from Use Case Specifications Using Large Language Models

  • Thanh-Binh Trinh,
  • Thi-Van Nguyen,
  • Ngoc-Minh Le,
  • Nguyen Viet Ha

摘要

Automated test case generation from requirements specifications remains challenging, especially in DevOps workflows where continuous validation demands fast and reliable test creation. This paper proposes FSTG, a few-shot approach for generating test cases from Cockburn-style use cases using large language models. FSTG extracts semantic information from use cases and leverages schema-guided prompting to produce semantically consistent test cases with only a small number of demonstrations. To assess the effectiveness of the generated tests, the proposed approach includes an automated evaluation pipeline for measuring coverage and redundancy. Experiments on 112 use cases from five real-world systems show that FSTG achieves 89.2% transition coverage and detects 31.2 faults on average, showing improvements over both model-based and zero-shot baselines while reducing test generation time. These results indicate that FSTG reduces the gap between informal requirements and automated testing, enabling practical integration of AI-assisted test generation into DevOps workflows.