Michael,
On 6/23/13 8:43 PM, Michael Azerhad wrote:
> Hello,
>
> TDD promotes design emergence.
> Thus, it is not advised to anticipate layers in advance (service layers,
> business layer, dao layer etc...).
I don't know that you can resist anticipating, but you can resist coding.
>
> At a given time during a TDD refactoring step, design may reveal the
> need of splitting our code in some main layers (in refactoring part of TDD).
> Assuming, we talk about Mockists guys, which enjoy isolating each
> components by placing needed mocks and verify behaviours thanks to them.
> What would the design of layers lead to? => to rewrite a huge part of
> unit tests, in order to place appropriate mocks and their expectations
> (messy no?).
Is this something you're worried about? Or something you've experienced?
In my own experience, the need to rewrite a number of unit tests tells
me I've not been listening to what they've been telling me.
> Indeed, the whole algorithms would now be splitted into
> several parts, most of them representing one distinct layer.
> Classist TDD would not really be impacted by this huge refactoring,
> since their writing style is by far most flexible (like mini-integration
> test) that a mocking style.
Why would a mocking style be different? What would invalidate your
previous tests?
>
> Question is: If I'm about to start a huge project, knowing at 99% that I
> will need some basic layers (service layer, business layer etc...),
> shouldn't I write them before starting TDD steps?
> Indeed, advantage would be that my first tests
> would already place necessary mocks about main layers.
You can do that. I wouldn't call it TDD, though.
- George
--
----------------------------------------------------------------------
* George Dinwiddie *
http://blog.gdinwiddie.com
Software Development
http://www.idiacomputing.com
Consultant and Coach
http://www.agilemaryland.org
----------------------------------------------------------------------