by allspiritseve » Thu May 15, 2008 11:14 pm
I am trying to get myself into a TDD mindset, (it's hard when I'm just programming on and off when I have free time-- not that often at my school) but I have a question about mocks. Or more specifically, what comes after mocking. I get the idea behind mocking a class-- its a good way to discover the interface for the next class you write. However, what happens next? Do you write the class that was mocked, and gradually replace the mock code with calls to the new class? If so, that seems like the first class would be too dependent on the second class, and kind of goes against TDD methodology. If not, what happens when you change the interface of the new class? Are you just supposed to keep mocks up to date as you go along? That sounds like a nightmare.