I am newbie to testing and I came across TDD and BDD approaches. But I am confused of it. I don't know when is better choice to use TDD instead BDD and vice versa. I came across some articles but they are more about differences...
I have some tips but not sure about their validity.
1) If I imagine that I would like to implement well known java.lang.List then what approach to use? In this case it seems to me that TDD is better choice... Because it is some part of API/library and only programmer can use it, not a user. Although I can imagine that I could use BDD too, as:
Story: Programmer adds an element to the list
Narrative could be something like: As a programmer I want to add an element to the list [so that ...]
Scenario 1: Adding null to the list + given, when, then
Scenario 2: Adding valid element to the list + given, when, then
Scenario 3: ...
2) But if I imagine that I would like to implement some GUI then it seems to me that BDD is better choice... Because it is something what a user can control (click on the button, fill the fields, etc...). TDD in this case does not seem to me as a good choice...
Next, can I mix them together? I read that BDD includes TDD in fact but in this case I mean wheter it is OK to use BOTH approaches in the project (e.g.: TDD for API and BDD for GUI) or I should choose only one approach.
Also, I really appreciate if you post here some links what helped to you to understand better testing in general...
You could post some guide/clues what you use for making decision...
Aucun commentaire:
Enregistrer un commentaire