Hei,
as far as i remember it was once or twice when i did participate to
the coding sojo sessions (long time ago). Actually i didn't like the
apprroach how we did start the developing of application. We just
started from the smallest thik not thinking about whole application at
all.
Probably something was changed due the next sessions - hard to know.
But here is the think i learned and i think it's really good.
TDD is cool, but starting from smallest things distroys big picture. I
like to design big picture and from this approach start to implement
application. In this case i usually think about actors, objects etc.
So i create domain model (POJO way). This model don't need to be
tested if it has only setters and getters. I think you agree at this
point.
When i have some simple model then it's simple to start to write some
layers of application. Probably they are dao, service and some other.
But if we start from those interfaces it will be probably the best
way. Interfaces doesn't implement functionality, so we don't need to
test them at this point. Still we already have application that can be
implemented throw mock way.
This is the point when TDD starts. We have some interface we want to
implement. We create implementation class with all declared methods
and inside this methods we just put throw unsupportedoperationesception.
The next step is creation of test class with test mehtods for all
implementation class methods. When we first time run test class we
have red bar. After that we start to change red to green step by step
in TDD way.
What do you think? Or is that in use already by all of you and i'm
just lag behind?
Antoni