Zimic: Towards Compliant TypeScript API Mocks - Aquino, Diego C. de; Alves, Everton L. G. (Anais Estendidos do Congresso Brasileiro de Software: Teoria e Prática (CBSoft), 2025)
Mocks are a common strategy to reduce flakiness and complexity in automated testing. API mocks, which intercept communications with external services, must align with the actual implementation to ensure realistic test scenarios. However, current solutions for TypeScript API mocking do not adequately support testers in declaring compliant API mocks. In this paper, we introduce Zimic, a novel approach to TypeScript API mocking that enhances compliance through static validation and test abstractions. We evaluated Zimic in two empirical studies involving students and professional testers. Our results show that Zimic improves mock compliance by 24.1%, test completeness by 27.2%, and readability by 15.1% compared to existing solutions.