Visual Studio – Do you Mock with Typemock or Microsoft?
Visual Studio is one of the most popular development tools, which means there's a huge number of developers that are going to be considering which tool to use for mocking during their unit-testing. Until recently this was a very simple question to answer. The Microsoft Faking tools were only available as part of the Ultimate edition of Visual Studio. In most development houses this is usually only available to team leaders, architects and the test development team, and developers tend to be left with the Premium Edition. That meant paying for significant numbers of additional Ultimate edition licenses to use Microsoft and Typemock was more cost effective.
A Change in Visual Studio
However, in the 2012 release of Visual Studio, this changed. Microsoft began to incorporate their Fake tools in the Premium Edition too. Developers now had access to the Fake functionality too. This reopened the question of whether you should create your mocks with Typemock's Isolator or use the Microsoft functionality.
The Issue
The cost advantage may have been eliminated by using Typemock but we've found there are still good reasons not to adopt the Microsoft Fakes approach.
Fakes is implemented in a completely different way within Visual Studio from the majority of the frameworks it uses. It's almost like stepping out of Visual Studio to get things done. This might be mildly irritating but it has genuine implications when it comes to refactoring. We've found that you'll end up rebuilding your fakes following refactoring and that takes up time that could be better spent on other work. This may also have implications for the unit-tests themselves as this refactoring may require you to revisit the test cases themselves.
Typemock's Isolator also has an advantage in that the syntax is familiar and easy to use. There's no need to manually assemble fakes.
The API is also very much the same as other Faking tools (like FakeItEasy and Mog) so your team should be able to switch when it comes to developing advanced mocks without much in the way of a learning curve. The basic functionality of Typomock's Isolator can also be adopted at no cost – though the advanced features do require a license fee.
That fee is paid back by the ease of use and the additional power of faking with Typemock. Microsoft has made a step in the right direction but one that hasn't gone far enough yet. For further in formation, please visit the unit testing blog. Got any questions about unit testing services? You are more that welcome to visit our humble automated unit testing blog online.
A Change in Visual Studio
However, in the 2012 release of Visual Studio, this changed. Microsoft began to incorporate their Fake tools in the Premium Edition too. Developers now had access to the Fake functionality too. This reopened the question of whether you should create your mocks with Typemock's Isolator or use the Microsoft functionality.
The Issue
The cost advantage may have been eliminated by using Typemock but we've found there are still good reasons not to adopt the Microsoft Fakes approach.
Fakes is implemented in a completely different way within Visual Studio from the majority of the frameworks it uses. It's almost like stepping out of Visual Studio to get things done. This might be mildly irritating but it has genuine implications when it comes to refactoring. We've found that you'll end up rebuilding your fakes following refactoring and that takes up time that could be better spent on other work. This may also have implications for the unit-tests themselves as this refactoring may require you to revisit the test cases themselves.
Typemock's Isolator also has an advantage in that the syntax is familiar and easy to use. There's no need to manually assemble fakes.
The API is also very much the same as other Faking tools (like FakeItEasy and Mog) so your team should be able to switch when it comes to developing advanced mocks without much in the way of a learning curve. The basic functionality of Typomock's Isolator can also be adopted at no cost – though the advanced features do require a license fee.
That fee is paid back by the ease of use and the additional power of faking with Typemock. Microsoft has made a step in the right direction but one that hasn't gone far enough yet. For further in formation, please visit the unit testing blog. Got any questions about unit testing services? You are more that welcome to visit our humble automated unit testing blog online.
Source...