Can AI Guide Testing Without Generating Tests? A Comparative Study of AI-Assisted Unit Testing
Zihan Fang, Ron Asoulin-Handelman, Helen Wu, Yu Huang, Gina R. Bai
Abstract
Recent advances in generative AI have enabled assistants to generate increasingly sophisticated executable unit tests. However, novices may accept these outputs without independently identifying what to test, evaluating test-suite completeness, or verifying correctness, potentially limiting opportunities to develop essential testing skills. Although prior work has explored AI-assisted test generation and feedback-oriented programming tutors, little is known about whether AI can support novices' testing practices without generating tests for them. To investigate this, we introduce TestCompass, a generative AI tutor that provides targeted feedback on weaknesses in students' test suites without generating executable tests. In a classroom study with 18 students, we compared TestCompass with a general AI assistant across two Java unit-testing tasks, examining students' testing behaviors, test-suite quality, and subjective experiences. We found that participants using the general-purpose AI assistant produced more tests, whereas TestCompass participants spent more time developing and verifying tests themselves. However, most test-suite quality measures were comparable between conditions, and TestCompass participants achieved similar requirement coverage with significantly fewer test methods () in one task. Neither group reported short-term improvements in perceived testing knowledge or confidence. These findings suggest that feedback-oriented AI can support meaningful testing outcomes while preserving opportunities for hands-on testing practice, offering a complementary approach to AI-assisted testing education.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI
- Comments
- 10 pages, 2 figures
Related papers
Beyond Coverage and Mutation: A Blind-Spot Analysis of LLM-Generated Unit Tests
Shared title terminologycs.SEXiaoyu Shi, Wenqiang Luo, Boyang Yang et al.
Can Coding Agents Write and Transpile Unit Tests
Shared title terminologycs.SEGil Pasternak, AJ Langley, Tom Yotam et al.
What reviewers call a Long Method is a length: A pre-registered test of coupling divergence as a god-unit signal, and what it settled instead
Shared title terminologycs.SEDaniel Sagenschneider
No More Import Errors: Constrained Decoding for Guaranteed Valid Imports in LLM-Generated Tests
Shared title terminologycs.SEKonstantinos Kitsios, Matteo Biagiola, Guido Salvaneschi et al.
Post-SQLFix: Property-Guided Repair of LLM-Generated SQL with Runtime Verification
Shared title terminologycs.SEZhihao Guo, Zonghan Wu, Yilei Shao et al.
Beyond Passing Tests: A Systematic Review and Controlled Re-evaluation of Techniques for Improving the Quality of LLM-Generated Code
Shared title terminologycs.SEPrashank Kadam