Introduction
Dear reader, if you found this article, you are probably looking for information on how to write requirements specifications for software. Whether you have experience writing such documents or are completely "green", this publication, together with the template, aims to present my concept of building a specification. It is absolutely not the only right way to write this kind of description. I do not claim it is the best or the optimal one either. It is not even 100% original, because it draws heavily on various experiences from software engineering.
Still, it is a coherent approach, already tested with several dozen clients and refined over the past years, sometimes expanded and sometimes shortened.
So from this text you will learn:
- what approach to writing specifications I propose,
- which sections of a specification are important in my opinion,
- how to fill in each section and how to word it,
- finally, what a template of such a specification looks like, which you can download and use!
To make it easier to remember what belongs in a specification, I suggest remembering it as the HANSA method, that is:
H - History
A - Actors and objects
N - Nutshell diagram
S - Specification of functions
A - Aspects of quality
And if you are here only for the specification (with examples) and do not want to read the "philosophizing", the document is attached below the text!
Requirements specification and the HANSA method (approach)
The purpose of a specification is, of course, to describe how a piece of software ordered by a client (or rather, one who wants to order it) should work. In theory it should be a nicely written, coherent document that explains the operation of the system from A to Z, which programmers and designers will then build and administrators will configure accordingly.
Well, in theory. But is that possible in practice?
Here I like to answer the way I answer most questions about software engineering in the broad sense and project management methods: it depends!
When preparing a specification, we have to consider the following questions:
- Does the client know well what they actually expect (or are their requirements only now taking shape)?
- Is the client ready to spend time on requirements analysis and pay for it (yes, creating a specification takes time and costs money)?
- Do I expect a lot of changes in the project (changes happen in EVERY project while it is being carried out, but there can be more or fewer of them)?
- Is the client someone who handles documentation meticulously, and are we sure they will have the patience to read it?
- Finally, do we have the time to create precise documentation and can we afford to delay the start of development (and how far are we willing to risk speeding up the work, along with the misunderstandings that come with it)?
The more YES answers to the questions above, the more detailed the documentation we can afford to prepare. The more NO or "I don't know" answers, and the more appealing the phrases in the parentheses seem to us, the lighter, faster and less complicated documentation we want to create.
In practice, making a lighter specification comes down to two things:
- removing all sections that are not essential and
- choosing the simplest ways of describing the client's requirements.
Since I work under enormous time pressure myself, I do not think that writing shorter and simpler specifications is "worse". In fact, writing a short yet relatively precise specification is an art that I value highly. There is even a chance that the client will read such a specification from cover to cover and understand it, and that is what we are really after.
All right, all right. So what should a good specification contain?
One by one:
1. History
An introduction that explains to someone who did not take part in the discussions and has no prior knowledge of the system what it is really about and what basic concept stands behind the creation of the software. The introduction must be short, easy to digest and allow the reader to understand the scope of work without any prior knowledge.
(optional) Besides the description of the system itself, depending on the needs, I often add two sections here: target audience and expected business benefits.
The first section, on the audience, simply characterizes the types of users and stakeholders in the system in brief. They are often outlined clearly enough in the other parts of the specification that there is no need to list them separately, but if the group is quite diverse, it is worth indicating what different people may expect from the system.
The second section, on business benefits, is meant to present, very briefly and in general terms, what expectations our client has about the target benefits. For example, whether they expect the system to help them sell more of the goods they produce (no, dear reader, I do not mean methamphetamine), whether it should make some process more efficient in their company, or perhaps improve brand perception. Of course, even the most technically well-prepared system cannot guarantee that the business goals of the project will be achieved, since they depend on many external factors. Still, presenting them in the requirements specification helps to better understand the purpose of building the system and which aspects should be emphasized and prioritized during its creation. This section should not be binding, though. It simply informs about the hopes the client has for the system.
(optional) Business process: a description of how the system will typically be used by users to gain a business benefit and how a typical interaction process in the system will run. This item is not meant to present detailed requirements, only to show the whole process "from a bird's-eye view".
This section can be presented as a plain, concise cause-and-effect description or as a use case at the business level (both versions are shown as examples in the template).
2. Actors and objects
This section, or rather two sections, is meant to show who will operate in the system and on what.
First, it is good to present the actors, that is, simply the users or other systems that will be active participants in the actions. Users will be, for example, customers of an online shop, the administrator of the whole system or a salesperson who runs the shop. On the other hand, an actor can also be, for example, a payment system that confirms a transfer and sends our system information about the time and amount of the completed payment. Identifying actors is very important for the system functions described later. To avoid misunderstandings, it is very important to give them consistent, easy-to-remember names and to stick to them throughout the specification (for example, not to write "client" once, "user" another time and "buyer" a third time when meaning the same actor). This is a rule I recommend following throughout the whole specification. It is not a school essay, so using the same terms over and over makes perfect sense here.
Next, it is worth presenting the business objects (or information objects), that is, sets of data that matter for the operations in the system. These can be, for example, products in an online shop, orders, company contact details and so on. Objects serve actors to achieve their goals and represent the data stored in the system. Of course, there is no point in listing and describing all types of information the system may store (this is not a database schema!), only the elements that matter for the functional requirements.
As usual, examples of actors and business objects can be found in the specification template.
3. Nutshell diagram
Or, to put it more formally, the context diagram. It is simply a very concise graphical representation of our system, the actors, some of the business objects, the relationships between them and the most important activities performed in the system. The diagram must be simple and absolutely fit on one screen. In some situations this one "picture" will be the only element that the recipient of our specification reads carefully, so it should be legible and illustrate well how the system works. The saying "a picture is worth a thousand words" is very fitting here.
The diagram serves a similar function to the "History" from the first point: it is meant to ensure that every person looking through the specification understands what it is about and roughly how the whole system should work.
An example, of course, is in the specification template.
4. Specification of functions
This is essentially the core of our document. In this section we describe all the functions of the system that the client needs and that the development team will have to build. A detailed description of how to represent functional requirements could fill a separate article, or even a whole series of articles. Still, let us try to briefly cover how we can describe them.
To start, we can present an optional section, namely:
(optional) Modules: a list of the modules that exist in the system, with an explanation of their role. This section is not necessary and may be more useful for understanding the assumptions of the system architecture than the requirements themselves. I usually skip this section, unless it is a very important element that helps to understand the logical division of how the system works, which may be the case for particularly complex systems.
Returning to functional requirements, we can represent them in many more or less formal ways. Whichever form of representation we choose, it is good practice to give them identifiers (for example FR1, FR2 and so on) and readable names that make it easy to understand what a given requirement is about. You can (although this is a rule I do not follow strictly) list the actor or actors who will take part in the requirement right after its name.
We should always stick to the principle that one requirement concerns achieving one goal of a given actor. In other words, a requirement should be concise and specific, focusing on a single action in the system.
I usually use one of 3 forms of representing functional requirements:
Descriptive form
That is, a plain, prosaic presentation of the requirement as a description of a few sentences. No particular structure, just a description of the functionality from the perspective of the system ("The system should...") or the user ("The customer can...") in one or several sentences. Depending on how complicated the requirement is, it can be a very short description or a somewhat more detailed presentation that covers special situations.
Advantages:
- the length adapts to the "difficulty" of the requirement
- no additional skills are needed to write them
- they allow describing less standard solutions
Disadvantages:
- the lack of structure can make them unclear or hard to understand
- a lot depends on the self-discipline of the analyst writing them down
- they can be tedious for the reader
User stories
This is one of the more popular ways of presenting requirements in recent years, in the form of one-sentence user "stories" ("As a user, I would like..."). Because they always take one sentence, they are written down very quickly, but they naturally will not contain all the necessary details. Depending on the adopted convention, they can additionally be extended with "acceptance criteria", that is, tests we should run to confirm that the requirement has been met (also in a very concise form, for example "credit card payment test").
Advantages:
- short and easy to write
- easy to read
- they have a fixed structure
Disadvantages:
- they do not contain details
- some specific requirements can be hard to present in this form
Use cases
This is the most elaborate and best structured form of requirements, presenting them as a list of steps performed by the actor, together with the system's responses. A well-written use case is precise, contains a list of extensions that describe exceptional situations and... takes quite a long time to write.
Advantages:
- precise and detailed
- understandable even for someone seeing them for the first time
- they have a fixed structure
Disadvantages:
- time-consuming
- they require knowing the rules for writing them and some practice in applying them, so that they stay precise and readable
- they can be tedious for the reader
- did I already mention that writing them is time-consuming?
So which form should you choose? That is, of course, a matter of individual preference. If you do not have much experience with this, I suggest starting with the first or the second. The third is good for particularly "serious" systems, where we have time to create detailed requirements and settle accounts with the client very carefully against them.
Examples of all three forms, as usual, are in the template.
Regardless of the adopted convention and form, remember that functional requirements should describe only what the system is supposed to do, and not HOW it is supposed to do it. We get to that last question in point 5.
5. Aspects of quality
This is the last section I include in a specification, and it concerns so-called non-functional requirements (some people also call them "nonfunctional", but I definitely prefer the first spelling). It covers everything that is not a function of the system but matters to the client, such as speed, security, interface usability and so on. Of course, this section can and even should be quite extensive. What is more, identifying non-functional requirements with the client is often much harder than identifying functional ones, because it is usually our role (as analysts) to make the client aware of what they really need in terms of quality.
Failing to identify these matters is the most common cause of problems at acceptance, because the client "thought it would run faster..." or "thought it would have lower server requirements...".
Fortunately, standards help in identifying the requirements a client may need, as they offer ready-made lists of characteristics that are worth discussing and asking about during requirements analysis.
I try to use the ISO 25010 standard, which lists 8 areas of non-functional requirements and, within each area, specific sub-characteristics. This is again a topic for a separate article, but there is no shortage of publicly available material on ISO 25010, and you can easily rely on it in conversations with the client to steer both of you toward the important quality requirements.
Importantly, you should not write down all the quality requirements, including completely irrelevant ones, just to fill in the ISO "checklist". We write down only the requirements that matter.
When writing down non-functional requirements, I try to follow the SMART principle, the same one used when setting goals in a project, that is:
- S (Specific/Simple) - specific, meaning that one non-functional requirement should concern only one aspect of the software. It should also be worded as simply and unambiguously as possible;
- M (Measurable) - measurable, meaning that we can unambiguously verify whether it has been met or not. An example of a non-measurable requirement is: "the product list should load quickly". An example of the same requirement worded in a measurable way is: "the product list should load in no more than 2 seconds on average, under the following assumptions...". Measurability is, in my opinion, the most important feature of a well-defined non-functional requirement. A lack of measurability in non-functional requirements leads to discussions and conflicts with the client at acceptance, often ending in a situation of "my word against yours";
- A (Achievable) - achievable, meaning that we can realistically deliver it in our system, given the constraints of the project. Among other things, we should check whether we have the hardware and technology to prepare solutions in the form the client imagines;
- R (Relevant) - relevant, meaning not defined just "to have them", but ones that really matter for the final quality of the system. So there is no point in defining special speed requirements for an application that will operate on static data among a small group of users. However, requirements concerning appearance can be very important if the project we are building is a computer game;
- T (Timed) - time-bound, although this feature usually does not have to be declared explicitly, because the time for meeting non-functional requirements is normally equal to the project deadline. Still, there are situations (especially if we deliver the system in stages) in which we want to meet particular requirements earlier or later, and then it is worth adding such a note to the requirement. Since the whole specification documents the features of the application and not the schedule of its delivery, the time frame of a non-functional requirement should also be defined not in dates but relative (earlier/later) to other requirements. In the vast majority of non-functional requirements, however, I do not state the time of delivery explicitly.
And that is all the sections I use in the HANSA approach.
Final remarks and summary
Although the description of this approach turned out longer than I expected, it is really only a very superficial presentation of the topic of specifications. Still, that was exactly the goal: to present an approach that can be applied right away and used as a starting point for working with a client. Years ago I looked for a similar "guide" with a documentation template myself, so I hope this one helps reduce the number of potential areas of conflict with clients.
To sum up, the most important points about such documentation are:
- the specification is for the client and the IT team,
- the time spent creating it should match the client's involvement in preparing it (including financial involvement),
- the documentation must above all be understandable and readable, so the KISS (Keep It Simple, Stupid!) principle applies,
- the introduction and the context diagram are important, and should be understood even by someone who has heard about the project for the first time,
- we adapt the documentation to the needs of the project, and never try to keep the adopted template at all costs, because practice matters more than convention!
- because requirements and the client's awareness evolve, the documentation will change over time, both before the project starts and during its delivery,
- to keep things simple, you can use the HANSA approach (History, Actors and objects, Nutshell diagram, Specification of functions, Aspects of quality).
Piotr "Hans" Miklosik
Thanks to:
- Jakub Rojek, who is a co-author of the specification template and helped edit the text,
- Tomasz Boczarski, for preparing the illustrations,
- Joanna Twardowska, for proofreading the text.


