Lecture Notes PDF
Lecture Notes PDF
Lecture Notes PDF
INFS-334
Offered in Level-8, as College Required Course
in [CS | IT & Security | CNET] programs
Compiled by:
Dr. Wali Ullah
Recent Update: 2018-19 (1439-40 H) Spring Semester
Copyright © 2011, 2006, 2005, 2001, 1996 Pearson Education, Inc., publishing as Addison-
Wesley. All rights reserved. Manufactured in the United States of America. This publication is
protected by copyright, and permission should be obtained from the publisher prior to any
prohibited reproduction, storage in retrieval system, or transmission in any form or by any
means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission(s) to
use material from this work, please submit a written request to Pearson Education, Inc.,
Permissions Department, 501 Boylston Street, Suite 900, Boston, Massachusetts 02116.
Many of the designations by manufacturers and seller to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and the publisher was aware of a
trademark claim, the designations have been printed in initial caps or all caps.
Library of Congress Cataloging-in-Publication Data
Somerville, IanSoftware engineering / Ian Sommerville. — 9th edition
ISBN-13: 978-0-13-703515-1
2
Contents at a glance
Chapter Topic Page No
1 Introduction 04-09
2 Software Processes 10-23
3 Requirements Engineering 24-32
4 System Modeling 33-39
5 Architectural Design 40-44
6 Design and Implementation 45-50
7 Software Testing 51-56
8 Software Maintenance 57-63
Course Description
Software engineering is a major branch of computing science that deals with the
development of software systems as practical and cost-effective solutions for individuals
and society. This course covers the fundamentals of software engineering like software
life cycle, requirements engineering, system development paradigm, and system modeling
using UML. It also covers software verification & validation, important implementation
issues, open source development and concepts of software re-engineering. The course has
a strong technical relation with graduation project providing the opportunity to practice
software engineering knowledge, skills, and practices in a realistic development
setting with a real client.
Course Objectives
What is the main purpose for this course?
What is software development life cycle (SDLC)
How to elicit requirements from a client and their classification
How to use graphical models (UML) to represent software systems
What is an architectural design and how to object oriented design processes
What are good coding practices
What are various type of software testing, and where they are used
How to modify a system after delivery
How to draft project plan and SDLC in software documentation.
3
Chapter 1: Introduction
1. Introduction
At the first conference on software engineering in 1968, Fritz Bauer defined software engineering
as “The establishment and use of sound engineering principles in order to obtain economically
developed software that is reliable and works efficiently on real machines”.
Stephen Schach defined the same as “A discipline whose aim is the production of quality
software, software that is delivered on time, within budget, and that satisfies its requirements”.
Both the definitions are popular and acceptable to majority.
However, due to increase in cost of maintaining software, objective is now shifting to produce
quality software that is maintainable, delivered on time, within budget, and also satisfies its
requirements.
A professionally developed software system is often more than a single program. The system
usually consists of a number of separate programs and configuration files that are used to set up
these programs.
It may include system documentation, which describes the structure of the system; user
documentation, which explains how to use the system, and websites for users to download recent
product information.
The management of software development is heavily dependent on four factors: People, Product,
Process, and Project. Order of dependency is as shown in Fig 1.1
Software development is people centric activity. Hence success of project is on the shoulder of the
people who are involved in the development.
4
People: Software development requires good managers. The manager who can understand the
psychology of the people and provide good leadership. After having a good manager, project is in
safe hands. It is the responsibility of a manager to manage, motivate, encourage, guide and control
the people of his/her team.
Fig. 1.1
Product: What is delivered to the customer, is called a product. It may include source code,
specification document, manuals, documentation etc. Basically, it is nothing but a set of
deliverables only.
Process: Process is the way in which we produce software. It is the collection of activities that
leads to (a part of) a product. An efficient process is required to produce good quality products. If
the process is weak, the end product will undoubtedly suffer, but an obsessive over reliance on
process is also dangerous.
Project: A proper planning is required to monitor the status of development and to control the
complexity. Most of the projects are coming late with cost overruns of more than 100%. In order
to manage a successful project, we must understand what can go wrong and how to do it wright.
5
1.3 Software Products:
1.3.1 Generic products:
These systems are produced by a development organization and sold in the open market, and any
customer can buy them according to their need. For example: word processors, web browsers,
drawing packages, and project-management tools. All the mobile applications (apps) that are cab
be downloaded and used from play-stores are examples of generic products.
These are the systems that are developed by a software contractor for a particular customer. For
example: Examples of this type of software include inventory managements system, content
management system, for more relevant examples JUMP system, JU e-register, JU Edugate-Portal.
6
1.5 Importance of Software Engineering Practices:
1. More and more, individuals and society is relying on advanced software systems. Automation
in each and every field of life has become a necessity. To fulfill all these demands software
products are being developed that are reliable and trustworthy to its users.
2. Initial cost for any software development has remained an obstacle in the history but time has
proved that well engineered software products are cheaper in longer run than those software that
are just developed like a personal programming project.
There is no universal software engineering method or technique that can be applied all types of
software products. Due to this reason software engineers have to keep in mind three general issues
that may affect different types of software:
1.6.1 Heterogeneity: Increasingly, systems are required to operate as distributed systems across
networks that include different types of computer and mobile devices. As well as running on
general-purpose computers, software may also have to execute on mobile phones. You often have
to integrate new software with older legacy systems written in different programming languages.
The challenge here is to develop techniques for building dependable software that is flexible
enough to cope with this heterogeneity.
1.6.2 Business and social change: Business and society are changing incredibly quickly as
emerging economies develop and new technologies become available. They need to be able to
change their existing software and to rapidly develop new software.
Many traditional software engineering techniques are time consuming and delivery of new systems
often takes longer than planned. They need to evolve so that the time required for software to
deliver value to its customers is reduced.
1.6.3 Security and trust: As software is intertwined with all aspects of our lives, it is essential
that we can trust that software. This is especially true for remote software systems accessed through
a web page or web service interface. We have to make sure that malicious users cannot attack our
software and that information security is maintained. Of course, these are not independent issues.
7
To address these challenges we will need new tools and techniques as well as innovative ways of
combining and using existing software engineering methods.
Software engineering is a systematic approach that leads the production of software according to
nature of software. This systematic approach varies dramatically depending on type of software
and its users, as well as the people involved in the development process. In forthcoming chapters
we will learn about software engineering practices but in this chapter different types of applications
are discussed that are commonly used in different areas of life.
1.7.1. Stand-alone Applications. These are application systems that run on a local computer, such
as a PC. They include all necessary functionality and do not need to be connected to a network.
Examples of such applications are office applications on a PC, CAD programs, photo manipulation
software, etc.
This class of application also includes business systems, where a business provides access to its
systems through a web browser or special-purpose client program and cloud-based services, such
as mail and photo sharing. Interactive applications often incorporate a large data store that is
accessed and updated in each transaction.
1.7.3 Embedded Control Systems. These are software control systems that control and manage
hardware devices. Numerically, there are probably more embedded systems than any other type of
system. Examples of embedded systems include the software in a mobile (cell) phone, software
that controls anti-lock braking in a car, and software in a microwave oven to control the cooking
process.
1.7.4 Batch Processing Systems. These are business systems that are designed to process data in
large batches. They process large numbers of individual inputs to create corresponding outputs.
Examples of batch systems include periodic billing systems, such as phone billing systems, and
salary payment systems.
8
1.7.5 Entertainment Systems. These are systems that are primarily for personal use and which
are intended to entertain the user. Most of these systems are games of one kind or another. The
quality of the user interaction offered is the most important distinguishing characteristic of
entertainment systems.
1.7.6 Systems for Modeling and Simulation. These are systems that are developed by scientists
and engineers to model physical processes or situations, which include many, separate, interacting
objects. These are often computationally intensive and require high-performance parallel systems
for execution.
1.7.7 Data Collection Systems. These are systems that collect data from their environment using
a set of sensors and send that data to other systems for processing. The software has to interact
with sensors and often is installed in a hostile environment such as inside an engine or in a
remote location.
1.7.8 Systems of Systems. These are systems that are composed of a number of other software
systems. Some of these may be generic software products, such as a spread sheet program. Other
systems in the assembly may be specially written for that environment.
Different deliverables are generated during software development. The examples are sourse code,
user manuals, operating procedure manuals etc.
The milestones are the events that are used to ascertain the status of the project. Finalization of
specification is mile stone. Completion of design document is another milestone. The milestone
are essential for project planning and management.
9
Chapter 2: Software Process
2. Software life Cycle
The goal of Software Engineering is to provide models and processes that lead to the production
of well-documented maintainable software in a manner that is predictable.
In the IEEE standard Glossary of Software Engineering Terminology, the software life cycle is:
The period of time that starts when a software product is conceived and ends when the product is
no longer available for use. The software life cycle typically includes a requirement phase, design
phase, implementation phase, test phase, installation and check out phase, operation and
maintenance phase, and sometimes retirement phase”.
These activities involve the development of software from scratch until it is delivered to customers.
Software process model is a simplified representation of a software process that shows the
activities involved and their sequence. There are many well-defined process models and still latest
research is ongoing to find more and more better models. In each model number of activities and
their arrangement varies but some of the activities are common as given below:
2.1.1 Software Specification: The functionality of the software and constraints on its operation
must be defined.
2.1.2 Software Design and Implementation: The software to meet the specification must be
produced.
2.1.3 Software Validation: The software must be validated to ensure that it does what the
customer wants.
2.1.4 Software Evolution: The software must evolve to meet changing customer needs.
10
effective. In the section we are going to discuss some generic models that are commonly discussed
in books. But in practical life these generic models are not used as it is rather are followed as
abstract models to explain different stages of software development.
System Design: The requirement specifications from first phase are studied in this phase and
system design is prepared. System Design helps in specifying hardware and system
requirements and also helps in defining overall system architecture.
Implementation: With inputs from system design, the system is first developed in small
programs called units, which are integrated in the next phase. Each unit is developed and tested
for its functionality which is referred to as Unit Testing.
Integration and Testing: All the units developed in the implementation phase are integrated
into a system after testing of each unit. Post integration the entire system is tested for any faults
and failures.
Deployment of system: Once the functional and non-functional testing is done, the product is
deployed in the customer environment or released into the market.
Maintenance: There are some issues which come up in the client environment. To fix those
issues patches are released. Also to enhance the product some better versions are released.
Maintenance is done to deliver these changes in the customer environment.
All these phases are cascaded to each other in which progress is seen as flowing steadily
downwards (like a waterfall) through the phases. The next phase is started only after the defined
set of goals are achieved for previous phase and it is signed off, so the name "Waterfall Model".
In this model phases do not overlap.
Ample resources with required expertise are available to support the product
13
Process and results are well Cannot accommodate changing
documented. requirements.
No working software is produced
until late in the life cycle.
Adjusting scope during the life cycle
can end a project
Integration is done as a "big-bang” at
the very end, which doesn't allow
identifying any technological or
business bottleneck or challenges
early.
Incremental model use the linear sequential approach with the iterative nature of prototyping.
The key to successful use of an iterative software development lifecycle is rigorous validation of
requirements, and verification & testing of each version of the software against those requirements
within each cycle of the model. As the software evolves through successive cycles, tests have to
be repeated and extended to verify each version of the software.
A new technology is being used and is being learnt by the development team while working
on the project.
Resources with needed skill set are not available and are planned to be used on contract basis
for specific iterations.
There are some high risk features and goals which may change in the future.
15
The disadvantage with this SDLC model is that it is applicable only to large and bulky software
development projects. This is because it is hard to break a small software system into further small
serviceable increments/modules.
The following table lists out the pros and cons of Iterative and Incremental SDLC Model:
Pros Cons
16
Better suited for large and mission-critical
projects.
During life cycle software is produced
early which facilitates customer evaluation
and feedback.
This approach is based on the existence of a significant number of reusable components. The
system development process focuses on integrating these components into a system rather than
developing them from scratch.
In the majority of software projects, there is some software reuse. This often happens informally
when people working on the project know of designs or code that is similar to what is required.
A general process model for reuse-based development is shown in Fig 2.3. Stages of “requirements
specification” and “system validation” are same as in other models but intermediate stages in this
model are different. They can be explained in detail as below: Component Analysis: After getting
user requirements a search is made for components to be implemented that are available in library
as it is or with small variations. Usually, there is no exact match and already available components
only provide some of the required functionality. Requirements Modification: During this stage,
the requirements are analyzed using information about the components that have been discovered.
They are then modified to reflect the available components. Where modifications are impossible,
the component analysis activity may be re-entered to search for alternative solutions.
17
System Design with Reuse: During this phase, the framework of the system is designed or an
existing framework is reused. The designers take into account the components that are reused and
organize the framework to cater for this. Some new software may have to be designed if reusable
components are not available.
Development and Integration: Software that cannot be externally procured is developed, and the
components and COTS systems are integrated to create the new system. System integration, in this
model, may be part of the development process rather than a separate activity.
A risk-driven software process framework (the spiral model) was proposed by Boehm. Here, the
software process is represented as a spiral, rather than a sequence of activities with some
backtracking from one activity to another. Each loop in the spiral represents a phase of the software
process. Thus, the innermost loop might be concerned with system feasibility, the next loop with
requirements definition, the next loop with system design, and so on. Risks are explicitly assessed
and resolved throughout the process.
Objective setting: Specific objectives for that phase of the projects are defined. Constraints on the
process and the product are identified and a detailed management plan is drawn up. Project risks
are identified. Alternative strategies, depending on these risks, may be planned.
Risk Assessment and Reduction: For each of the identified project risks, a detailed analysis is
carried out. Steps are taken to reduce the risk. For example, if there is a risk that the requirements
are inappropriate, a prototype system may be developed.
Development and Validation: After risk evaluation, a development model for the system is
chosen. For example, throwaway prototyping may be the best development approach if user
interface risks are dominant. If safety risks are the main consideration, development based on
formal transformations may be the most appropriate process, and so on. If the main identified risk
is sub-system integration, the waterfall model may be the best development model to use.
Planning: The project is reviewed and a decision made whether to continue with a further loop of
the spiral. If it is decided to continue, plans are drawn up for the next phase of the project.
19
2.6.2 Spiral Model Pros and Cons
The advantage of spiral lifecycle model is that it allows for elements of the product to be added in
when they become available or known. This assures that there is no conflict with previous
requirements and design. This method is consistent with approaches that have multiple software
builds and releases and allows for making an orderly transition to a maintenance activity. Another
positive aspect is that the spiral model forces early user involvement in the system development
effort. On the other side, it takes very strict management to complete such products and there is a
risk of running the spiral in indefinite loop. So the discipline of change and the extent of taking
change requests is very important to develop and deploy the product successfully.
The following table lists out the pros and cons of Spiral SDLC Model:
Pros Cons
20
2.7 Agile Model
Agile model is a combination of iterative and incremental process models with focus on process
adaptability and customer satisfaction by rapid delivery of working software product.
Agile Methods break the product into small incremental builds. These builds are provided in
iterations. At the end of each iteration a working product is displayed to the customer.
Agile is based on the adaptive software development methods where there is no detailed planning
and there is clarity on future tasks only in respect of what features need to be developed. There is
feature driven development and the team adapts to the changing product requirements
dynamically. The product is tested very frequently, through the release iterations, minimizing the
risk of any major failures in future.
Customer interaction is the backbone of Agile methodology, and open communication with
minimum documentation are the typical features of Agile development environment. The agile
teams work in close collaboration with each other and are most often located in the same
geographical location.
21
2.7.1 Agile Manifesto Principles
Working software: Demo working software is considered the best means of communication with
the customer to understand their requirement, instead of just depending on documentation.
Following table lists out the pros and cons of Agile Model
Pros Cons
22
Minimal rules, documentation easily team can be driven in the wrong
employed. direction.
Enables concurrent development and There is very high individual
delivery within an overall planned dependency, since there is minimum
context. documentation generated.
Little or no planning required. Transfer of technology to new team
Easy to manage. members may be quite challenging due
23
Chapter 3: Requirements Engineering
3. Requirements Engineering
Requirements describe the “what” of a system, not the “how”. Requirements engineering produces
one large document, written in natural language, contains a description of what the system will do
without describing how it will do. The input to the requirements engineering is the problem
statement prepared by the customer.
3.1 Crucial process steps of Requirement Engineering
The quality of a software product is only as god as the process that creates. Requirements
engineering is one of the most crucial activity in this creation process. Without well-written
requirements specifications, developers do not know what to build, customers do not know what
to expect, and there is no way to validate that the built system satisfies the requirements.
The requirements engineering consists of four steps as shown in figure 3.1
Problem Statement
Requirement
elicitation
Requirement
Requirement
analysis
engineering
Requirement
documentation
Requirement
review
SRS
24
1) Requirements elicitation: This is also known as gathering of requirements. Here requirements
are identified with the help of customer and existing systems process if available.
3) Requirements documentations: It is the foundation for the design of the software. The
document is known as software requirements specification (SRS).
4) Requirements review: The. review process is carried out to improve the quality of the SRS
a. Functional Requirements: These are related to the expectations from the intended software.
They describe what the software has to do. They are also called product features. Sometimes,
functional requirements may also specify what the software should not do.
c. Non-functional Classifications
Organizational requirements: These requirements are broad system requirements derived from
policies and procedures in the customer’s organization and developer side. These requirements
include operational requirements that means how the system will be used, development
requirements specify the programming language, whereas environmental requirements specify the
operating environment of the system.
External requirements: These requirements are derived from factors external to the system and
its development process. They include regulatory requirements that mean the features that helps
in approving the system by a regulator, legislative requirements ensure that the system operates
within the law, and ethical requirements ensure that the system will be acceptable to its users and
the general public.
User requirement are written for the users and include functional and non-functional requirement.
User requirements should specify the external behavior of the system with some constraints and
quality parameters.
System requirement are derived from user requirement. They are expanded form of user
requirements.
26
ii. Process metrics: describe the effectiveness and quality of the processes that produce the
Software product. Examples are:
Effort required in the process
Time to produce the product
Effectiveness of defect removal during development
Number of defects found during testing
Maturity of the process
iii. Project metrics: describe the project characteristics and execution. Examples are:
Number of software developers
Staffing pattern over the life cycle of the software
Cost and schedule
Productivity
Attributes Measure
Processed transactions / second
Speed
Screen refresh time
M bytes
Size
Number of ROM chips
Training time
Ease of use
Number of help frames
Mean time to failure
Reliability Probability of unavailability
Rate of failure occurrence
Time to restart after failure
Robustness Percentage of events causing failure
Probability of data corruption on failure
Percentage of target dependent statements
Portability
Number of target systems
27
3.5 Quality Attributes
There are number of quality attributes of software that can serve as requirements.
28
3.6 SRS Document
The SRS is a specification for a particular s/w product, program, or set of programs that performs
certain functions in a specific environment. The SRS serve as contract document between customer
and developer. SRS reduces the probability of the customer being disappointed with the final
product.
Nature of the SRS The basic issues of that SRS writer(s) shall address the following:
1. Functionality
2. External interface
3. Performance
4. Attributes
5. Design constraints imposed on an implementation
29
3.6.1 Organization of the SRS
The Institute of Electrical and Electronics Engineering (IEEE) has published guidelines and
standards to organize an SRS document. Different projects may require their requirements to be
organized differently. It provides different ways of structuring the SRS. The first two sections of
the SRS are the same in all of them.
1. Introduction
1.1 Purpose
1.2 Scope
1.3 Definition, Acronyms and Abbreviations
1.4 References
1.5 Overview
3. Specific Requirements
3.1 External Interfaces
3.2 Functions
30
3.3 Performance Requirements
3.4 Logical Database Requirements
3.5 Design Constraints
3.5.1 Standards Compliance
3.6 Software System Attributes
3.6.1 Reliability
3.6.2 Availability
3.6.3 Security
3.6.4 Maintainability
3.6.5 Portability
5. Document Approvals
6. Supporting Information
31
3.6.2 Problems during Requirements Elicitation
* Stakeholder
The term stakeholder is used to refer to anyone who may have some direct or indirect
influence on the system requirements. Stakeholder includes end-users who will interact
with the system and everyone else is an organization who will be affected by it.
32
Chapter 4: System Modeling
4. 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 now come to mean representing a system using some kind of graphical
notation, which is now almost always based on notations in the Unified Modeling Language
(UML).
• System modelling helps the analyst to understand the functionality of the system and models
are used to communicate with customers.
• Models of the existing system are used during requirements engineering. They help clarify
what the existing system does and can be used as a basis for discussing its strengths and
weaknesses. These then lead to requirements for the new system.
• Models of the new system are used during requirements engineering to help explain the
proposed requirements to other system stakeholders. Engineers use these models to discuss
design proposals and to document the system for implementation.
Use case diagram: that shows the interactions between a system and its environment.
Sequence diagram: that shows interactions between actors and the system and between system
components.
Class diagrams: that shows the object classes in the system and the associations between these
classes.
State diagrams: that shows how the system reacts to internal and external events.
33
4.3 Use of Graphical Models
Context Model: in this model, context diagram and activity diagram is used.
Interaction Model: in this model, use-case diagram and sequence diagram is used.
Structural Model: in this model, class diagram and object diagram is used.
Context model is used to illustrate the operational context of a system - they show what
lies outside the system boundaries.
Social and organisational concerns may affect the decision on where to position system
boundaries.
Architectural models show the system and its relationship with other systems.
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
34
by a filled circle inside another circle. Rectangles with round corners represent activities, that is,
the specific sub-processes that must be carried out. You may include objects in activity charts.
UML activity diagrams are used to define major business process models.
By modeling user interactions with the system helps in identifying user requirements.
By modeling the interaction between components helps in understanding that proposed system
will meet required performance and dependability.
Use cases were developed originally to support requirements elicitation and later incorporated
into the UML diagrams.
Each use case represents a discrete task that involves external interaction with a system.
35
Fig 4.3: Use-case diagram for ATM
Use case diagrams give a fairly simple overview of an interaction so you have to provide more
detail to understand what is involved. This detail can either be a simple textual description, a
structured description in a table, or a sequence diagram.
Sequence diagrams are part of the UML and are used to model the interactions between
the actors and the objects within a system.
A sequence diagram shows the sequence of interactions that take place during a particular
use case or use case instance.
The objects and actors involved are listed along the top of the diagram, with a dotted line
drawn vertically from these.
36
Fig 4.3: Sequence diagram for ATM
Class diagrams are used when developing an object-oriented system to show the
components in a system and relationship between them.
37
Class diagram is an illustration of the relationships and source code dependencies among
classes in the Unified Modeling Language (UML).
Class Diagram Notations: UML class is represented by the diagram shown below that is divided
into three sections.
Second section is used to show the attributes / member variable of the class.
Class Students {
private:
int ID;
char * Name;
public:
void Registration();
};
Types of Relationship between the classes:
In aggregation contained class exist even if main class is deleted. Eg: Car has Engine, If car is
broken still engine exist and can be used in another car.
In composition contained class live or die on the basis of main class. Eg: Folder has file, If you
delete a folder all files will be deleted as well.
38
Generalization: (Is-a Relationship)
Generalization is used in class diagrams to deal with most powerful concept of object orientation
that is Inheritance. Generalization is drawn between two classes to show Parent-Child relation.
In modeling systems, it is often useful to examine the classes in a system to see if there is scope
for generalization. If changes are proposed, then you do not have to look at all classes in the system
to see if they are affected by the change.
The lower-level classes are subclasses that inherit the attributes and operations from their
superclasses. These lower-level classes then add more specific attributes and operations.
39
Chapter 5: Architectural Design
5. Software Architecture
Architectural design means how a system should be organized and designing the overall structure
of that system. According to SDLC architectural design is the first stage in the software design
process. It is the link between actual design and requirements engineering.
Simple, informal block diagrams showing entities and relationships are the most frequently
used method for documenting architectural models.
But in these models do not show the types of relationships between entities and properties of
entities in the model are also not visible.
Requirements for architectural model semantics depend on how the models are used.
40
5.1.2 Use of Architectural Models
Architectural design is a creative process so the process differs depending on the type of system
being developed.
However, a number of common decisions span all design processes and these decisions affect the
non-functional characteristics of the system.
1. Is there a generic application architecture that can act as a template for the system that is being
designed?
5. How will the structural components in the system be decomposed into subcomponents?
6. What strategy will be used to control the operation of the components in the system?
7. What architectural organization is best for delivering the non-functional requirements of the
system?
What views are useful when designing and documenting a system’s architecture?
Each architectural model only shows one view or perspective of the system.
41
It might show how a system is decomposed into modules, how the run-time processes interact
or the different ways in which system components are distributed across a network.
Logical view: that shows the key abstractions in the system as objects or object classes.
Process view: that shows how, at run-time, the system is composed of interacting processes.
Development view: that shows how the software is decomposed for development.
Physical view: that shows the system hardware and how software components are distributed
across the processors in the system.
An architectural pattern is a stylized description of good design practice, which has been tried
and tested in different environments.
Patterns should include information about when they are and when they are not useful.
A generic application architecture is an architecture for a type of software system that may be
configured and adapted to create a system that meets specific requirements.
As a design checklist.
42
As a means of assessing components for reuse.
TPS is a type of information system that collects, stores, modifies and retrieves the data
transactions of an organization. For Example: airline reservation systems, electronic transfer of
funds, bank account processing systems.
Users make asynchronous requests for service which are then processed by a transaction manager.
Transaction processing systems are usually interactive systems in which users make asynchronous
requests for service. (Asynchronous means that you do not halt all other operations while waiting
for the web service call to return.) Fig 5.2 illustrates the conceptual architectural structure of TPS.
First a user makes a request to the system through an I/O processing component. The request is
processed by some application specific logic. A transaction is created and passed to a transaction
manager, which is usually embedded in the database management system. After the transaction
manager has ensured that the transaction is properly completed, it signals to the application that
processing has finished.
43
5.4.4 Application architecture of ATM System
An example of a transaction is a customer request to withdraw money from a bank account using
an ATM. This involves getting details of the customer’s account, checking the balance, modifying
the balance by the amount withdrawn, and sending commands to the ATM to deliver the cash.
Until all of these steps have been completed, the transaction is incomplete and the customer
accounts database is not changed.
44
Chapter 6: Design and Implementation
6. Design and Implementation
Software design and implementation is the stage in SDLC where executable software system is
developed.
Software design and implementation activities are invariably inter-leaved. Software design is a
creative activity in which you identify software components and their relationships, based on a
customer’s requirements. Implementation is the process of realizing the design as a program.
They require a lot of effort for development and maintenance of these models and, for small
systems, this may not be cost-effective.
However, for large systems developed by different groups design models are an important
communication mechanism.
There are a variety of different object-oriented design processes that depend on the organization
using the process.
A system context model is a structural model that demonstrates the other systems in the
environment of the system being developed. (See section 4.3 in chapter 4)
45
An interaction model is a dynamic model that shows how the system interacts with its
environment as it is used. (See section 4.3 in chapter 4)
Software engineering includes all of the activities involved in software development from the
initial requirements of the system through to maintenance and management of the deployed
system. A critical stage of this process is, of course, system implementation, where you create an
executable version of the software.
Some aspects of implementation that are particularly important to software engineering that are
often not covered in programming texts. These are:
Reuse
Configuration management
Host-target development
6.2.1 Reuse
From the 1960s to the 1990s, most new software was developed from scratch, by writing all code
in a high-level programming language.
The only significant reuse or software was the reuse of functions and objects in programming
language libraries.
Costs and schedule pressure mean that this approach became increasingly unviable, especially
for commercial and Internet-based systems.
An approach to development based around the reuse of existing software emerged and is now
generally used for business and scientific software.
The abstraction level: At this level, we don’t reuse software directly but use knowledge of
successful abstractions in the design of your software.
The object level: At this level, we directly reuse objects from a library rather than writing the code
yourself.
47
The component level: Components are collections of objects and object classes that we reuse in
application systems.
Configuration management is the name given to the general process of managing a changing
software system.
The aim of configuration management is to support the system integration process so that all
developers can access the project code and documents in a controlled way, find out what changes
have been made, and compile and link components to create a system.
Version management, where support is provided to keep track of the different versions of
software components. Version management systems include facilities to coordinate
development by several programmers.
System integration, where support is provided to help developers define what versions of
components are used to create each version of a system. This description is then used to build
a system automatically by compiling and linking the required components.
Problem tracking, where support is provided to allow users to report bugs and other problems,
and to allow all developers to see who is working on these problems and when they are fixed.
Most software is developed on one computer (the host), but runs on a separate machine (the target).
In general terms we can say development platform and an execution platform.
It includes the installed operating system plus other supporting software such as a database
management system or, for development platforms, an interactive development environment.
Development platform usually has different installed software than execution platform; these
platforms may have different architectures.
48
6.3 Open Source Development
Open-source software (OSS) is computer software distributed with its source code available for
modification. The software usually includes a license for programmers to change the software in
any way they choose. They can fix bugs, improve functions, or adapt the software to suit their own
needs.
Its roots are in the Free Software Foundation (www.fsf.org), which advocates that source code
should not be proprietary but rather should always be available for users to examine and modify
as they wish.
The best-known open source product is, of course, the Linux operating system which is widely
used as a server system and, increasingly, as a desktop environment.
More and more product companies are using an open source approach to development.
Their business model is not reliant on selling a software product but on selling support for that
product.
They believe that involving the open source community will allow software to be developed
more cheaply, more quickly and will create a community of users for the software.
49
6.3.3 Open Source Licensing
Legally, the developer of the code (either a company or an individual) still owns the code.
They can place restrictions on how it is used by including legally binding conditions in an open
source software license.
Some open source developers believe that if an open source component is used to develop a
new system, then that system should also be open source.
Others are willing to allow their code to be used without this restriction. The developed systems
may be proprietary and sold as closed source systems.
50
Chapter 7: Software Testing
7 Software Testing
Testing is the process of executing a program with the intent of finding errors.
Testing assure to the developer and the customer that the software meets its requirements.
o For custom software (be-spoke products) there should be at least one test case for every
requirement.
o For generic software products there should be tests for all of the system features, plus
combinations of these features, that will be incorporated in the product release.
It discovers the situations where behavior of the software is incorrect, undesirable or does not
match to its specification.
Testing identifies undesirable system behavior such as system crashes, unwanted interactions
with other systems, incorrect computations and data corruption.
51
bits. We have also not considered invalid inputs where so many combinations are possible. Hence,
complete testing is just not possible, although, we may wish to do so.
A strategy should develop test cases for the testing of small portion of program and also test cases
for complete system or function.
Verification is the process of evaluating a system or component to determine whether the products
of a given development phase satisfy the conditions imposed at the start of that phase.
Validation is the process of evaluating a system or component during or at the end of development
process to determine whether it satisfies the specified requirements.
Development testing
Release testing
User testing
Development testing includes all testing activities that are carried out by the development team.
One of the popular development testing techniques is White Box Testing (WBT) that can be
applied at the unit, integration and system levels of the testing process. (WBT is discussed
separately in section 7.5)
Unit testing: where individual program units or object classes are tested. Unit testing should
focus on testing the functionality of objects or methods.
Component testing: where several individual units are integrated to create composite
components. Component testing should focus on testing component interfaces.
System testing: where some or all of the components in a system are integrated and the system
is tested as a whole. System testing should focus on testing component interactions.
52
7.3.2 Release testing
Release testing is the process of testing a particular release of a system that is intended for use
outside of the development team.
The primary goal of the release testing process is to convince the supplier of the system that it is
good enough for use.
Release testing shows that the system delivers its specified functionality, performance and
dependability, and that it does not fail during normal use.
Release testing is usually a Black Box Testing (BBT) process where tests are only derived from
the system specification. (BBT is discussed separately in section 7.4)
User or customer testing is a stage in the testing process in which users or customers provide input
and advice on system testing.
User testing is essential, even when comprehensive system and release testing have been carried
out.
The reason for this is that influences from the user’s working environment have a major effect on
the reliability, performance, usability and robustness of a system. These cannot be replicated in a
testing environment.
Alpha testing: Users of the software work with the development team to test the software at the
developer’s site.
Beta testing: A release of the software is made available to users to allow them to experiment and
to raise problems that they discover with the system developers.
Acceptance testing: Customers test a system to decide whether or not it is ready to be accepted
from the system developers and deployed in the customer environment, especially for custom (be-
spoke) products.
53
7.4 Black Box Testing (BBT)
Black-box testing, also called behavioral testing, focuses on the functional requirements of the
software. BBT enables the software engineer to derive sets of input conditions that will fully
exercise all functional requirements for a program. As shown in Fig7.2 BBT is concerned only
with the possible inputs and their desired output regardless of the developmental details. BBT is
performed by a separate testing team not the developer their self hence it is one type of release
testing.
There are further many types of BBT but two of the most commonly used types are as follows:
Equivalence Partitioning
Boundary Value Analysis
7.4.1 Equivalence Partitioning
Equivalence partitioning is a black-box testing method that divides the input domain of a program
into classes of data from which test cases can be derived.
Examples: If a code of calculator has to test using BBT then possible partitioning of input test
data are:
54
7.4.2 Boundary Value Analysis
Boundary value analysis enhances the performance of equivalence partitioning because it leads to
the selection of test cases at the "edges" of the class.
Examples: In boundary value analysis testing test cases are generated as shown in Fig 7.3
Guarantee that all independent paths within a module have been exercised at least once.
Exercise all logical decisions on their true and false sides
Execute all loops at their boundaries and within their operational bounds
Exercise internal data structures to ensure their validity.
WBT can be applied at any level of development testing. (see section 7.3.1) In WBT first of all
procedure is converted into descriptive code and then using the three methods correctness of the
program code can be assured.
1. The number of regions of the flow graph corresponds to the cyclomatic complexity.
55
Descriptive Code:
x = 10
1
y = 10 2
while (y <= 100)
3 y=y+x
if (y <= 50) 4
print (“small”) 5
else
print (“big”) 6
end-if 7
end-while 8
Flow Graph:
1. Possible Paths
1-2-3-4-5-7-8
1-2-3-4-6-7-8
1-2-8
Total Number = 3
V(G) = 9 - 8 + 2 = 3
and node-4.
V(G) = 2 + 1 = 3
As all three methods give same result it means there is no problem in the logic of procedure.
56
Chapter 8: Software Maintenance
8. Software maintenance
The term is mostly used for changing custom software. Generic software products are said to
evolve to create new versions.
Maintenance does not normally involve major changes to the system’s architecture.
Changes are implemented by modifying existing components and adding new components to the
system.
Coding errors are usually relatively cheap to correct; design errors are more expensive as they may
involve rewriting several program components.
Requirements errors are the most expensive to repair because of the extensive system redesign
which may be necessary.
57
8.2.2 Environmental adaptation
This type of maintenance is required when some aspect of the system’s environment such as the
hardware, the platform operating system, or other support software changes. The application
system must be modified to adapt it to cope with these environmental changes.
This type of maintenance is necessary when the system requirements change in response to
organizational or business change. The scale of the changes required to the software is often much
greater than for the other types of maintenance.
59
8.4 Maintenance costs
Usually greater than development costs (2* to 100* depending on the application).
Ageing software can have high support costs (e.g. old languages, compilers etc.).
Team stability: Maintenance costs are reduced if the same staff are involved with them for some
time.
Staff skills: Maintenance staffs are often inexperienced and have limited domain knowledge.
Program age and structure: As programs age, their structure is degraded and they become harder
to understand and change.
Change acceptance depends on the maintainability of the components affected by the change.
Maintenance costs depend on the number of changes and costs of change depend on
maintainability.
60
Fig 8.2: Maintenance Prediction
Reduced risk: There is a high risk in new software development. There may be development
problems, staffing problems and specification problems.
Reduced cost: The cost of re-engineering is often significantly less than the costs of developing
new software.
62
8.6.3 Reengineering cost factors
63