jeudi 2 avril 2020

What's the good TDD approach ? (What is the good level to start coding ?) [closed]

I am new with TDD approach and i am questionning about something and in particular about the way in which the collaborators (dependencies) of a SUT (system under test) should emerge as the refacto progresses.

When i read this blog article of Uncle Bob i deduce that he starts to write test at top level and as the refacto progresses, the collaborators emerges and so, the code at a lower lever it is revealed. I don't know if i'm wrong but this seems to me to be a top-down type of development approach.

So my question is the following : In a TDD context development, should i begin with test and write collaborator's code and after, test and write higher level code that uses this collaborators. Or begin at the top level and bring out collaborators as the refacto progresses.

I noticed that one of the main difficulties with TDD is to determine the good level to start coding.

I often heard "Your test should target yours use case" but for me it's not so obvious because a use case can be cut out in sub use cases so, what's the good level ?

Aucun commentaire:

Enregistrer un commentaire