Tuesday, February 9, 2010

You are here: Home > Articles > Defining Done on Agile Projects

Defining Done on Agile Projects

by Robert Dempsey on January 29, 2009

Once a month I hold a Scrum Lunch and Learn, where I present on a topic dealing with Scrum, while group members enjoy some delicious Thai food. This month, I spoke about user stories. A user story is the format we use for requirements, and looks like this:

As [some type of user] I can [do something] in order to [achieve some benefit].

Here’s an example:

As a Site Visitor I can create an account in order to become a member of the site.

The benefits of user stories are that they emphasize verbal communication, are understood by both suits and geeks, defer decisions and details, and work with iterative development. By themselves though, they are vague, and purposefully so. There could be a lot or a little involved in a user signing up for the site. Most importantly, my definition of done for this story could be, and is most likely, very different from your definition of done. Recall the adage “you don’t know what you want until you see what you don’t want.” In software development, this is very true. So how can we help to ensure that what we produce for our clients is what they want?

Enter acceptance criteria, a.k.a. acceptance tests.

Acceptance criteria are where “done” is defined. And guess who writes those? The client. So how do they do it? Here’s an example. Let’s review our user story:

As a Site Visitor I can create an account in order to become a member of the site.

Our acceptance criteria might include:

  • A user should enter an email address and a password
  • Test that both the email address and password are entered (not blank)
  • Test that the email address is in a valid format
  • Test that the password is at least 6 characters

To me, that’s pretty clear. I know what I need to code, I know what tests I need to write, and the client knows what to expect when I push it to the testing server.

In short, acceptance criteria, written by the client as part of a user story, defines done.

Bookmark and Share
  • I don't think deployment or "test coverage" need to be part of the user story description. Testing should be done (or not) based on the development process you are using.

    We always implement deployment as a separate user story (I don't consider that updating builds to be part of deployment... its just something to do before you are done - or even before you can start).

    My experience is that user stories really need a clearly defined exit condition or they will hang around forever. A criteria like "the implementation must be tested" allows developers to leave the story open for months ("I might add a few more tests...") or to close it as soon as it "worked" one time.

    If you must use unit tests as an exit condition, I think it must be explicit in what has to be tested. A given level of test coverage is not useful here, we have to know what exactly what functionality must pass the test before we can exit. Test coverage can not guarantee that the story\s functionality has been implemented (only that the tests visit all the lines of code).
  • Hi Marek,

    During the sprint review, the product owner verifies that the user story is done per the acceptance criteria that he set up.

    Your second question is a good one. It is up to the product owner to define the acceptance criteria, which can include that there is a certain level of test coverage, and that it contains documentation. For us, those are standards that we have imposed on ourselves, rather than our clients asking for it. Deploying to a test server (which should be a standard part of the development workflow) is a standard for us. That's how our clients can verify that the stories are in fact done.

    Scrum is simply a process. To enable it, processes and other standard must also be put into place. Your second question hits on a number of them. Great stuff.
  • cool post but I have a few questions:
    - who should decide if acceptance criteria are met?
    - maybe meeting the acceptance criteria is not enough to finish story ... what about test coverage, deployment to test server, updating documentation ... in my opinion those are things which in many scenarios also should be done for each story.
    What don't you think?
  • shabbirshirazi
    who should decide if acceptance criteria are met?
    First it is testers and once you have happy the team can show case the user story to the business and get sign-off

    -maybe meeting the acceptance criteria is not enough to finish story....
    If acceptance criteria is not enough to finish the story, we should add it to our acceptance criteria. Some time it is not good to include every thing in acceptance criteria - and the development team will raise a technical task card associated to the user story.
  • Hi Marek,

    Testers do not define done, the customer (Product Owner - PO) does. The PO is also the one that determines if the acceptance criteria are met. Testers write the tests to ensure that the code and UI is meeting the acceptance criteria.

    Acceptance criteria defines done for a story. If you don't have acceptance criteria, then "done" will never be accomplished, and the team is left coding forever.

    As for test coverage, deployment to a test server, etc. - all of those items can be defined in the acceptance criteria.
blog comments powered by Disqus

Previous post:

Next post: