MODULE 2 - SET - Handout
MODULE 2 - SET - Handout
]
MODULE 2
CHAPTER 4
REQUIREMENTS ENGINEERING
The process of finding out, analyzing, documenting and checking the services (controlling a
device, placing an order or finding information) and constraints is called requirements
engineering (RE)
The term requirement is not used consistently in the software industry. In some cases, a
requirement is simply a high-level, abstract statement. At the other extreme, it is a detailed,
formal definition of a system function
Some of the problems that arise during the requirements engineering process are a result of
failing to make a clear separation between these different levels of description
So, we distinguish between them by using the term user requirements to mean the high-level
abstract requirements and system requirements to mean the detailed description of what the
system should do
User requirements and system requirements may be defined as follows
1. User requirements are statements, in a natural language plus diagrams, of what services the
system is expected to provide to system users and the constraints under which it must
operate. The user requirements may vary from broad statements of the system features
required to detailed, precise descriptions of the system functionality.
2. System requirements are more detailed descriptions of the software system’s functions,
services, and operational constraints. The system requirements document (sometimes called
a functional specification) should define exactly what is to be implemented. It may be part
of the contract between the system buyer and the software developers.
The example from the mental health care patient information system (Mentcare), Figure 4.1
You need to write requirements at different levels of detail because different types of readers
use them in different ways
The Figure 4.2 shows the types of readers of the user and system requirements
Requirements Engineering is usually presented as the first stage of the software engineering
process. However, some understanding of the system requirements may have to be
developed before a decision is made to go ahead with the procurement or development of a
system.
This early-stage RE establishes a high-level view of what the system might do and the
benefits that it might provide. These may then be considered in a feasibility study, which
tries to assess whether or not the system is technically and financially feasible
The results of that study help management decide whether or not to go ahead with the
procurement or development of the system.
These focus on assessing if the system is useful to the business (feasibility study), discovering
requirements (elicitation and analysis), converting these requirements into some standard form
(specification), and checking that the requirements actually define the system that the customer
wants (validation).
Fig 4.6 shows this interleaving. The activities are organized as an iterative process around a
spiral, with the output being a system requirements document.
The amount of time and effort devoted to each activity in each iteration depends on the stage of
the overall process and the type of system being developed
This spiral model accommodates approaches to development where the requirements are
developed to different levels of detail
The number of iterations around the spiral can vary so the spiral can be exited after some or all
of the user requirements have been elicited
4. Requirements documentation: The requirements are documented and input into the
next round of the spiral. Formal or informal requirements documents may be produced.
Eliciting and understanding requirements from system stakeholders is a difficult process for
several reasons:
1. Stakeholders often don’t know what they want from a computer system except in the most
general terms; they may find it difficult to articulate what they want the system to do; they
may make unrealistic demands because they don’t know what is and isn’t feasible.
2. Stakeholders in a system naturally express requirements in their own terms and with
implicit knowledge of their own work. Requirements engineers, without experience in the
customer’s domain, may not understand these requirements.
3. Different stakeholders have different requirements and they may express these in different
Prof. Anusha K S, Dept. of CS&E, VVCE, Mysuru. Page 7
Software Engineering and Testing [20CS45]
]
ways. Requirements engineers have to discover all potential sources of requirements and
discover commonalities and conflict.
4. Political factors may influence the requirements of a system. Managers may demand
specific system requirements because these will allow them to increase their influence in
the organization.
5. The economic and business environment in which the analysis takes place is dynamic. It
inevitably changes during the analysis process. The importance of particular requirements
may change. New requirements may emerge from new stakeholders who were not
originally consulted.
4.3.1 Requirements elicitation techniques
Requirements elicitation involves meeting with stakeholders of different kinds to discover
information about the proposed system
You may supplement this information with knowledge of existing systems and their
usage and information from documents of various kinds
There are two fundamental approaches to requirements elicitation
- Interviewing, where you talk to people about what they do.
- Observation or ethnography, where you watch people doing their job to see what
artifacts they use, how they use them, and so on.
4.3.1.1 Interviewing
In these interviews, the requirements engineering team puts questions to stakeholders about the
system that they currently use and the system to be developed.
Interviews may be of two types:
1. Closed interviews, where the stakeholder answers a pre-defined set of questions.
2. Open interviews, in which there is no pre-defined agenda. The requirements engineering
team explores a range of issues with system stakeholders and hence develops a better
understanding of their needs.
It can be difficult to elicit domain knowledge through interviews for two reasons:
1. All application specialists use terminology and jargon that are specific to a domain. It is
impossible for them to discuss domain requirements without using this terminology.
2. Some domain knowledge is so familiar to stakeholders that they either find it difficult to
explain or they think it is so fundamental that it isn’t worth mentioning. For example, for a
librarian, it goes without saying that all acquisitions are catalogued before they are added
to the library. However, this may not be obvious to the interviewer, and so it isn’t taken into
Prof. Anusha K S, Dept. of CS&E, VVCE, Mysuru. Page 8
Software Engineering and Testing [20CS45]
]
account in therequirements.
Effective interviewers have two characteristics:
1. They are open-minded, avoid pre-conceived ideas about the requirements, and are willing to
listen to stakeholders. If the stakeholder comes up with surprising requirements, then they
are willing to change their mind about the system.
2. They prompt the interviewee to get discussions going using a springboard question, a
requirements proposal, or by working together on a prototype system. They find it much
easier to talk in a defined context rather than in general terms
4.3.1.2 Ethnography
Ethnography is an observational technique that can be used to understand operational processes
and help derive support requirements for these processes
The value of ethnography is that it helps discover implicit system requirements that reflect the
actual ways that people work, rather than the formal processes defined by the organization
Ethnography can be combined with prototyping as shown in figure 4.8
A scenario starts with an outline of the interaction. During the elicitation process, details are
added to create a complete description of that interaction. At its most general, a scenario may
include
System requirements are expanded versions of the user requirements that are used by software
engineers as the starting point for the system design
They add detail and explain how the user requirements should be provided by the system
It is practically impossible to exclude all design information. There are several reasons for this
- You may have to design an initial architecture of the system to help structure the
requirements specification. The system requirements are organized according to the
different sub-systems that makeup the system
- In most cases, systems must interoperate with existing systems, which constrain thedesign
and impose requirements on the new system
- The use of a specific architecture to satisfy non-functional requirements may benecessary.
- The fig 4.11shows the different notations for writing system requirement.
Figure 4.12: Example requirements for the insulin pump software system
4.4.2 Structured specifications
Structured natural language is a way of writing system requirements where the freedomof the
requirements writer is limited and all requirements are written in a standard way
An example of a form-based specification, that defines how to calculate the dose of insulin to
be delivered when the blood sugar is within a safe band, as shown in fig 4.13
A use case identifies the actors involved in an interaction and names the type ofinteraction
The set of use cases represents all of the possible interactions that will be described in the
system requirements
Actors in the process, who may be human or other systems, are represented as stickfigures.Each
class of interaction is represented as a named ellipse. Lines link the actors with the interaction.
Arrowheads may be added to lines to show how the interaction is initiated.
Each use case should be documented with a textual description. These can then be linked to
other models in the UML that will develop the scenario in more detail.
For example, a brief description of the Setup Consultation use case from fig 4.15 below
might be:
Setup consultation allows two or more doctors, working in different offices, to view the same
record at the same time. One doctor initiates the consultation by choosing the people involved
from a drop-down menu of doctors who are online.
The patient record is then displayed on their screens but only the initiating doctor can edit the
record. In addition, a text chat window is created to help coordinate actions. It is assumed that
a phone conference for voice communication will be separately set up.
It may include both the user requirements for a system and a detailed specification of the
system requirements
The requirements document has a diverse set of users, ranging from the senior management
of the organization that is paying for the system to the engineers responsible for developing
the software
Figure 4.17 shows one possible organization for a requirements document that is basedon
an IEEE standard for requirements documents
Requirements validation is the process of checking that requirements actually define thesystem
that the customer really wants
It overlaps with analysis as it is concerned with finding problems with the requirements
During the requirements validation process, different types of checks should be carriedout on
the requirements in the requirements document.
A Change Management Process: This is the set of activities that assess the impact and
cost of changes.
Traceability Policies: These policies define the relationships between each requirement
and between the requirements and the system design that should be recorded. The
traceability policy should also define how these records should bemaintained.
- During this stage, the problem or the change proposal is analyzed to check that
it is valid.
- This analysis is fed back to the change requestor who may respond with a
more specific requirements change proposal, or decide to withdraw the
request.
b. Change Analysis and Costing
- The effect of the proposed change is assessed using traceability information
and general knowledge of the system requirements.
c. Change Implementation
- The requirements document and, where necessary, the system design and
implementation, are modified.
- Requirements document will have to be organized so that changes can be
made to it without extensive rewriting or reorganization.
System Modeling
System modeling is the process of developing abstract models of a system, with each model
presenting a different view or perspective of that system.
System modeling has generally come to mean representing the system using some kind of
graphical notation, which is now almost always based on notations in the Unified Modeling
Language(UML).
Models are used during the requirements engineering process to help derive the
requirements for a system, during the design process to describe the system to engineers
implementing the system and after implementation to document the system‟s structure and
operation.
You may develop models of both existing system and the system to be developed.
1 Models of the existing system are used during requirements engineering. They help
classify what the existing system does and can be used as a basis for discussing its
strengths and weaknesses. These then lead to requirement for the new system.
Types of Models: Different models may represent a system from different perspectives. For
example:
1 An external perspective model representing the context or environment of the system
2 An interaction perspective Model where the interactions between a system and its
environmentor between the components of a system is represented.
3 A structural perspective model showing the organization of a system or the structure of the
datathat is processed by the system.
4 A behavioral perspective model where the model shows the dynamic behavior of the system
andhow it responds to events.
How to represent a Model
System Models are usually represented graphically and so are the software system Models.
Graphical models are very popular because they are easy to understand and construct.
The Unified Modeling Language (UML) provides a standard for the artifacts of development
(semantic models, syntactic notation, and diagrams
The creation of UML was originally developed by Grady Booch, Ivar Jacobson and James
Rumbaugh at Rational Software in 1996.
In 2005 UML was also published by the International Organization for Standardization (ISO)
as an approved ISO standard.
The UML has many diagram types and so supports the creation of many different types of
systemmodel.
1. Activity Diagram, which show the activities involved in a process or in data processing.
This involves working with system stakeholders to decide what functionality should be
included in the system and what is provided by the system’s environment.
A decision might be taken about an automated support for some business processes should
be implemented but others should be manual processes or supported by different systems.
Possible overlaps must also be noted in functionality with existing systems and decide where
new functionality should be implemented.
These decisions should be made early in the process to limit the system costs and the time
needed for understanding the system requirements and design.
Fig 5.1 is a simple context model that shows the patient information system and the other
systems in its environment. It is seen that the Mentcare System is connected to an
appointments system and a more general patient record system with which it shares data.
The system is also connected to systems for management reporting and hospital bed allocation
and a statistics system that collects information for research. finally, it makes use of a
prescription system to generate prescriptions for patients Medication.
Activity diagrams are intended to show the activities that make up a system process and
the flow of control from one activity to another.
The start of a process is indicated by a filled circle; the end by a filled circle inside
another circle.
Rectangles with round corners represent activities, that is, the specific sub-processes
that must be carried out.
Objects can be included in activity charts.
In fig 5.2, it can be seen that guards showing the flows for patients who are dangerous and
not dangerous to society.
Patients who are dangerous to society must be detained in a secure facility. However,
patients who are suicidal and so are a danger to themselves may be detained in an
appropriate ward in a hospital.
They show what happens or what is supposed to happen when a system responds to astimulus
from its environment.
There are 2 types:
Events: Some event happens that triggers system processing. Events may have associated
data but this is not always the case.
Data-driven models show the sequence of actions involved in processing input data and
generating an associated output.
They are particularly useful during the analysis of requirements as they can be used to show
end-to-end processing in a system.
Data-flow models are useful because tracking and documenting how the data associated
with a particular process moves through the system helps analysts and designers understand
what is going on.
Data-flow diagrams (DFD‟s) are simple and intuitive and it is usually possible to explain
them to potential system users who can then participate in validating the model.
Fig 5.14 shows the activity model of the insulin pump’s operation.
Sequence models highlight objects in a system, whereas data-flow diagrams highlight the
functions.
Event-driven modeling shows how a system responds to external and internal events.
It is based on the assumption that a system has a finite number of states and that events
[stimuli] may cause a transition from one state to another.
For example, a system controlling a valve may move from a state valve open to a state valve
closed when an operator command (the stimulus) is received.
The UML supports event-based modeling using state diagrams, which were based on
Statecharts.
State diagrams show system states and events that cause transitions from one state toanother.
They do not show the flow of data within the system but may include additionalinformation
on the computations carried out in each state.
The sequence of actions in using the microwave is:
Select the power level (either half power or full power).
Input the cooking time using a numeric keypad.
Press Start and the food is cooked for the given time.
From fig 5.16, it can be seen that the system starts in a waiting state and respondsinitially to
either the full-power or the half-power button.
Users can change their mind after selecting one of these and press the other button.
The time is set and, if the door is closed, the Start button is enabled. Pushing this button
starts the oven operation and cooking takes place for the specified time.
This is the end of the cooking cycle and the system returns to the waiting state.
Figure 5.18, shows a tabular description of each state and how the stimuli that forcestate
transitions are generated.
The Operation state includes a number of substates. It shows that operation starts with a
status check and that if any problems are discovered an alarm is indicated and operation is
disabled. Cooking involves running the microwave generator for the specified time; on
completion, a buzzer is sounded. If the door is opened during operation, the system moves to
the disabled state, as shown in Figure.