dimanche 22 février 2015

first time trying tdd. which tests should I write?

I'm working on an application for access control on gyms. I want to make all this app testable, but it's my first time with TDD/BDD. I don't exactly know which tests should I create.


Maybe tests from user's perspective? Something like:



  • As a visitor, I want to enter gym.

  • As a visitor, I want to exit gym.

  • As a visitor, I want to enter two times (this should return exception).

  • ...

  • As administrator, I want to import list of visitors.

  • As administrator, I want to clear visitors list.

  • As administrator, I want to know who is on the gym.

  • ...


Or maybe tests from developer's perspective? Something like:



  • testVisitorEnterOnGymReturnTrue()

  • testVisitorExitGymReturnTrue()

  • testVisitorExitGymBeForeEnteredToGetException()

  • testVisitorEnterGymTwoTimesToGetException()

  • testAdministratorImportListOfVisitorsReturnTrue()

  • testAdministratorClearListOfVisitorsReturnTrue()

  • testAdministratorShowWhoIsOnTheGymNowReturnArray()


Which kind of tests should I create before start coding?


Aucun commentaire:

Enregistrer un commentaire