Implementing a specific requirement during software development carries some risk. Of course, programming is not a job that is particularly dangerous to your health, and implementing the items of a requirements specification is no exception. The risk is more about not fully understanding the idea behind a given requirement. Even with a detailed description from the analyst, there is always a chance that a piece of code will be implemented in a way the client will not accept. The reasons vary, and they can come from different parties. But there is one more aspect.
A developer does not always know when to stop and consider the work done. They can overshoot in both directions: implement the requirement only superficially and miss certain nuances, or spend a lot of time needlessly building something that will change anyway or is not important from the project's point of view. In most cases this is not their fault. What was missing was communication, but we know very well that there is not always time, or even the idea, to ask about every detail while the sprint is running. In that case the situation needs to be safeguarded earlier, at the stage of creating the requirements. Acceptance tests can help here, for example, but today we will look at a different concept: the so-called Definition of Done, or DoD for short.
What is Definition of Done?
It is a list of criteria attached to a task that must be met before the task can be considered finished. Literally a "definition of the end" or "definition of completion", and when it is well written it becomes an unambiguous indicator of whether a given part still needs work. Importantly, it usually does not require extra meetings and consultations. The smaller the task, the fewer DoDs it has (greetings to Doda and the Polish pop scene), so checking them is shorter and quicker. This obviously favors defining requirements as user stories, but the technique is just as applicable to the descriptive format or to use cases.
In practice it is indeed common for the developer who gets a task not to have attended the meetings with the client or to have taken an active part in writing the specification. That means some details and general expectations may be unknown to them, because not every detail can be conveyed in internal meetings or in documentation, if only because it was judged unimportant (the effect of knowledge that is so obvious to someone that they do not pass it on). In that case it very often happens that the developer runs into the following problems:
- asks a great many questions about the requirement, which is commendable (it shows they care about doing the task well) but takes time and wears on the nerves,
- wanders during implementation without a clear plan of what they are aiming for (people who see the results of their work and know the goal are more productive),
- hands in an incomplete requirement, which needs corrections later, and that again takes precious time.
Writing a Definition of Done then makes a lot of sense. It does take time from the person assigning the task (the project manager or lead developer), but this will probably be compensated by more effective work from the developer, higher motivation, and better software quality. The implementer will know exactly what is expected of them, and it becomes easier to say what percentage of the part of the system they are building is done. Everything becomes clearer for every participant in the project. What is more, a Definition of Done can also help in implementing specific tests (for example, unit tests) that automate checking whether the developer has met individual items. And as if that were not enough, some DoD items can apply to many parts of the system and be reused that way, which saves resources.
What does an example DoD look like?
Consider the following user story:
As a user, I can see the details of a given company: its name, description, logo, and contact persons.
Of course, this story is probably backed by a proper translation, a design from the graphic designer, and so on. In addition, though, we can attach the following definition of done to it:
- The user sees the name, description, logo, and contact persons on the screen (counterintuitively, it is sometimes worth repeating what is in the main description).
- If the company has no logo, a substitute image (a so-called placeholder) is displayed.
- If the description exceeds 1000 characters, it is cut to 1000 characters, three dots are added, and a link to expand and collapse the description.
- If the description or the contact persons are missing, "None" is displayed.
- Each contact person is a link to that person's profile.
You could argue about whether some of these items should be part of the requirement itself or visible in the mockups. Indeed, the user story then takes on a more descriptive form, which seems more natural. That is why we use this form at Wilda Software, though in general conventions differ here. Stories have the advantage of being short and quick to communicate, and they can also be written on sticky notes, which is one of the characteristic "games" associated with agile methodologies.
Let's now look at the user registration and activation feature in Feedybacky, where the requirement description was much broader and the developer had at least a rudimentary mockup showing what the layout of the view should be. The DoDs were as follows:
- An error when no information, or incomplete information, is provided.
- An error when the passwords do not match.
- An error when the email address has an invalid format.
- An error for a license key that does not exist.
- An error for a license key with zero remaining uses.
- An error when the mandatory consents, or some of them, are not checked.
- An error when the CAPTCHA is not passed.
- A successful registration sends an email with an activation link, but the user cannot log in right away.
- Adding a nonexistent token does not remove the need to enter a license code.
- Adding an invalid token does not remove the need to enter a license code.
- Adding an expired token does not remove the need to enter a license code.
- Adding a valid token allows registering without entering a license code.
- Account activation: a failed attempt to open the page without a token.
- Account activation: a failed attempt to open the page with a nonexistent token.
- Account activation: a failed attempt to open the page with an expired token.
- Account activation: a successful activation shows a screen redirecting to the login screen and allows logging in correctly.
- The first login after account activation leads to the account settings screen and an appropriate message is displayed.
- Registering with a token that had a company assigned to it automatically assigns the user to that company.
As you can see, this is a more developed form that focuses on the functional behavior of the system in specific situations. In practice it indeed worked like this: a tester checked the system against these items and reported any irregularities, but a developer armed with such a list had a better chance of finishing the task the way its author intended even before the first tests. You can also notice that the style of the description is not necessarily important. What matters is whether each item is clear to the people involved.
What are the drawbacks of this approach?
We have already mentioned the advantages, but to be honest, writing out DoDs has one problem that people who enjoy writing various kinds of tests also know. That problem is time, which you have to spend trying to anticipate all the variants of a given requirement. As I mentioned, this may pay off in the long run anyway, but first, it has to be included in the budget (and the reasons explained to the client), and second, it also depends on how these DoDs are treated and verified later. It is also hard to predict everything, even when you spend hours on it. That is why the Solomonic solution here is to write a basic definition of done and then add to it as the project goes on. Then we can postpone the problem (and perhaps an extensive set of items will not even be needed, because the work will go smoothly), but it will mean having to return to requirements that are theoretically already closed.
The second drawback is familiar to people who like automated acceptance testing (and not only that), and it concerns changing conditions. We know well that expectations for software can change as the project develops, and with them the behavior of the system, which in turn means updating the DoDs. Unfortunately, there is little we can do about this. Perhaps it is one more argument for a concise approach to the definition of done, to try to save time, or for adopting a more advanced, technical, even semi-automated convention.
Summary
Still, it is clear that defining the items that mark the completion of a task has far more advantages than drawbacks, and that makes the concept worth using. It makes analysis and communication easier, reduces the number of mistakes made during implementation, and also curbs developers' laziness. So if we have problems in these areas, or are simply looking for a way to safeguard our software development process, it is worth looking into the Definition of Done and adapting it to the conditions of your team.
Best regards and thank you, Jakub Rojek.


