Software Engineering - I
Software Engineering - I
Lecture 04
Requirements Engineering
Objectives
• Requirement
• Requirement Engineering Process
• Requirements elicitation and analysis
• Requirements specification
• The software requirements document
• User, System and domain requirements.
• Types: and non-functional requirements
• Requirement Characteristics
• Requirement Gathering Techniques
• Requirements Validation
• Requirements Management
What is a Requirement?
• It may range from a high-level abstract statement of a service or of a
system constraint to a detailed mathematical functional specification.
• This is inevitable as requirements may serve a dual function
• May be the basis for a bid for a contract - therefore must be open to interpretation;
• May be the basis for the contract itself - therefore must be defined in detail;
• Both these statements may be called requirements.
Requirements abstraction (Davis)
“If a company wishes to let a contract for a large software
development project, it must define its needs in a sufficiently
abstract way that a solution is not pre-defined. The requirements
must be written so that several contractors can bid for the contract,
offering, perhaps, different ways of meeting the client
organization’s needs. Once a contract has been awarded, the
contractor must write a system definition for the client in more
detail so that the client understands and can validate what the
software will do. Both of these documents may be called the
requirements document for the system.”
Agile Methods and Requirements
• Many agile methods argue that producing a requirements document is a
waste of time as requirements change so quickly.
• The document is therefore always out of date.
• Methods such as XP use incremental requirements engineering and
express requirements as ‘user stories’
• This is practical for business systems but problematic for systems that
require a lot of pre-delivery analysis (e.g. critical systems) or systems
developed by several teams.
Requirements Engineering
• The requirements for a system are the descriptions of what the system
should do
• The process of establishing the services that the customer requires from
a system and the constraints under which it operates and is developed.
• The process of finding out, analyzing, documenting and checking these
services and constraints is called requirements engineering (RE)
The Requirements Engineering Process
Requirements Engineering Process
• The processes used for RE vary widely depending on the application
domain, the people involved and the organisation developing the
requirements.
• However, there are a number of generic activities common to all processes
• Requirements elicitation;
• Requirements analysis;
• Requirements Specification;
• Requirements validation;
• Requirements management.
Requirements Engineering
Requirements Engineering
Requirements Management
Steps in Requirement Phase
3.2 The system will measure the blood sugar and deliver insulin, if required,
every 10 minutes. (Changes in blood sugar are relatively slow so more frequent
measurement is unnecessary; less frequent measurement could lead to
unnecessarily high sugar levels.)
3.6 The system will run a self-test routine every minute with the conditions to be
tested and the associated actions defined in Table 1. (A self-test routine can
discover hardware and software problems and alert the user to the fact the
normal operation may be impossible.)
Form-based specifications
• Definition of the function or entity.
• Description of inputs and where they come from.
• Description of outputs and where they go to.
• Information about the information needed for the computation and other
entities used.
• Description of the action to be taken.
• Pre and post conditions (if appropriate).
• The side effects (if any) of the function.
Types of Requirement (Context)
• User Requirements
• Statements in natural language plus diagrams of the services the system provides
and its operational constraints. Written for customers.
• System Requirements
• A structured document setting out detailed descriptions of the system’s functions,
services and operational constraints. Defines what should be implemented so may be
part of a contract between client and contractor.
User and System Requirements
Readers of Different types of Requirements
Specification
Domain Requirements
• The system’s operational domain imposes requirements on the
system.
• For example, a train control system has to take into account the braking characteristics
in different weather conditions.
• Domain requirements be new functional requirements, constraints on
existing requirements or define specific computations.
• If domain requirements are not satisfied, the system may be unworkable.
Train protection system
• This is a domain requirement for a train protection system:
• The deceleration of the train will be computed as:
• Dtrain = Dcontrol + Dgradient
Organizational requirement
Users of the MHC-PMS system will authenticate themselves using their health
authority identity card.
External requirement
The system will implement patient privacy provisions as set out in HStan-03-
2006-priv.
NFR- Goals and Requirements
• A common problem with non-functional requirements is
that users or customers often propose these requirements as
general goals
• Non-functional requirements may be very difficult to state
precisely and imprecise requirements may be difficult to verify.
• Goal
• A general intention of the user such as ease of use.
• Verifiable non-functional requirement
• A statement using some measure that can be objectively tested.
• Goals are helpful to developers as they convey the intentions
of the system users.
Usability requirements
• How a manager might express usability requirements as GOAL
• The system should be easy to use by medical staff and should be
organized in such a way that user errors are minimized. (Goal)
• R4: The system will play the sound ’C:\alarm.wav’ once, at the highest volume
setting in the main speaker for the building when the door opens.
Good and Bad Requirements - Example 3
• R5: The system will respond quickly to user interaction.
• R11: When a user enters the code associated with him/her on keypad K2 the
door D2 will unlock and remain unlocked for 30 seconds.
Good and Bad Requirements - Example 6
• R12: When a user has entered the building, this will be registered in the entry
log and the user’s computer will be booted.
• R12: When a user has entered the building, this will be registered in the entry
log.
• R13: When a user has entered the building, the user’s computer will be
booted.
• R12: The system will register in the entry log when a user has entered the
building.
Requirements Discovery
• The process of gathering information about the required and existing
systems and distilling the user and system requirements from this
information.
• Interaction is with system stakeholders from managers to external
regulators.
• Sources of information may include documentation, system stakeholders, and
specifications of similar systems
• Systems normally have a range of stakeholders.
Stakeholders in the MHC-PMS
• Patients whose information is recorded in the system.
• Doctors who are responsible for assessing and treating patients.
• Nurses who coordinate the consultations with doctors and administer
some treatments.
• Medical receptionists who manage patients’ appointments.
• IT staff who are responsible for installing and maintaining the system.
Techniques of Eliciting Requirements
• Analysts can employ several techniques to elicit the requirements from the
customer.
Survey/Questionnaire
Focus groups (requirements workshops) and creating requirements lists.
Naturalistic observation
Document Analysis
Interviews
Ethnography
Prototyping
Use cases
Brainstorming
Combination of these methods will be good choice.
Questionnaires
• Questionnaires: Series of questions designed to elicit specific information
from us. The questions may require different kinds of answers: some
require a simple Yes/No, others ask us to choose from a set of pre-supplied
answers.
• SurveyMonkey
• Popular solution to let you design and distribute questionnaires
• Runs ‘in the cloud’
• Lime Survey
• A free online tool that can be installed directly onto the researcher’s system, thus
avoiding storage of data in the cloud (better control of confidential data)
Focus groups and workshops
Models
Scenarios are useful in discussing a proposed system with
client, but requirements need to be made more precise before
a system is fully understood.
This is the purpose of requirements modelling.
Use Case Name: Enter a short name for the Use Case using an active verb phrase. e.g. Withdraw Cash
Actors: [An actor is a person or other entity external to the software system being specified who
interacts with the system and performs use cases to accomplish tasks.
Different actors often correspond to different user classes, or roles, identified from
the customer community that will use the product.
Name the actor that will be initiating this use case (primary) and any other actors who will
participate in completing the use case (secondary).]
Description: [Provide a brief description of the reason for and outcome of this use case.]
Level: Enter Use Case Goal Level here: Hight/Medium/Low
Trigger: [Identify the event that initiates the use case. This could be an external business event or
system event that causes the use case to begin, or it could be the first step in the normal
flow.]
Tabular Format and guideline to write use case(s)
Preconditions: [List any activities that must take place, or any conditions that must be true, before the
use case can be started. Number each pre-condition. e.g.
1. Customer has active deposit account with ATM privileges
2. Customer has an activated ATM card.]
Includes: [List any other use cases that are included (“called”) by this use case. Common
functionality that appears in multiple use cases can be split out into a separate use case
that is included by the ones that need that common functionality. e.g. steps 1-4 in the
normal flow would be required for all types of ATM transactions- a Use Case could be
written for these steps and “included” in all ATM Use Cases.]
Software Engineering Concepts-CSC291-Fall-2018 Mr. Tehseen
Riaz Abbasi
Normal Flow: [Provide a detailed description of the user actions and system responses that will take
place during execution of the use case under normal, expected conditions. This dialog
sequence will ultimately lead to accomplishing the goal stated in the use case name and
description.
1. Customer inserts ATM card
2. Customer enters PIN
3. System prompts customer to enter language performance English or Spanish
4. System validates if customer is in the bank network
5. System prompts user to select transaction type
6. Customer selects Withdrawal From Checking
7. System prompts user to enter withdrawal amount
8. …
9. System ejects ATM card]
Software Engineering Concepts-CSC291-Fall-2018 Mr. Tehseen
Riaz Abbasi
Alternative Flows: [Document legitimate branches from the main flow to handle special conditions (also
[Alternative Flow 1 – Not known as extensions). For each alternative flow reference the branching step number of the
in Network]
normal flow and the condition which must be true in order for this extension to be
executed. e.g. Alternative flows in the Withdraw Cash transaction:
4a. In step 4 of the normal flow, if the customer is not in the bank network
1. System will prompt customer to accept network fee
2. Customer accepts
3. Use Case resumes on step 5
4b. In step 4 of the normal flow, if the customer is not in the bank network
1. System will prompt customer to accept network fee
2. Customer declines
3. Transaction is terminated
4. Use Case resumes on step 9 of normal flow
Note: Insert a new row for each distinctive alternative flow. ]
Tabular Format and guideline to write use case(s)
Exceptions: [Describe any anticipated error conditions that could occur during execution of the use case,
and define how the system is to respond to those conditions.
e.g. Exceptions to the Withdraw Case transaction
2a. In step 2 of the normal flow, if the customer enters and invalid PIN
1. Transaction is disapproved
2. Message to customer to re-enter PIN
3. Customer enters correct PIN
4. Use Case resumes on step 3 of normal flow]
Postconditions: [Describe the state of the system at the end of the use case execution. Should
include both minimal guarantees (what must happen even if the actor’s goal is not
achieved) and the success guarantees (what happens when the actor’s goal is
achieved. Number each post-condition. e.g.
Includes: NA
Assumptions: Application will be installed.
Notes and Issues: NA
Tabular Use Case Example-2
Template to write Functional Requirement
Identifier Requirement ID
Restrictions and Risk Any restriction and risk that requirement must be fulfilled
Priority High/Medium/Low
Functional Requirement – Example-1
Identifier 1.2.1
Title Edit Application
Requirement The students must be able to access the main
application tab so that they can edit their
application and complete all the requirements of
the application in order to apply to the universities
they intends to
Source Discover Your Future
Rationale To ensure that the student provides all the
necessary details required
Restrictions and All the fields of the application have to be full filled
Risk in order to submit an application
Dependencies 1.1.1
Priority High
Functional Requirement – Example-2
Identifier 1.1.1
Title Login/Register
Requirement A student should be able to register and log in to the system
Restrictions and Risk The student must remember the credentials and keep it safe
Dependencies 1.1.2
Priority High
Requirements validation
• Concerned with demonstrating that the requirements define the system
that the customer really wants.
• Requirements error costs are high so validation is very important
• Fixing a requirements error after delivery may cost up to 100 times the cost of fixing an
implementation error.
Requirements checking
• Validity. Does the system provide the functions which best support the
customer’s needs?
• Consistency. Are there any requirements conflicts?
• Completeness. Are all functions required by the customer included?
• Realism. Can the requirements be implemented given available budget
and technology
• Verifiability. Can the requirements be checked?
Requirements Validation Techniques
• Requirements reviews
• Systematic manual analysis of the requirements.
• Prototyping
• Using an executable model of the system to check requirements.
• Test-case generation
• Developing tests for requirements to check testability.
Requirements Reviews
• Regular reviews should be held while the requirements definition is being
formulated.
• Both client and contractor staff should be involved in reviews.
• Reviews may be formal (with completed documents) or informal. Good
communications between developers, customers and users can resolve
problems at an early stage.
Review checks
• Verifiability
• Is the requirement realistically testable?
• Comprehensibility
• Is the requirement properly understood?
• Traceability
• Is the origin of the requirement clearly stated?
• Adaptability
• Can the requirement be changed without a large impact on other requirements?
Requirements Management
• Requirements management is the process of managing changing
requirements during the requirements engineering process and system
development.
• New requirements emerge as a system is being developed and after it
has gone into use.
• You need to keep track of individual requirements and maintain links
between dependent requirements so that you can assess the impact
of requirements changes. You need to establish a formal process for
making change proposals and linking these to system requirements.
Requirements Change
• The priority of requirements from different viewpoints changes during
the development process.
• System customers may specify requirements from a business
perspective that conflict with end-user requirements.
• The business and technical environment of the system changes during
its development.
Changing Requirements
• The business and technical environment of the system always
changes after installation.
• New hardware may be introduced, it may be necessary to interface the system with other
systems, business priorities may change (with consequent changes in the system
support required), and new legislation and regulations may be introduced that the system
must necessarily abide by.
• The people who pay for a system and the users of that system are
rarely the same people.
• System customers impose requirements because of organizational and budgetary
constraints. These may conflict with end-user requirements and, after delivery, new
features may have to be added for user support if the system is to meet its goals.
Changing Requirements…
• Large systems usually have a diverse user community, with many users
having different requirements and priorities that may be conflicting or
contradictory.
• The final system requirements are inevitably a compromise between them and, with
experience, it is often discovered that the balance of support given to different users has to
be changed.
Requirements evolution
Requirements Management Planning
• Establishes the level of requirements management detail that is required.
• Requirements management decisions:
• Requirements identification Each requirement must be uniquely identified so that it can be
cross-referenced with other requirements.
• A change management process This is the set of activities that assess the impact and cost
of changes. I discuss this process in more detail in the following section.
• Traceability policies These policies define the relationships between each requirement
and between the requirements and the system design that should be recorded.
• Tool support Tools that may be used range from specialist requirements management
systems to spreadsheets and simple database systems.
Requirements Change Management
• Deciding if a requirements change should be accepted
• Problem analysis and change specification
• 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.
• Change analysis and costing
• The effect of the proposed change is assessed using traceability information and general
knowledge of the system requirements. Once this analysis is completed, a decision is made
whether or not to proceed with the requirements change.
• Change implementation
• The requirements document and, where necessary, the system design and implementation, are
modified. Ideally, the document should be organized so that changes can be easily
implemented.
Requirements Management Planning
• During the requirements engineering process, you have to plan:
• Requirements identification
• How requirements are individually identified;
• A change management process
• The process followed when analysing a requirements change;
• Traceability policies
• The amount of information about requirements relationships that is maintained;
• CASE tool support
• The tool support required to help manage requirements change;
Traceability
• Requirements traceability
• Links between dependent requirements;
• Design traceability
• Links from the requirements to the design;
A traceability matrix
• Change management
• The process of change management is a workflow process whose stages can be
defined and information flow between these stages partially automated.
• Traceability management
• Automated retrieval of the links between requirements.
Requirements Change management
• Should apply to all proposed changes to the requirements.
• Principal stages
• Problem analysis. Discuss requirements problem and propose change;
• Change analysis and costing. Assess effects of change on other requirements;
• Change implementation. Modify requirements document and other documents to reflect
change.
Requirements Change Management
Enduring and Volatile Requirements