Abstract
Large Language Models (LLMs) have recently shown strong potential for automated unit test generation. This has motivated us to investigate whether developer-defined test doubles (commonly referred to as mocks) available in existing test suites can be leveraged to improve LLM-driven test generation. To this end, we propose MOCKMILL, an LLM-based technique and tool that generates test cases by exploiting mocking information automatically extracted from developer-written tests. MOCKMILL targets components that are replaced by test doubles in existing tests and uses the encoded stubbings and interaction expectations to guide test generation, combined with an iterative generation-and-repair process to ensure executable tests. We evaluated MOCKMILL on 10 open-source classes from six JAVA projects using four LLMs, and compared the generated tests with existing project tests and tests produced by baseline approaches. The results show that MOCKMILL's tests cover lines of code and kill mutants that existing tests and baseline-generated tests miss. Overall, our findings provide preliminary evidence that leveraging mocking information is a complementary and effective way to enhance LLM-based test generation.
| Original language | English (US) |
|---|---|
| Title of host publication | Proceedings - 2026 IEEE International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2026 |
| Publisher | Institute of Electrical and Electronics Engineers Inc. |
| Pages | 1-8 |
| Number of pages | 8 |
| ISBN (Electronic) | 9798319546913 |
| DOIs | |
| State | Published - 2026 |
| Event | 2026 IEEE International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2026 - Daejeon, Korea, Republic of Duration: May 18 2026 → May 22 2026 |
Publication series
| Name | Proceedings - 2026 IEEE International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2026 |
|---|
Conference
| Conference | 2026 IEEE International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2026 |
|---|---|
| Country/Territory | Korea, Republic of |
| City | Daejeon |
| Period | 5/18/26 → 5/22/26 |
Bibliographical note
Publisher Copyright:© 2026 IEEE.
Keywords
- LLMs
- Mocking
- Test Doubles
- Test Generation
Fingerprint
Dive into the research topics of 'Improving LLM-Driven Test Generation by Learning from Mocking Information'. Together they form a unique fingerprint.Cite this
- APA
- Standard
- Harvard
- Vancouver
- Author
- BIBTEX
- RIS