Software Engineering Notes
Software Engineering Notes
Software Requirement
IEEE defines a requirement as ::
Client
User
Developer
Problem is that the client usually does not understand s/w or s/w development
process and the developer often does not understand the clients problem and
application areas. This causes a communication gap between the parties involved in
the development project. Basic purpose of SRS is to bridge this communication gap.
SRS is the medium through which the client and user needs are accurately
specified. SRS is helping the client understand their own needs.
in the development project. Basic purpose of SRS is to bridge this communication
gap. SRS is the medium through which the client and user needs are accurately
specified. SRS is helping the client understand their own needs.
Main advantages of SRS
An SRS establishes the basis for agreement between the client and supplier
or what the s/w product will do.
Through SRS the client clearly describes what it expects from supplier
and developer clearly understand what capabilities to build in s/w
An SRS provides a reference for validation of final product. Without a proper
SRS, there is no way a client can determine if the s/w being delivered is what
was ordered and there is no way the developer can convince the client that
the entire requirements have been fulfilled.
High quality SRS is a prerequisite to high quality s/w. Quality of SRS has an
important effect on cost of the project.
A high quality SRS reduce the development cost.
Requirement Process
It is the sequence of activities that need to be performed in the requirement phase
and that culminate in producing a high quality document containing the SRS. The
requirement phase typically consists of 3 basic activities::
Problem analysis starts with some general statement of need or a high level
problem statement. During analysis the problem domain and the environment are
modeled in an effort to understand the system behavior, constraints on the system,
its input and output.
In requirement specification the focus is on clearly specifying the requirements in a
document. Issues, such as representation, specification languages and tools are
addressed during this activity.
Validation focus on what has been specified in the SRS is indeed all the
requirements of the s/w and making sure that the SRS is of good quality.
Problem Analysis
Analysis issues :
Three basic approach to problem analysis::
Informal Approach-> Based on structured communication/interaction
Conceptual Modeling-> Based on approach
Prototyping
Structured Analysis:
Data flow diagram
Data dictionary
Other modeling approach
SADT
PSL/PSA: Problem Statement Language
RSL/REVS: Requirement Statement Language/Requirement Engineering Validation
System
E-R Modeling:
Prototyping::Two approaches to prototyping:
Characteristics of SRS::
Correct
Complete
Unambiguous
Verifiable
Consistent
Ranked for importance and/or stability
Modifiable
Traceable
Components of an SRS
Functionality
Performance
Design constraints imposed on an implementation
External interfaces
Validation
Development of s/w starts with the requirement document which is also used to
determine eventually whether or not the delivered s/w system is acceptable.
Due to nature of the requirement specification phase there is a lot of room for
misunderstanding and committing error and it is quite possible that the
requirements specification does not accurately represent the client needs.
Basic goal of requirement validation activity is to ensure that the SRS reflect the
actual requirements accurately and clearly.
Following errors occur in SRS:
Omission::In these types of error, some user requirements are simple and not
included in the SRS. Omitted requirement may be related to the behavior of
the system and its performance. It directly affects the external completely of
the SRS.
Inconsistency::It can be due to contradiction with the requirement of the
client or with the environment in which the system will operate.
Incorrect Fact::When some fact recorded in the SRS is not correct,
Ambiguity::When there are some requirement that have multiple meaning,
that is, their interpretation is not required.
Waterfall Model
Also referred to as Linear Sequential Model, this is the most common and classic of
life cycle models. It is very simple to understand and use. In this model, each phase
must be completed in it is entirely before the next phase can begin. At the end of
each phase, a review takes place to determine if the project is on right path and
whether or not to continue or discard the project. Unlike the general model, phases
do not overlap in a waterfall model.
This model encompasses the following activity:
System/information engineering and modeling:: S/w is always part of large system
(or business),work begins by establishing requirements for all system elements and
then allocating some subset of these requirements to s/w. This system view is
essential when s/w must interact with other elements such as h/w, people and
databases. System engineering and analysis encompass requirements gathering at
the system level with a small amount of top level design and analysis. Information
engineering encompasses requirements gathering at the strategic business level
and at the business area level.
Requirement
Design
Implementati
on and Unit
testing
Integration
and Software
Testing
Operation
Waterfall Model
S/w requirement analysis::The requirements gathering process is intensified and
focused specially on software. To understand the natures of programs to be built,
the s/w engineer (analyst) must understand the information domain for the s/w as
well as required function, behavior, performance and interface. Requirements are
for both the system and the s/w are documented and reviewed with the customer.
Design:: S/w design is actually a multistep process that focuses on four distinct
attributes of a program: data structure, s/w architecture, interface representations
and procedural (algorithmic ) details. The design translates requirements into a
representation of the s/w that can be assessed for quality before coding begins. Like
requirements, the design is documented and becomes part of s/w configuration.
Code Generation:: The design must be translated into a machine-readable form. The
code generation step performs this task. If design is performed in a detailed
manner, code generation can be accomplished mechanistically.
Testing:: Once code has been generated, program testing begins. The testing
process focuses on the logical internals of the software, ensuring that all the
statements have been tested, and on the functional externals; i.e. conducting tests
to uncover errors and ensure that defined input will produce actual results that
agree with required results.
Advantages
Disadvantages
Prototyping Model
Problems :
that
RAD Model
Works on 4GT
Rapid Application Development (RAD) is an incremental software development process model that
emphasises a very short development cycle.
RAD is used primarily for information systems applications, the RAD approach encompasses
the following phases:
Business modeling
The information flow among business functions is modeled in a way that answers the following
questions:
What information drives the business process?
What information is generated?
Who generates it?
Where does the information go?
Who processes it?
Data modeling
The information flow defined as part of the business modeling phase is refined into a set of data
objects that are needed to support the business. The characteristics (called attributes) of each
object are identified and the relationships between these objects are defined.
Process modeling
The data objects defined in the data-modeling phase are transformed to achieve the information
flow necessary to implement a business function. Processing descriptions are created for adding,
modifying, deleting, or retrieving a data object.
Application generation
RAD assumes the use of the RAD fourth generation techniques and tools like VB, VC++, Delphi
etc rather than creating software using conventional third generation programming languages.
The RAD works to reuse existing program components (when possible) or create reusable
components (when necessary). In all cases, automated tools are used to facilitate construction of
the software.
Testing and turnover
Since the RAD process emphasizes reuse, many of the program components have already been
tested. This minimizes the testing and development time.
If a business application can be modularized so that each major function can be completed within
the development cycle then it is a candidate for the RAD model. In this case, each team can be
assigned a model, which is then integrated to form a whole.
Problems with RAD Model
-
Concurr ent
activities
Outline
description
Specification
Initial
version
Development
Intermediate
versions
Validation
Final
version
Potential problems
Applicability
Incremental Model
Advantages
The highest priority system services tend to receive the most testing.
Disadvantages
Requires early definition of a complete and fully functional system to allow for
the definition of increments
Spiral Model
Typical activites:
Create a design
Review design
Develop code
Inspect code
Test product
Typical activities
o
Advantages
Disadvantages
Time spent for evaluating risks too large for small or low-risk projects
Customer Communication
Planning
Risk Analysis
Engineering
Customer Evaluation
Unlike classical process models that end when software is delivered, the
spiral model can be adapted to apply throughout the life of the computer
software.
Activities in model :
At first level, the focus is on deciding which modules are needed for the
system, the specification of these modules and how the modules should be
interconnected. It is called System Design or Top-Level design
Internal design of the modules or how the specifications of the module can be
satisfied is decided. This design level often called Detailed Design or Logic
Design
Detailed design essentially expands the system design to contain a more detailed
description of the processing logic and data structure so that the design is
sufficiently complete for coding.
Since the detailed design is an extension of system design. System design control
the major structured characteristics of system. System design has a major impact
on testability and modifiability of a system and it impacts its efficiency.
Design Methodology
It is a systematic approach to creating a design by applying a set of
techniques and guidelines. Most design methodologies focus on the system design.
Most current design methodologies essentially offer a net of guidelines that can be
used by the developer to design a system.
The input to the design phase is the specifications for the system to be designed.
The output of the top-level design phase is the architectural design or the system
design for the s/w system to be built. This can be produced with or without design
methodology.
Design can be object oriented or function oriented. In function oriented design, the
design consists of module definition, with each module supporting a functional
abstraction. In object oriented design the module in the design represent data
abstraction.
Purpose of design phase is to specify the components for this transformation
function, so that each component is also a transformation function.
Basic output of the system design phase is the definition of all the major data
structure in the system, all major modules of the system and how the modules
interact with each other.
Design Principles:
Design of a system is correct if a system built according to the design satisfy the
requirement of that system.
Goal during the design phase is to produce correct design. The goal of design phase
is to find the best possible design within the limitations imposed by the
requirements and physical and social environment in which the system will operate.
To evaluate a design, some properties and criteria need to be specified that can be
used for evaluation.
A design should clearly be verifiable, complete and traceable the two most
important properties that concern designers are efficiency and simplicity.
Efficiency of any system is concerned with the proper use of scare resources by the
system. The need for efficiency arises due to cost consideration. In computer
system, the resources that are most often considered for efficiency one processor
type and memory. An efficient system is one that consumes less processor time and
requires less memory.
Simplicity::It is the most important quality criteria for s/w system. Maintenance of
s/w is usually quite expensive. Maintainability of s/w is one of the goals. Design of a
system is one of the most important factors affecting the maintainability of system.
During maintenance, maintainer has a thorough understanding of the different
module of the system, how they are interconnected and how modifying one will
affect the other.
A simple and understandable design will go a long way in making the job of the
maintainer easier.
The principles that can be used in design are the same as those used in problem
analysis. Methods are also similar because in both analysis and design a model is
being constructed.
There are some fundamental differences:
The focus of the management process is on issue like planning a project, estimating
resources and schedule and monitoring the project. For large project, a proper
management process is essential for success.
Phases of management process
The activities in the management process for a project can be grouped broadly in to
3 phases::
Planning::
Project management begins with planning, which is perhaps the single largest
responsibility of the project management. The goal of this phase is to develop a
plan for s/w development following which the objectives of the project can be met
successfully and efficiently. During planning the major activities are::
Cost estimation
Schedule and milestone determination
Project staffing
Quality control plans
Controlling and monitoring plans
In the cost and schedule estimation, the total time needed for successful completion
of the project is estimated. In addition, cost and schedule for the different activities
of the development process to be used are also estimated. A plan also provides
methods for handling change and methods for monitoring a project. Project
planning is undoubtedly the single and most important management activity and
the output of this forms the basis of monitoring and control.
Project monitoring and control phase of the management process is the longest in
terms of duration; it encompasses most of the development process. It includes all
the activities the project, management has to perform while the development is
going on to ensure that project objectives are met and the development proceeds
according to the development plan.
Termination analysis::
Termination analysis is performed when the development process is over. The basic
reason for performing termination analysis is to provide information about the
development process. The data about the project is also needed to analyze the
process. For these reasons, the termination analysis phase is needed.
Role of Metrics and Measurement
Matrix is used for effective project management. Objective data is needed for this
s/w matrix is used. S/w metrics are quantifiable measure and that could be used to
measure different characteristics of a s/w system or the s/w development process. A
number of metrics have been proposed to quantity things like the size, complexity
and reliability of a s/w product. There are two types of metrics are used for s/w
development:
Product metrics
Process metrics
Product metrics are used to quantify characteristic of the project being developed.
Process metrics are used to quantify the characteristics of the process being used to
develop the s/w.
Intricately tied to metrics is measurement. Metrics provide the scale for quantifying
qualities, qualifying characteristics of the given s/w. An analogy in the physical
world and that centimeter is the metric of length, but to determine the length of a
given rod, one must measure it some means like measuring tape. The measurement
methods must be objective and should produce the same result independent of the
measure.
Values for some metrics can be directly measured; others might have to be deduced
by other measurement. If the metrics is not measured directly, it is called metrics
indirect. Some factors like many s/w qualifying parameters cannot be measured
directly. Metrics measures productivity, cost and resource requirement effectiveness
of quality assurance measure. For effective monitoring the management need to get
information about the project.
important role in the maintenance phase. To modify a system, the first step is
to understand what the system does and how. Using abstraction the behavior
of the entire system can be understood. During the design process,
abstraction is used in reverse manner than in the process of understanding a
system.
There are two abstraction mechanisms for s/w systems::
Functional Abstraction:: A module is specified by the function it
performs.
Eg.->A module to compute the log of a value
can be abstractly represented by the function log. Similarly, a module
to sort an input array can be represented by the specification of
sorting. It is the basis of partitioning in function oriented approach.
When the problem is being partitioned, the overall transformation
function for the system is partitioned into smaller function that
comprises the system function.
Data Abstraction:: Operations are required from a data object,
depending on the object and the environment in which it is used.
Requirement
Environmental constraints
Design criteria
Architecture design
Specification
Definitions
Design Objectives/Properties
Design Principles
1. Problem partitioning: large problem can be solved ,the basic principle is
time-tested principle of Divide and Conquer. It can be divided into two
categories:
Horizontal Partitioning
Vertical Partitioning
Horizontal partitioning
It defines separate branches of modular hierarchy for each major
program function.
Software that is easier to test.
Software that is easier to maintain.
Software that is easier to extend.
Propagation of fewer side effects.
Vertical partitioning
Coupling :
Highly Coupled: When the modules are highly dependent on each other
then they are called highly-coupled.
Loosely Coupled:When the modules are depend on each other but the
interconnection among them is weak.
Interface
Type of
Type of
Complexity Connection Communicatio
n
Low
Simple
Obvious
High
Complicated To internal
Obscure
elements
Types of Coupling
To module
by name
Data
Control Hybrid
Data Coupling
Best
Stamp Coupling
Control Coupling
External Coupling
Common Coupling
Content Coupling
(Worst)
Data Coupling: Two modules are data coupled ,if they communicate using
an elementary data item that is passed as a parameter between the two.
Control Coupling: exist between two modules, if data from one module is
used to direct the order of instruction execution in another.
Cohesion
Cohesion is a natural extension of information hiding concept.
Cohesion I s a measure of the relative functional strength of a module.
A cohesive module performs a single task within a software procedure
,requiring little interaction with procedures being performed in other parts of
a program.
A strongly cohesive module implements functionality that is related to one
feature of the solution and requires little or no interaction with other module.
This is shown in diagram.in the next slide..
Cohesion-strength
Types of cohesion
Functional Cohesion
Sequential Cohesion
Communicational Cohesion
Procedural Cohesion
Temporal Cohesion
Best(High)
Logical Cohesion
Coincidental Cohesion
Worst (low)
Functional Cohesion:
It is said to exit if different elements of a module cooperate to achieve a
single function .
FUNCTION A Part 1
FUNCTION A Part 2
FUNCTION A Part 3
Sequential cohesion
A module is said to possess sequential cohesion, if the element of a module
form the parts of a sequence ,where the output from one element of the
sequence is input to the next.
FUNCTION
FUNCTION
FUNCTION
Communicational Cohesion:
All the functions of the module refer to or update the same data structure.
Procedural Cohesion
All the set of function of the module are all part of a procedure in which
certain sequence of steps has to be carried out for achieving an objective.
FUNCTION A
FUNCTION B
FUNCTION C
Temporal Cohesion:
When a module contains functions that are related by the fact that all the
functions must be executed in the same time span is said to be exhibit
temporal cohesion.
TIME
TO
TIME TO+A
TIME TO+2A
Logical cohesion
All elements of the module perform similar operation.
Coincidental Cohesion
It performs a set of task that relate to each other very loosely.
The module contains a random collection of function.
Design Specification :
Human-machine interface
Constraints, limitation
Data design
Interfaces to external/system
Structure
Processing narrative
Interface description
Logical Structure
Modules used
Access method
Global data
Comments
Requirement cross-reference
For Example,
A burglar alarm system is to be implemented for a building. This uses several
different types of sensor. These include movement detectors in individual
rooms, window sensors on ground floor windows, which detect if a window
has been broken, and door sensors, which detects door opening on corridor
doors . There are fifty window sensors, 30 doors sensors and 200 movement
detectors in the system.
Structured Programming:
What are Constructs?
If-Then-Else
SELECTION
REPETITION
The dogmatic use of only the structured constructs can introduce inefficiency
when an escape from a set of nested loop or nested conditions is required
The designer is hence left with two options:
Procedural representation is redesigned so that the escape branch is
not required at a nested location in a flow of control
The structured constructs are violated in a controlled manner ie. A
constrained branch out of the nested flow is designed.
Option 1 is the ideal approach but option 2 can be accommodated without
violating the spirit of structured programming
Box Diagram
It evolved from a desire to develop a procedural design representation that
would not allow violation of the structured constructs.
Also called Nassi-Shneiderman charts, N-S charts or Chapin charts
Characteristics of Box Diagram
Functional domain (ie. the scope of repetition or if-then-else ) is well defined
and clearly visible as a pictorial representation
Arbitrary transfer of control is impossible
If-Then-Else
Repetition
SELECTION
List all actions that can be associated with a specific procedure (or module)
List all conditions (or decision made) during execution of the procedure
Associate specific sets of conditions with specific actions, eliminating
impossible combinations of conditions; alternatively, develop every possible
permutation of conditions
Define rules by indicating what action(s) occurs for a set of conditions
PROGRAM DESIGN LANGUAGE (PDL)
Also called structured English or pseudocode
Is a pidgin language in that it uses the vocabulary of one language (ie.
English) and the overall syntax of another (ie. a structured programming
language)
The PDL is different from a real programming language in the sense that it
uses the narrative text embedded directly within PDL structure
The PDL cannot thus be compiled (not yet)
PDL tools exist to translate PDL into a programming language skeleton
and/or a graphical representation (eg. a flowchart) of design.
These tools also produce nesting maps, a design operation index, cross
reference tables and a variety of other information
COMPARISION OF DESIGN NOTATION
Design notation should lead to a procedural representation that is easy to
understand and review.
The notation should enhance code to ability so that code becomes a natural
by-product of design
Design representation must be easily maintainable so that design always
represents the program correctly
Attributes of Design Notation
Modularity: Design notation should support the development of modular s/w
and provide a means for interface specification
Overall Simplicity: Design notations should be relatively simple to learn,
relatively easy to use and generally easy to learn
Ease of editing: The procedural design may require modification as the s/w
process proceeds. The ease with which a design representation can be edited
can help facilitate each s/w engineering task
Machine Readability: Notation that can be input directly into a computer
based development system offers significant benefits.
Maintainability: S/w maintenance is the most costly phase of the s/w life
cycle. Maintenance of the s/w configuration nearly always means
maintenance of procedural design representation.
Structural Enforcement: Design notations that enforce the use of only the
structured constructs promotes good practice.
Automatic Processing: A procedural design contains information that can
be processed to give designer new or better insights into the correctness and
quality of a design. Such insights can be enhanced with reports provided via
s/w design tools
Data Representation: The ability to represent local and global data is an
essential element of component level design. Ideally, design notation should
represent such data directly.
Logic Verification: Automatic verification of design logic is a goal that is
paramount during s/w testing. Notation that enhances the ability to verify
logic greatly improves testing adequacy.
FOURTH GENERATION TECHNIQUES: 4GT
INTRODUCTION
The term 4Gt encompasses a broad array of s/w tools that have one thing
in common.
Each tool enables the s/w engineer to specify the characteristics of s/w at
high level.
The tool then automatically generates source code based on the
developers specification.
The 4GT paradigm for s/w engineering focuses on the ability to specify s/w
using specialized language forms or a graphic notation that describes the
problem to be solved in terms that the customer can understand.
Code generation of HTML and similar languages used for web-site creation
using advanced s/w tools
ADVANTAGES
The use of 4GT is a viable approach for many different application areas.
Coupled with computer-aided s/w engineering tools and code generators,
4GT offers a credible solution to many s/w problems
Data collected from companies that use 4GT indicate that the time
required to produce s/w is greatly reduced for small and intermediate
applications that the amount of design and analysis for small applications
is also reduced
DISADVANTAGE
The use of 4GT for large s/w development efforts demands as much or
more analysis, design and testing (s/w engineering activities) to achieve
substantial time savings that result from the elimination of coding
Unit-2
(a) What are the primary differences between a model oriented specification
method and a property-oriented specification method?
(b) Enumerate the different types of coupling that might exist between two
modules
(c) What do you understand by layered software design? What are advantages of
layered design?
(d) What do you mean by balancing a DFD? Illustrate your answer with a suitable
example.
(e) What is the significance of Design Reviews? Make a list of items that can be
used as a checklist for carrying out design reviews.
(f) What do you understand by term encapsulation in the context of software
design? How does data abstraction help in reducing the coupling in design
solution?
2007-08
Attempt any 4 parts:
(a) Draw data flow diagram for library management system. Clearly describe the
working of the system.
(b) Describe spiral model in detail. What are the limitations of such a model?
(c) What is software development life cycle? Discuss the generic waterfall model.
(d) List advantages of software requirement specification. Describe the desirable
characteristics of a good software requirement specification.
(e) Explain various types of coupling and define module coupling.
2008-09
Attempt any 2 parts:
(ii)
Software architecture
(ii)