test driven development
i have long wanted to do test-driven development and currently i've been reading a number of articles about it (before implementing it of course). i've just read the
Test-Driven Development in .NET article of Peter Provost in CodeProject and what struck me was the use of mock objects.
One of the biggest challenges you will face when writing units tests is to make sure that each test is only testing one thing. It is very common to have a situation where the method you are testing uses other objects to do its work. If you write a test for this method you end up testing not only the code in that method, but also code in the other classes. This is a problem. Instead we use mock objects to ensure that we are only testing the code we intend to test. A mock object emulates a real class and helps test expectations about how that class is used
The concept of mock objects appealed to me since it was a brilliant idea to just interact with the interface of the real objects just to reduce dependency conflicts.