5

My team follows test driven development, and sometimes extreme programming.

If the latter, they would often complete a user story without testing, and then write the tests afterwards.

So, if I have a Trello card and the Trello card is:

"Write tests for the API"

That is not a user story i.e. "As a user, I want , so that...."

but never the less the story related to that is completed (the functionality), where this was not done at the time due to time constraints. Currently I just write a Trello card like that, and put it in the sprint which contains a lot of user stories. Is this the correct approach?

1
  • Why could it not be a user story? There are different kinds of users, and a tester is a user. "As a tester, I want to ensure that ... verifies properly with ..." or whatever. A developer could be a user - "As a developer, I want my tests to automatically run after a build" is a statement of functionality that's needed by the developer in order to support the project and may cost time to implement. It may fall under a different branch of the user story tree, but it could still be valid.
    – Steve
    Nov 30, 2015 at 20:22

2 Answers 2

12

Writing automated tests should still be part of each user story, as part of your definition of done for each user story. A user story should not be called complete without appropriate tests written for it--it doesn't matter which order you complete the work in.

Just to expand on this a little more/clarify: don't call things done until they're done. If "Done" means you have automated tests, the task isn't done.

6
  • 3
    "Done" means that the work package has passed automated tests. You can't pass an automated test that hasn't been written.
    – MCW
    Nov 30, 2015 at 19:15
  • 2
    Exactly. this is why a written definition of done is important. Write it down, agree to it, and keep it as a living document so that everyone knows what "Done" means.
    – JDRoger
    Nov 30, 2015 at 19:42
  • 1
    Acceptance Criteria - this identifies what "done" means.
    – Steve
    Nov 30, 2015 at 20:25
  • 1
    Ideally you would cover every feature, but if you can't then ask the Product Owner to prioritise where the testing is done. They know which features are most important and hence that is where the testing is most important. It's also worth noting that test automation can save time as it reduces the time spent fixing bugs. Dec 1, 2015 at 18:17
  • 1
    @bobo2000 I learnt the hard way that your automated acceptance testing should test exactly what your customer will test to sign off the project. The discussion is here: pm.stackexchange.com/q/16165/747 When the customer finds a bug during acceptance testing, how are you going to be sure that your bug fix did not break anything else. Are you really going to fix a bug in 10 minutes, then test the whole system for 3 hours?
    – jdog
    Dec 2, 2015 at 7:50
1

User Stories are a technique for the items in the Product Backlog. The individual tasks, such as testing, should be part of the Definition of Done. The task of testing supports the user story for the product backlog item that is to be done by the end of the Sprint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.