Exploring Challenges in Test Mocking: Developer Questions and Insights from StackOverflow
Mumtahina Ahmed, Md Nahidul Islam Opu, Chanchal Roy, Sujana Islam Suhi, Shaiful Chowdhury

TL;DR
This study analyzes over 25,000 StackOverflow questions to understand developers' challenges with mocking in unit testing, revealing trends, difficulties, and common question types to inform better support and tooling.
Contribution
It provides a comprehensive analysis of mocking-related developer questions, identifying key challenges, evolving discussion topics, and question types through topic modeling and trend analysis.
Findings
Popular topics like Framework Selection are easier and quicker to resolve.
Complex topics such as HTTP Requests tend to be more difficult and less answered.
Over 70% of questions are 'How' questions, indicating a need for implementation guidance.
Abstract
Mocking is a common unit testing technique that is used to simplify tests, reduce flakiness, and improve coverage by replacing real dependencies with simplified implementations. Despite its widespread use in Open Source Software projects, there is limited understanding of how and why developers use mocks and the challenges they face. In this collaborative study, we have analyzed 25,302 questions related to Mocking on STACKOVERFLOW to identify the challenges faced by developers. We have used Latent Dirichlet Allocation for topic modeling, identified 30 key topics, and grouped the topics into five key categories. Consequently, we analyzed the annual and relative probabilities of each category to understand the evolution of mocking-related discussions. Trend analysis reveals that category like Advanced Programming peaked between 2009 and 2012 but have since declined, while categories such…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
