posts - 4238, comments - 3946, trackbacks - 370

My Links

News



Subscribe Subscribe

image image image





This is my personal weblog. These postings are provided 'AS IS' with no warranties, and confer no rights. The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer.

Licenza Creative Commons

Tag Cloud

Archives

Post Categories

I changed my mind - Mock objects are wrong for database unit testing

Un post interessante a proposito dell'uso dei Mock objects per lo Unit testing dell'accesso ai dati...
More than a year ago I wrote about the problems in database testing. I also stated that I feel it's totally wrong to run your unit tests against a live test database, but instead you should be using mock objects to save you from all the trouble.
Boy have things changed since then. I take back what I said. For a long time now I've been doing DB testing without mock objects, because I believe that's currently the best way to make sure you test data access logic and integration with the database procedures and views.
There are now several easy to implement solutions to the "how-the-hell-do-I-roll-back-the-changes-i've-made-to-the-db" problem(see this article , mbUnit , xtUnit and this one about extending the new Nunit as well for several options for doing the same thing).
With those - there's no reason for you not to do it.
Funny how things change overtime. Like any other thing, but usually more, software development is one of those things that looking back 6 months from now I'll always say to myself "Gosh! if I knew then what I now!"..

Source: I changed my mind - Mock objects are wrong for database unit testing

 

Print | posted on venerdì 10 dicembre 2004 11:41 |

Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET