PyTester: Deep Reinforcement Learning for Text-to-Testcase Generation
Wannita Takerngsaksiri, Rujikorn Charakorn, Chakkrit Tantithamthavorn,, Yuan-Fang Li

TL;DR
PyTester leverages deep reinforcement learning to generate accurate, executable test cases directly from natural language requirements, supporting true test-driven development without needing source code as input.
Contribution
This paper introduces PyTester, a novel deep RL-based approach for text-to-testcase generation that works from requirements, outperforming larger models on the APPS benchmark.
Findings
PyTester outperforms GPT-3.5, StarCoder, and InCoder on the APPS dataset.
Deep RL enables small models to generate high-quality test cases.
The approach supports true TDD by generating test cases from requirements alone.
Abstract
Test-driven development (TDD) is a widely-employed software development practice that mandates writing test cases based on requirements before writing the actual code. While writing test cases is the centerpiece of TDD, it is time-consuming, expensive, and often shunned by developers. To address these issues associated with TDD, automated test case generation approaches have recently been investigated. Such approaches take source code as input, but not the requirements. Therefore, existing work does not fully support true TDD, as actual code is required to generate test cases. In addition, current deep learning-based test case generation approaches are trained with one learning objective, i.e., to generate test cases that are exactly matched with the ground-truth test cases. However, such approaches may limit the model's ability to generate different yet correct test cases. In this…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Software Engineering Techniques and Practices
