Styles Of TDD for your Domain Model
Having read a lot of mockobjects.com I'm beginning to understand need-driven development and the effect on design. This has made me want to re-read some old articles:
- Styles of TDD: Left, Right, and Center - David Laribee builds on Martin Fowlers Mocks Aren't Stubs article. Reading it I guess I'm "Middle of the Road" when it comes to state v mocking. When thinking about our POCO domain I use the classical approach for entities and value objects, but as he says when you get into use services you can use mocking.
- TDD Design Starter Kit - State vs. Interaction Testing - Jeremy Miller covers some of the same ground. The example where everyone would stub or mock but the bit at the end, which is in response to Martin Fowler, is interesting.
- A sign you're mocking too much - J. B. Rainsberger's covers why he never mocks value objects, rarely entities but feels its fine for services.
- Mocks Aren't Stubs - Great article.
These are all good posts but I'm coming to the conclusion that there just isn't that much real content out there about how to use interaction testing as a design and testing activity for domain entities/value objects. Seems like a lot of people don't do it and so far the ones that do haven't written that much about it.
The content I have found has semed to be producing designs that I wouldn't be that interested in and although the idea of extracting role interfaces from high level domain entities interests me I can't find any real evidence that people are doing it meaningfully. I'm also not sure that doing it is going to improve the design that much.
Anyway I think for now I'm better focussing my design efforts on traditional DDD activities, whilst keeping an eye on what the BDD/mockobjects.com guys produce.
No comments:
Post a Comment