The Artima Developer Community
Sponsored Link

.NET Buzz Forum
I changed my mind - Mock objects are wrong for database unit testing

0 replies.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a flat view of this topic  Flat View
Previous Topic   Next Topic
Threaded View: This topic has 0 replies on 1 page
Roy Osherove

Posts: 1807
Nickname: royo
Registered: Sep, 2003

Roy Osherove is a .Net consultant based in Israel
I changed my mind - Mock objects are wrong for database unit testing Posted: Dec 10, 2004 9:49 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Roy Osherove.
Original Post: I changed my mind - Mock objects are wrong for database unit testing
Feed Title: ISerializable
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/rosherove/Rss.aspx
Feed Description: Roy Osherove's persistent thoughts
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Roy Osherove
Latest Posts From ISerializable

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!"..

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


Topic: SMS Agent Host Chewing on your Resources? Previous Topic   Next Topic Topic: Self Publishing - Thinking About Writing a Book?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use