I'd like to clarify the relationship between two important concepts: a team's Definition of Done and the Conditions of Satisfaction for a user story. Let's start by reviewing each of these concepts.
A team's definition of done is an agreed-upon set of things that must be true before any product backlog item is considered complete. A good starting point might be:
- the code is well-written. That is, the team does not feel they need to immediately refactor or rewrite it.
- the code is checked in.
- the code comes with automated tests at all appropriate levels.
- the code has been either pair programmed or has been code inspected.
- the feature the code implements has been documented as needed in any end-user documentation.
In contrast, conditions of satisfaction are specific to a given product backlog item and define what must be true for that product backlog item to be considered done. For example, a user story such as, “As a user, I am required to login before using the site,” might include these conditions of satisfaction:
- user is logged in only when proper credentials are provided
- a “remember me” option is available
- user can request a password reminder
- user is locked out after three failed attempts
Think of the definition of done as a special set of conditions of satisfaction that are added to every user story (product backlog item). For the user story above to be done, not only must all of the conditions of satisfaction be fulfilled but so must the items that make up the definition of done.
Because I like to write user stories on the front sides of index cards and the conditions of satisfaction on the back sides, I tend to think of the definition of done as a something I have written on a custom-made rubber stamp. I could then stamp each user story card with those items in addition to story-specific conditions of satisfaction.