Labels

Thursday, August 4, 2011

Unit Test Best Practise

Test Driven Development (TDD) process is a robust way of designing software components (“units”) interactively so that their behaviour is specified through unit tests.

Goal Strongest technique
Finding bugs (things that don’t work as you want them to) Manual testing (sometimes also automated integration tests)
Detecting regressions (things that used to work but have unexpectedly stopped working) Automated integration tests (sometimes also manual testing, though time-consuming)
Designing software components robustly Unit testing (within the TDD process)

when you’re refactoring, i.e., restructuring a unit’s code but without meaning to change its behaviour. In this case, unit tests can often tell you if the unit’s behaviour has changed.

Unit Test in Visual Studio 2010
Walkthrough: Creating and Running Unit Tests
Walkthrough: Run Tests and View Code Coverage
Walkthrough: Using the Command-line Test Utility

Walkthrough: Create And Run Unit Tests As Part of a Team Build

MSTest Issues in 2008:
1. MSTest has limited support for parametrized tests and it is very cumbersome and constraining.
2. MSTest is stuck with the current release of VS and one has to wait till the next full release of VS to get any new features for unit testing whereas with NUnit and the like you can get new features and bugs fixes quickly.
3.limitations on how third party tools like TeamCity can work with MSTest

No comments:

Post a Comment