This checklist was created by developers, for developers, to be used by technical teams that are conducting an isolation framework evaluation of different solutions in the market for use in their commercial software project(s).
Q: How easy is it for your team to get started with the framework?
It may be worthwhile to time a new developer within your team with the framework to get an accurate idea of how long it takes to get started. For example – how long will it take them to write the first three tests for some class in your system? Is the API clear and simple? Does the API have a single point of entry? Is there clear guidance on what to do at each step of the way? How often, if at all, do you need to check the docs and tutorials? How easy is it to look for the next step when you’re not sure what to do? Some tools offer guidance within the IDE, while some provide extensive help. Some don’t do either.
Q: How resistant to change do you need your tests to be?
Different frameworks provide varying levels of change resistance (when production code changes). Change resistance can be measured according to the number of tests needed to modify for a single piece (method) of changed production code. Does the tool support these production changes without affecting the tests?
Do the frameworks support recursive fakes? Is it non-strict by default or does it throw exceptions on unexpected interactions by default? How does it handle method overloads (if your production code changes to call a different overload?). How are arguments verified? Are all arguments ignored? Are actual values used for expectations?
All these things affect the fragility of your test. The more fragile it is, the less change resistant it is. If your production code changes a lot you will need to take this into account.
Q: How effective will the tool be for your specific project?
Your project may be a greenfield project (fresh new code) or have a lot of legacy code. Not all isolation frameworks were designed, or have the same support, for all (or any) legacy code scenarios.
If your unit tests need to be written against legacy code (existing code without tests):
Check whether your production code contains static constructors, internal or private classes that might need to be faked. Does the framework support faking them? Does your code instantiate objects directly all over the place, or does it use a dependency injection framework or factory of some kind that would need to be faked? When conducting an isolation framework evaluation, make sure the framework you choose supports these scenarios, or that you have the time needed to refactor your code for testing such cases.
Q: How do your tests look when you use the framework?
Test code is still code. It needs to be readable, and when you jump into it to debug, you need to be able to see at a glance what you’re testing.
Are your tests messy? Does the framework cause your tests to be longer than a page? Are you able to understand the expected behavior of the code under test if the framework is involved? Can your team members understand, without a great deal of explanation, what you are using the framework for in each test? Are you still able to write test code according to accepted industry best practices such as AAA (arrange-act-assert) when using this framework? Not all frameworks support the easier-to-understand AAA tests, for example.
Q: How well is the framework integrated with your coding environment and ecosystem?
Can you use the framework from your various test runners (TestDriven.NET, Resharper, MS Test etc.) or in combination with profiling and code coverage tools?
Some frameworks incorporate profiling, and it is important to see that they work effectively with other profilers and runners. Can you run your tests with code coverage? Or with other profiling technologies?
How well does the framework integrate into various versions of Visual Studio? Do you need it to support VS 2005? VS 2008? What .NET versions should it support? Some of the frameworks require .NET 3.5 and up.
Q: Do you need the ability to verify interactions between objects in your tests?
Some frameworks may not have the built in ability to verify interactions, requiring you to provide your own manual flagging mechanisms (hand rolled mocks). For complicated interfaces this can grow cumbersome and result in an un-maintainable piece of code.
Can you verify method calls between the code under test and its 3rd party dependencies? For example, that a SharePoint method gets called at the end of a test.
Q: What kind of technical support do you require?
How fast do you need to get a response to a question if you are not sure how to accomplish a specific task with the tool?
How many people are on staff at the vendor who makes the framework? And at what hours of the day?
Is support provided by a company or an independent individual? A company is often more invested in supporting you than an individual – or they stand to lose money.
What is the company’s main expertise? Are unit testing and agility at its core business? If so, the support team is more likely to well versed be on these subjects.
Q: What is your total cost of ownership for the tool?
No isolation framework evaluation is complete without a cost analysis. The total cost should consider price, time and effort required to work and implement the tool in your project or organization. Compare the following:
a. Price of tool
b. Time to get started and reach RTM test (readable, trustworthy, maintainable)
c. Time to write tests
d. Time to fix test because of production change (change resistance)
Obviously, before you start a process for isolation framework evaluation, you should take a good look internally to truly understand what your needs are. Moreover, it is important to note that the implementation of unit testing should be part of a wider cultural change, in order to address the external implications that such a changes in development practices may have (on team structure, project deliveries, etc.). If this is your company’s first attempt at implementing Unit Testing, and especially if Unit Testing is part of a grander change, we recommend that you consult with someone who has experienced and led such changes before.
In any case, use this checklist wisely to find the solution that fits best for you and feel free to let us know if you have any insights or feedback.