Writing Requirements

Steven J Zeil:

Last modified: Oct 5, 2016
Contents:
1 A “Classical” Approach to Requirements
1.1 The Primary Requirements Documents
2 Requirements Definition
2.1 Writing requirements definitions
2.2 Example (RSDIMU)
2.3 Example (Spreadsheet)
3 Requirements Specification
3.1 Characteristics of a good SRS
3.2 A Prototype SRS outline
3.3 Documenting Individual Requirements
3.4 Example: Spreadsheet
4 A Minority View - Formal Requirements
4.1 Example of Formal Specification

1 A “Classical” Approach to Requirements

Problems of requirements analysis

1.1 The Primary Requirements Documents

Waterfall processes often distinguished between

2 Requirements Definition

2.1 Writing requirements definitions

2.2 Example (RSDIMU)

 

Physically, the RSDIMU consists of a square-based pyramid with the triangular faces being equilateral triangles (a semi-octahedron).


 

On each triangular face are mounted two sensors, at right angles to each other.

That gives a total of 8 sensors, all at varying angles to one another. That’s more than enough to determine the acceleration of the aircraft in 3 dimensions.

This redundancy (the “R” in RSDIMU) is important because:


From the RSDIMU Requirements Definition:

An RSDIMU consists of a skewed array of redundant inertial sensors and exemplifies the current trend for designing hardware fault tolerant inertial measurement units (IMU’s) for high reliability applications. The portion of the RSDIMU you will handle contains eight linear accelerometers mounted on the four triangular faces of a semioctahedron.

Your procedure will have two functions, both of which are a consequence of the redundancy in the sensor complement of the RSDIMU. The first function is to perform a consistency check to detect and isolate failed sensors. The second is to use the sensors found to be good by the first check to provide estimates of the vehicle’s linear acceleration expressed as components along the north, east, and down axes of a navigational frame of reference.

an RSDIMU as described here would operate as follows. With the vehicle stationary, as series of sensor readings would be taken over time, and this would comprise the calibration data set for that particular flight. During flight, the sensors would be read periodically at regular time intervals to provide input for the navigation software.


Critique

The preceding requirements mix up functional and non-functional requirements and are incomplete.

2.3 Example (Spreadsheet)

A simpler requirements definition.

Read through this.

3 Requirements Specification

The SRS (Software Requirements Specifications) adds detail to the requirements definition.

3.1 Characteristics of a good SRS

An SRS should be

  1. Correct;
  2. Unambiguous;
  3. Complete;
  4. Consistent;
  5. Ranked for importance and/or stability;
  6. Verifiable (see below)
  7. Modifiable;
  8. Traceable (see below)

Most of these are self-explanatory.

3.1.1 Verifiability

Requirements should be written so that they can be objectively verified


Making the Subjective Objective

Some possible objective measures of properties that we often consider to be subjective:

Property Measure
(subjective) (objective)
Speed processed transactions / sec.
Response time
screen refresh time
Size k bytes
Ease of use training time
number of help frames
Reliability mean time to failure
probability of unavailability
failure rate
Robustness time to restart after failure
probability of data corruption after failure
Portability % of target dependent statements
number of target systems

3.1.2 Requirements traceability

Requirements traceability means that related requirements are linked in some way and that requirements are (perhaps) linked to their source


Improving Traceability

3.2 A Prototype SRS outline

Table of Contents
1. Introduction
   1.1 Purpose
   1.2 Scope
   1.3 Definitions, acronyms, and abbreviations
   1.4 References
   1.5 Overview
2. Overall description
   2.1 Product perspective
   2.2 Product functions
   2.3 User characteristics
   2.4 Constraints
   2.5 Assumptions and dependencies
3. Specific requirements
     ⋮
Appendixes
Index

(Source: IEEE Std 830-1998, Recommended Practice for Software Requirements Specifications, sect 5)

3.2.1 1. Introduction

3.2.2 2. Overall Description

3.2.3 4. Appendices

Skipping forward for just a moment,…

3.2.4 3. Specific Requirements

"This section of the SRS should contain all of the software requirements to a level of detail sufficient to enable designers to design a system to satisfy those requirements, and testers to test that the system satisfies those requirements.


Important: Remember that this is requirements, not design.

Functional and Non-Functional Requirements.

Whatever organization is chosen, Section 3 documents both functional and non-functional requirements, and does so separately.

Functional Requirements

“The system shall…”

These include

  1. Validity checks on the inputs
  2. Exact sequence of operations
  3. Responses to abnormal situations, including
    • Overflow
    • Communication facilities
    • Error handling and recovery
  4. Effect of parameters
  5. Relationship of outputs to inputs, including
    • Input/output sequences
    • Formulas for input to output conversion

Non-functional requirements


Non-functional requirements examples

Requirements separation

3.3 Documenting Individual Requirements

There are many different styles for documenting functional and non-functional requirements.

The choice often depends on

3.3.1 Structured English

Perhaps most common is the use of a mixture of natural language, mathematics, and diagrams, in a detailed numbered list:

3. Physical structure:

The RSDIMU is composed of an instrument and a display. The display is discussed in Section 6.3. This section is devoted to the structure of the instrument package.

3.1 The instrument package is a semi-octahedron (a square-based pyramid) (Figure 1).

3.1.1 It has four non-base faces, named A, B, C, or D.

3.1.2 Each face contains two sensors, named the x and y sensors.

3.1.2.1 Associated with each sensor is a set of misalignment angles. These are specified further in Section 2.3.2.

Rationale: There is an ideal position for each sensor, but the physical mounting may differ slightly.

3.1.2.2 The misalignment angles are assumed to be small enough (less than 5 degrees) for the sine of the angle to be approximately equal to the value of the angle expressed in radians.

3.1.3 The temperature of the face, temp, determines the temperatures of the sensors mounted on the face.

Rationale: Sensor output varies with temperature (see section 4.6).

3.3.2 Function Pre and Post Conditions

There is a long tradition of documenting both functions (design and implementation) and functionality (requirements) with pre-conditions and post-conditions:


RSDIMU/Calibration/4.1

Function: Check for Noise

Description: The variance in a number of readings taken from one sensor while the vehicle was at rest are compared to a threshold value. Sensors whose variance exceeds the threshold are marked as failed due to excessive noise.

Inputs: Face, Sensor, raw sensor data collected on ground, noise threshold

Source: raw sensor data offraw from external measurement procedure

Outputs: Sensor failure linFail & noise indicators linNoise

Destination: Edge consistency check and acceleration estimation functions

Requires: Instrument

Pre-condition: Sensor is not already marked as failed

Post-condition: linFail[Face,Sensor] and linNoise[Face,Sensor*] will be set to true if std-dev(offraw) > 3 * linstd.

Side effects: Changes to sensor status affect face status as well.

3.4 Example: Spreadsheet

Here is a complete SRS in the IEEE 830 style.

4 A Minority View - Formal Requirements

There is always a dedicated group of advocates who maintain that the use of natural language in requirements specifications is a fundamental flaw.

4.1 Example of Formal Specification

A formal specification of the RSDIMU

 


 

Some schemas from the RSDIMU specification: