in reply to Test Driven Development example + design question

I've not found that the approach matters as much as:

In general I prefer the bottom-up approach as it requires less scaffolding to build a comprehensive test suite, but neither approach is sufficiently better over the other as to matter, in my experience.

  • Comment on Re: Test Driven Development example + design question

Replies are listed 'Best First'.
Re^2: Test Driven Development example + design question
by mascip (Pilgrim) on Jul 01, 2012 at 23:37 UTC

    I like this answer, thank you !

    Theory is good, interesting, important. But now i need to practice and assimilate.
    I will try this way of "delegating responsibilities", through an attribute that consumes the Role. I might take this little project as an experiment, finish it with one design, and then try to rebuild it with another design. Nice Lego game =o)

    Finally i think i understood what bottom-up or top-down means. "Bottom up" is building little subroutines (or classes) that we might use, and then build more complex subroutines (or classes) from them. "Top down" is writing the final script (or the most complex subroutine/class) first, and from there we know which "smaller elements" to build, to make it work.
    I'm ashamed it took me so long to understand :D