When requirements are gathered, they must be recorded in a form that all parties can read, check and use. This is done in the software requirements document.
The Software Requirements Document
The software requirements document, also called the Software Requirements Specification (SRS), is the official statement of what the system developers must implement. It includes both the user and the system requirements. It is used by customers to check that it states what they want, by managers to plan the project, by developers to build the system, by testers to design tests, and by maintainers to understand the system later. The IEEE standard 830 gives a common structure for it.
Definition: Software Requirements Specification. A document that states, completely and clearly, what a software system must do, in a form that customers and developers can both understand and verify.
Contents of an SRS
A typical SRS has a preface and an introduction that state the purpose and scope. It has a glossary, the user requirements, the system architecture overview, the detailed system requirements, system models, evolution of the system, and appendices and an index. A good SRS is correct, unambiguous, complete, consistent, verifiable, modifiable and traceable, which means that each requirement has a unique identity that can be followed through design and testing.
Ways of Writing Requirements
Natural language is the commonest way, since everyone understands it, but it can be vague. To reduce this, requirements are written with a standard form and the word "shall" for a mandatory requirement and "should" for a desirable one. Structured natural language uses templates with fields for the function, inputs, outputs and conditions. Graphical notations such as use case diagrams and data flow diagrams show the requirements visually. Mathematical specifications, such as formal methods, give precise statements and are used mainly for safety critical systems.
Requirements can also be recorded as use cases, which describe the interaction between an actor and the system step by step, and as user stories in agile projects, which have the form: as a type of user, I want a goal, so that a reason. Both put the user at the centre. In large projects, a requirements traceability matrix links every requirement to its design element, code module and test case, so that the effect of a change can be found at once and no requirement is left untested. Tools such as spreadsheets and requirements management software help to keep the matrix up to date.
Table 2.2: Ways of specifying requirements
| Method | Strength | Weakness |
|---|---|---|
| Natural language | Easy to read | Vague and ambiguous |
| Structured language | Uniform and checkable | Less expressive |
| Graphical models | Show the big picture | Need training to read |
| Formal specification | Precise | Costly and hard to read |
Example 2.2: Writing a verifiable requirement
Problem: Rewrite the statement "The login should be quick and secure" as verifiable requirements.
Solution:
- Replace "quick" with a measure: the login shall complete within 3 seconds.
- Replace "secure" with a testable rule: the system shall lock an account after 5 failed attempts.
Result: The two statements can now be tested and are unambiguous.
Common mistakes
- Using "shall" and "should" without a consistent meaning.
- Leaving out a glossary, so that terms are understood in different ways.
- Writing a long narrative instead of numbered, individually testable requirements.
Key takeaways
- The SRS is the official statement of what is to be built.
- A good SRS is complete, consistent, unambiguous and verifiable.
- Each requirement should have a unique identity for traceability.
- Natural language is common but needs a structure to avoid ambiguity.
Practice questions
- What is an SRS?
- Name two qualities of a good SRS.
- What does "shall" indicate in a requirement?
Answers to the practice questions
- A document that states clearly and completely what a software system must do.
- Complete and unambiguous (also consistent, verifiable and traceable).
- A mandatory requirement.
Sources
- Official BCA syllabus Software Engineering, course code 26BCA403DS03, Unit II
