Unit 3
Unit 3
Unit 3
Unit – III
[Software requirement analysis and specification & Software Architecture]
A basic purpose of the SRS is to bridge this communication gap so they have a shared
vision of the software being built. Hence, one of the main advantages of a good SRS is:
1. An SRS establishes the basis for agreement between the client and the supplier
on what the software product will do.
This basis for agreement is frequently formalized into a legal contract between the client (or
the customer) and the developer (the supplier). So, through SRS, the client clearly describes
what it expects from the supplier, and the developer clearly understands what capabilities to
build in the software. A related, but important, advantage is:
That is, the SRS helps the client determine if the software meets the requirements. Without a
proper SRS, there is no way a client can determine if the software being delivered is what
was ordered, and there is no way the developer can convince the client that all the
requirements have been fulfilled.
2. Requirement Process:
The requirement process is the sequence of activities that need to be performed in the
requirements phase and that culminate in producing a high-quality document containing the
SRS.
Frequently, during analysis, the analyst will have a series of meetings with the clients
and end users. In the early meetings, the clients and end users will explain to the
analyst about their work, their environment, and their needs as they perceive them.
In the final few meetings, the analyst essentially explains to the client what he
understands the system should do and uses the meetings as a means of verifying if
what he proposes the system should do is indeed consistent with the objectives of the
clients.
2. Requirements specification :
The understanding obtained by problem analysis forms the basis of requirements
specification, in which the focus is on clearly specifying the requirements in a
document.
Issues such as representation, specification languages, and tools are addressed during
this activity. As analysis produces large amounts of information and knowledge with
possible redundancies, properly organizing and describing the requirements is an
important goal of this activity.
3. Requirements validation :
Requirements validation focuses on ensuring that what have been specified in the SRS
are indeed all the requirements of the software and making sure that the SRS is of
good quality. The requirements process terminates with the production of the
validated SRS.
3
The overall requirement process is shown in Figure 1. As shown in the figure, from
the specification activity we may go back to the analysis activity.
This happens as frequently some parts of the problem are analyzed and then specified
before other parts are analyzed and specified.
Once the specification is done, it goes through the validation activity. This activity
may reveal problems in the specification itself, which requires going back to the
specification step, or may reveal shortcomings in the understanding of the problem,
which requires going back to the analysis activity.
4
3.Requirement Specification :
1. Correct
2. Complete
3. Unambiguous
4. Verifiable
5. Consistent
6. Ranked for importance and/or stability
3. It is unambiguous if and only if every requirement stated has one and only one
interpretation. Requirements are often written in natural language, which is inherently
ambiguous. If the requirements are specified in a natural language, the SRS writer has
to be especially careful to ensure that there are no ambiguities.
6.
An SRS is ranked for importance and/or stability if for each requirement the
importance and the stability of the requirement are indicated. Stability of a
requirement reflects the chances of it changing in the future. It can be reflected in
terms of the expected change volume. This understanding of value each requirement
provides is essential for iterative development—selection of requirements for an
iteration is based on this evaluation.
Of all these characteristics, completeness is perhaps the most important and also the most
difficult property to establish. One of the most common defects in requirements specification
is incompleteness. Missing requirements necessitate additions and modifications to the
requirements later in the development cycle, which are often expensive to incorporate.
Incompleteness is also a major source of disagreement between the client and the supplier.
.
4. COMPONENTS OF AN SRS
1. Functional requirements
2. Performance requirements
3. Design constraints
Conceptually, any SRS should have these components. Now we will discuss them one by
one.
1. Functional Requirements
Functional requirements specify what output should be produced from the given inputs. So
they basically describe the connectivity between the input and output of the system. For each
functional requirement:
1. A detailed description of all the data inputs and their sources, the units of measure, and
the range of valid inputs be specified:
2. All the operations to be performed on the input data obtain the output should be
specified, and
3. Care must be taken not to specify any algorithms that are not parts of the system but that
may be needed to implement the system.
6
4. It must clearly state what the system should do if system behaves abnormally when any
invalid input is given or due to some error during computation. Specifically, it should
specify the behaviour of the system for invalid inputs and invalid outputs.
This part of an SRS specifies the performance constraints on the software system. All the
requirements related to the performance characteristics of the system must be clearly
specified. Performance requirements are typically expressed as processed transaction s per
second or response time from the system for a user event or screen refresh time or a
combination of these. It is a good idea to pin down performance requirements for the most
used or critical transactions, user events and screens.
2. Design Constraints
The client environment may restrict the designer to include some design constraints that must
be followed. The various design constraints are standard compliance, resource limits,
operating environment, reliability and security requirements and policies that may have an
impact on the design of the system. An SRS should identify and specify all such constraints.
Standard Compliance: It specifies the requirements for the standard the system must follow.
The standards may include the report format and according procedures.
Fault Tolerance: Fault tolerance requirements can place a major constraint on how the
system is to be designed. Fault tolerance requirements often make the system more complex
and expensive, so they should be minimized.
Security: Currently security requirements have become essential and major for all types of
systems. Security requirements place restriction s on the use of certain commands control
access to database, provide different kinds of access, requirements for different people,
require the use of passwords and cryptography techniques, and maintain a log of activities in
the system.
1. All the possible interactions of the software with people hardware and other software
should be clearly specified,
2. The characteristics of each user interface of the software product should be specified and
3. The SRS should specify the logical characteristics of each interface between the software
product and the hardware components for hardware interfacing.
7
The introduction section contains the purpose, scope, overview, etc., of the
requirements document. The key aspect here is to clarify the motivation and
business objectives that are driving this project, and the scope of the project.
The next section gives an overall perspective of the system—how it fits into the larger
system, and an overview of all the requirements of this system.
8
The detailed requirements section describes the details of the requirements that a
developer needs to know for designing and developing the system. This is typically
the largest and most important part of the document. For this section, different
organizations have been suggested in the standard.
One method to organize the specific requirements is to first specify the external
interfaces, followed by functional requirements, performance requirements, design
constraints, and system attributes. This structure is shown in Figure.
In the functional requirements section, the functional capabilities of the system are
described.
The performance section should specify both static and dynamic performance
requirements.
Use cases specify the functionality of a system by specifying the behavior of the
system, captured as interactions of the users with the system.
Use cases can be used to describe the business processes of the larger business or
organization that deploys the software, or it could just describe the behavior of the
software system. We will focus on describing the behavior of software systems that
are to be built.
Though use cases are primarily for specifying behavior, they can also be used effectively for
analysis.
Actor :In UML, someone or something outside the system that interacts with the
system.
Primary actor : The main actor for whom a use case is initiated and whose goal satisfaction
is the main objective of the use case.
Scenario : a set of actions that are performed to achieve a goal under some specified
conditions.
9
Main Success scenario: Describes the interaction if nothing fails and all steps in the scenario
succeed.
Extension scenario: Describes the system behaviour if some of the steps in the main scenario
do not complete successfully.
Actors and goals. The actor-goal list enumerates the use cases and specifies the
actors for each goal. (The name of the use case is generally the goal.) This table may
be extended by giving a brief description of each of the use cases. At this level, the
use cases together specify the scope of the system and give an overall view of what it
does. Completeness of functionality can be assessed fairly well by reviewing these.
Main success scenarios. For each of the use cases, the main success scenarios are
provided at this level. With the main scenarios, the system behavior for each use case
is specified. This description can be reviewed to ensure that interests of all the
stakeholders are met and that the use case is delivering the desired behavior.
Failure conditions. Once the success scenario is listed, all the possible failure
conditions can be identified. At this level, for each step in the main success scenario,
the different ways in which a step can fail form the failure conditions. Before deciding
what should be done in these failure conditions (which is done at the next level), it is
better to enumerate the failure conditions and review for completeness.
Failure handling. This is perhaps the most tricky and difficult part of writing a use
case. Often the focus is so much on the main functionality that people do not pay
attention to how failures should be handled. Determining what should be the behavior
under different failure conditions will often identify new business rules or new actors.
10
Step 1. Identify the actors and their goals and get an agreement with the concerned
stakeholders as to the goals. The actor-goal list will clearly define the scope of the
system and will provide an overall view of what the system capabilities are.
Step 2. Understand and specify the main success scenario for each UC, giving more
details about the main functions of the system. Interaction and discussion are the
primary means to uncover these scenarios though models may be built, if required.
During this step, the analyst may uncover that to complete some use case some other
use cases are needed, which have not been identified. In this case, the list of use cases
will be expanded.
Step 3. When the main success scenario for a use case is agreed upon and the main
steps in its execution are specified, then the failure conditions can be examined.
Enumerating failure conditions is an excellent method of uncovering special situations
that can occur and which must be handled by the system.
Step 4. Finally, specify what should be done for these failure conditions. As details of
handling failure scenarios can require a lot of effort and discussion, it is better to first
enumerate the different failure conditions and then get the details of these scenarios.
Very often, when deciding the failure scenarios, many new business rules of how to
deal with these scenarios are uncovered.
The basic principle used in analysis is the same as in any complex task: divide and
conquer. That is, partition the problem into sub problems and then try to understand
11
each sub problem and its relationship to other sub problems in an effort to understand
the total problem.
The concepts of state and projection can sometimes also be used effectively in
the partitioning process. A state of a system represents some conditions about the
system. Frequently, when using state, a system is first viewed as operating in one of
the several possible states, and then a detailed analysis is performed for each state.
This approach is sometimes used in real-time software or process-control software.
In projection, a system is defined from multiple points of view . While using
projection, different viewpoints of the system are defined and the system is then
analyzed from these different perspectives. The different “projections” obtained are
combined to form the analysis for the complete system. Analyzing the system from
the different perspectives is often easier, as it limits and focuses the scope of the
study.
DFD RULES :
1 All processes should have unique names. If two data flow lines (or data
stores) have the same label, they should both refer to the exact same data
flow (or data store).
2 The inputs to a process should differ from the outputs of a process.
3 Any single DFD should not have more than about seven processes.
4 No process can have only outputs. (This would imply that the process is
making information from nothing.) If an object has only outputs, then it
must be a source.
Incorrect Correct
5 No process can have only inputs. (This is referred to as a “black hole”.)
If an object has only inputs, then it must be a sink.
Incorrect Correct
6 A process has a verb phrase label.
13
7 Data cannot move directly from one data store to another data store.
Data must be moved by a process.
Incorrect Correct
8 Data cannot move directly from an outside source to a data store. Data
must be moved by a process that receives data from the source and
places the data in the data store.
Incorrect Correct
9 Data cannot move directly to an outside sink from a data store.
Data must be moved by a process.
Incorrect Correct
10 A data store has a noun phrase label.
11 Data cannot move directly from a source to a sink. It must be moved by
a process if the data are of any concern to the system. If data flows
directly from a source to a sink (and does not involved processing) then
it is outside the scope of the system and is not shown on the system data
flow diagram DFD.
Incorrect Correct
12 A source/sink has a noun phrase label.
13 A data flow has only one direction between symbols. It may flow in both
directions between a process and a data store to show a read before an
update. To effectively show a read before an update, draw two separate
arrows because the two steps (reading and updating) occur at separate
times.
Incorrect Correct
14 A fork in a data flow means that exactly the same data goes from a
14
Incorrect Correct
15 A join in a data flow means that exactly the same data comes from any
of two or more different processes, data stores, or sources/sinks, to a
common location.
Incorrect Correct
16 A data flow cannot go directly back to the same process it leaves. There
must be at least one other process that handles the data flow, produces
some other data flow, and returns the original data flow to the
originating process.
Incorrect
Correct
17 A data flow to a data store means update (i.e., delete, add, or change).
18 A data flow from a data store means retrieve or use.
19 A data flow has a noun phrase label. More than one data flow noun
phrase can appear on a single arrow as long as all of the flows on the
same arrow move together as one package.
15
Any object, for example, entities, attributes of an entity, relationship sets, and
attributes of relationship sets, can be represented with the help of an ER diagram.
Entity
Entities are represented by means of rectangles. Rectangles are named
with the entity set they represent.
Attributes
Attributes are the properties of entities. Attributes are represented by
means of ellipses. Every ellipse represents one attribute and is directly
connected to its entity (rectangle).
If the attributes are composite, they are further divided in a tree like
structure. Every node is then connected to its attribute. That is,
composite attributes are represented by ellipses that are connected with
an ellipse.
16
Relationship
Relationships are represented by diamond-shaped box. Name of the
relationship is written inside the diamond-box. All the entities
(rectangles) participating in a relationship, are connected to it by a line.
Many-to-many − The following image reflects that more than one instance
of an entity on the left and more than one instance of an entity on the right
can be associated with the relationship. It depicts many-to-many
relationship.
19
11.Validation:
12.Software Architecture:
What is architecture? Generally speaking, architecture of a system provides a very high level
view of the parts of the system and how they are related to form the whole system. That is,
architecture partitions the system in logical parts such that each part can be comprehended
independently, and then describes the system in terms of these parts and the relationship
between these parts.
2. Reuse :
The software engineering world has, for a long time, been working toward a
discipline where software can be assembled from parts that are developed by
different people and are available for others to use. If one wants to build a
software product in which existing components may be reused, then
architecture becomes the key point at which reuse at the highest level is
decided.
20
4. Analysis :
13.Architecture Views:
In software different drawings are called views or structures.
SOFTWARE STRUCTURES
Some of the most common and useful software structures are :
3 different views / 3 different styles :
1. Module
2. Component and Connector
3. Allocation
21
3. An allocation view focuses on how the different software units are allocated to
resources like the hardware, file systems, and people. That is, an allocation view
specifies the relationship between software elements and elements of the
environments in which the software system is executed. They expose structural
properties like which processes run on which processor, and how the system files are
organized on a file system.
22
Connector:
Connectors define the means of interaction between these components.
A C&C View describes a runtime structure of the system – what components exist
when the system is executing and how they interact during the execution.
23
24
The diagram below shows a simple representation of the pipe and filter architectural style.
In this example we demonstrate how a pizza is made using this style. We are using 5 filters,
with 3 of them working asynchronously. We implement the first few filters to process the raw
ingredients to create the basic elements for the pizza(the vegetables, the sauce, and the
pizza base). When all three of these have been completed, we can assemble them. After it
has been assembled, we can then add the cheese to the pizza, and bake it, before
delivering it to our customer, the sink.
Types of Components
There are two types of components −
A central data structure or data store or data repository, which is
responsible for providing permanent data storage. It represents the
current state.
25
Advantages
Repository Architecture Style has following advantages −
Provides data integrity, backup and restore features.
26
Secondly, despite the fact that one picture is worth a thousand words, information such as
standards and explanation of taken decisions, is hard to present in a picture. In that case we
should use other artefacts e.g., text or code snippets.
Objectives of documentation
Before we eagerly start preparing documentation of architecture, because that is what best
practices say, it is worth considering what the point of doing this is.
We can enumerate a few basic objectives of documentation:
Communication with the client – it can be the basis for presentation of how quality
requirements are going to be fulfilled, and how complex and expensive will be the solution.
Creating a guide for developers – the main purpose will be to create the source of
truth, the reference point for programmers, in case they have any doubts regarding solution
they would like to use.
Team education – good documentation will help to promote information about
changes in the architecture, and will be a good foundation for discussions concerning the
system development.
The primary problem with documentation is the difference between context and content.
Documentation can provide content, but understanding the context requires domain
expertise.
Existing documentation, even if good and valid, must be understood. To achieve this we need
good relations, interactions and cognitive empathy among team members as well as between
the team and the client.
Form of documentation
We all know that the value of diagrams presenting relations and behaviours of architectural
elements is invaluable. However, diagrams aren’t equal, and I don’t mean differences
between class diagrams and sequences diagrams. Some of them are explicit and
understandable, however there are also the ones we look at, and don’t understand what the
author had in mind.
As we all know the most common standard in the industry is UML. However, for many, not
without reason, this standard is too complicated to illustrate the majority of solutions. The
problem is so old and common that at the turn of the century Martin Fowler wrote the guide:
“UML Distilled: A Brief Guide to the Standard Object Modeling Language”. In his book he
describes how to pragmatically use UML. How to use its essence to make our diagrams clear
and understandable, without wasting time on tunning them to make compliant with standard.
To summarize the above deliberation, diagrams documenting the application architecture can
be divided into:
Formal – compatible with standard (usually UML), which makes them explicit. They
are a good choice if we decide to create a complex documentation with the use of CASE
tools. It makes sense, especially if we develop a project of the system with a closed
specification.
Informal – “rectangles and arrows” usually drawn on a piece of paper, whiteboard or
flip chart to illustrate the idea we are talking about, or to back up our thinking processes.
They are highly unclear and without context of people involved in their creation, they may be
more confusing than understood.
Hybrid – a merger of the two mentioned methods, also known as “Arbitrary
Modelling Language” i.e. using 20% of standard to create 80% of uniqueness. Diagrams have
a good value for money spent on creating them. Definitely, it is the best way of creating
documentation to support the above objectives: communication with the client, creating a
guide for developers and education.
16.Evaluating Architectures :
30
UNIT 3
[QUESTIONS]
9.What are Four Levels for analysis when employing use case ?
13.What is Validation.
[or]