This is another live coding note. I’ve found my rhythm with TDD and currently bashing away at some unit tests for the Models and Service layers for a project I’m working on.
In tonights post, I’m going to write about how I get around with Unit Testing live databases.
Unit Testing with Live Databases
For my unit tests, I’m currently working with a live test database since I don’t fully understand the “power” of mock objects. If you have any links out there that’s worth noting, please be a friend and “link me”. I’m not going to pretend that I know everything and anything about Web Development. I know a lot, but the one thing that I do know is that I don’t know everything.
Mock Objects. WTF are you?
One thing which is mostly a mystery to me is the concept and practical application of Mock Objects in Unit testing. I’ve read several articles on Mock objects, but some of them delve into how to create Mock Objects rather than practical usage for mock objects in a live development setting. What problem exactly are mock objects trying to solve?
I get that it replaces other objects that the current class your testing will collaborate with, but I’m guessing that this is due to not having a setup like I currently have where I have the extra application code which easily gives me access to the db resource so that I can just as easily do this within my unit test as it would with mock objects… maybe? I’m confused.
» Read more: Unit testing with Live Databases and/or How do I use Mock Objects?
This is a preview of
Unit testing with Live Databases and/or How do I use Mock Objects?
.
Read the full post (563 words, estimated 2:15 mins reading time)