mercredi 16 mai 2018

TDD the implementation details or behavior only?

When i was developing a console app the algorithm was the following steps:

  1. first create a temporary directory
  2. then call another command that will create an xml file inside the the temporary directory
  3. then read that xml file and extract a name from it
  4. lastly rename this temp directory to the name extracted from xml

then i use TDD from outside in and start writing Acceptance test. but i'm still confused what to test.

  1. Do i need to test each step of the above i.e to test if a temp file is created or not then to test what happens if IO Exception occurs, then to test if running the other command produce an xml then test if xml contain an attribute "name" etc.
  2. Or to test if after running the console app a folder is created with an xml only?
  3. how to organize my test suite if i'm going to test my algorithm step by step

Aucun commentaire:

Enregistrer un commentaire