Company
Date Published
Author
Michael Churchman
Word count
1225
Language
English
Hacker News points
None

Summary

The Microsoft Fakes framework is a testing tool that allows developers to test their code's interaction with dependencies, external applications, and system resources in a controlled environment. It provides a way to supply realistic emulations of the required interactions by means of mocks, stubs, and shims. Unlike traditional mock frameworks, Microsoft Fakes generates stubs and shims, but not full mocks, which can result in additional programming overhead. The framework is fully integrated into Microsoft Visual Studio, allowing for easy generation of stub classes and integration with debugging. However, its use of shims has raised concerns about encouraging bad programming habits, as it bypasses interfaces to simplify testing. Ultimately, the choice between Microsoft Fakes and a third-party mock framework depends on the type of testing required and the level of complexity involved.