RE: Mock Shmocks!
After I finished reading Open Source Programming and all the of the feedback from my Mock Shmocks post, I've realized that I need to learn more about Mocks. I need to learn how to streamline my TDD process. It's just taking too long right now. So where do I go from here? AppFuse currently contains, from what I can tell, only integration tests. All the tests depend on the database or the container to run. It works great, and all of AppFuse's tests complete under 3 minutes, but obviously this time increases as the project grows. So should I remove some integration tests and replace them with unit (mock) tests? If so, which ones? Should UserDAOTest talk to the database, but LookupDAOTest only use a Mock? How do you decide which tests should be real (integration) and which tests don't need to be (mocks)?
If the answer is "create a unit tests to sit next to each one of your integration tests" - then that seems like a waste of time. Am I supposed to have 2 *Test.java classes for each real class? I need a book that'll explain all of this and make me the TDD guru I long to be.
Even if I figured out all the answers to the above questions - which package should I use? There's a whole slew of them: Mockrunner, MockObjects, EasyMock and jMock. How do you decide? It's easy when testing Java classes - you use JUnit. When you want to test servlets, you use Cactus. Why all the choices for Mock testing?
Posted by Keith Sader on January 29, 2004 at 04:07 PM MST #
Posted by Keith Sader on January 29, 2004 at 04:08 PM MST #
Ara.
Posted by Ara on January 29, 2004 at 05:35 PM MST #
Posted by Simon Brown on January 29, 2004 at 11:25 PM MST #
Posted by Matt Raible on January 29, 2004 at 11:44 PM MST #
Posted by Matt Raible on January 29, 2004 at 11:50 PM MST #