0% found this document useful (0 votes)
51 views204 pages

Software Engineering With UML

Uploaded by

Whatsapp stuts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views204 pages

Software Engineering With UML

Uploaded by

Whatsapp stuts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 204

SOFTWARE ENGINEERING

WITH UML

(FOR PRIVATE CIRCULATION ONLY)


2022
PROGRAMME COORDINATOR
Prof. Ankita Mendiratta

COURSE DESIGN AND REVIEW COMMITTEE


Mr. Atul Kahate Prof. Ankita Mendiratta
Ms. Jaai Kondhalkare Ms. Pradnya Purandare
Mr. Dimakh Sahasrabuddhe Ms. Vidya Kumbhar
Prof. Shabana Inamdar Ms. Prerna Patil

COURSE WRITERS
Mr. Sachin Naik Prof. Nidhi Khare
Prof. Sonali Karale

EDITOR
Mr. Yogesh Bhosle

Published by Symbiosis Centre for Distance Learning (SCDL), Pune


July, 2014 (Revision 01, 2022)

Copyright © 2022 Symbiosis Open Education Society


All rights reserved. No part of this book may be reproduced, transmitted or utilised in any form or by any
means, electronic or mechanical, including photocopying, recording or by any information storage or retrieval
system without written permission from the publisher.

Acknowledgement
Every attempt has been made to trace the copyright holders of materials reproduced in this book. Should any
infringement have occurred, SCDL apologises for the same and will be pleased to make necessary corrections
in future editions of this book.
PREFACE

Software Engineering is becoming an established discipline separate from computer science and
computer engineering. In software engineering, the Unified Modeling Language (UML) is a non-
proprietary specification language for object modeling. UML is a general-purpose modeling language
that includes a standardized graphical notation used to create an abstract model of a system, referred
to as a UML model. It is extendable as it offers a profile mechanism for customization.

The Unified Modeling Language (UML) is a general-purpose modeling language in the field
of software engineering, which is designed to provide a standard way to visualize the design of a
system. Software Engineering with UML will help the learners to understand what constitutes a
good requirement; they can apply fundamental design principles, can use UML properly and can
translate requirements and design into good quality programs and can effectively test those programs.

This SLM will help you to understand Software Engineering concepts with UML. It will also help
the learners to understand and implement the concepts studied in the various units.

Mr. Sachin Naik

Prof. Nidhi Khare

Prof. Sonali Karale

iii
ABOUT THE AUTHORS

Mr. Sachin Naik has completed his M.Sc. in Computer Science and is pursuing his Ph.D. He has more
than 11 years of experience in teaching at various management institutes at Post Graduate level. He
had received various awards and had published various research papers in National and International
Journals and conferences.

Prof. Nidhi Khare has a rich experience of 15 years in Academics, Industry as well as Corporate
Training. She has also headed the Computer Department of a college during her Academics career.
Along with Masters in Computer Applications, she has Certifications in Advanced Computing and Office
Automation to her credit. She has published various papers in National and International conferences.

Prof. Sonali Karale has completed her Masters in Computer Applications and is pursuing her Ph.D.
She has rich experience in teaching at Post Graduate level. She has published various research papers
in National Conferences. Currently, she is the Faculty of Information Technology at SCDL.

iv
CONTENTS

Unit No. TITLE Page No.


1 Introduction to Software Process Models 1 - 26
1.1 Introduction
1.2 The Evolving Role of Software
1.3 Software Myths
1.4 Software Engineering – Layered Technology
1.4.1 Generic View of Software Engineering
1.5 Software Process Models
1.5.1 Waterfall Model
1.5.2 Incremental Process Model
1.5.3 Evolutionary Software Process Model
1.5.4 Rapid Application Development (RAD) Model
1.6 Agile Computing
1.6.1 Extreme Programming
1.7 Component-Based Development
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
2 Software Project Planning and Estimation 27 - 52
2.1 Introduction
2.2 Software Scope
2.2.1 Types of Scope
2.3 Software Project Estimation
2.3.1 Metrics for Software Quality
2.3.2 Halstead’s Software Science
2.3.3 McCabe’s Complexity Metric
2.4 Metrics in Project Estimation
2.4.1 Size Projection
2.4.2 Productivity Projection
2.5 Cost Estimation
2.5.1 Decomposition
2.5.2 Effort Estimation
2.5.3 Expert Judgement
2.5.4 Estimation by Analogy
2.5.5 Cost Estimation Tools
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

v
Unit No. TITLE Page No.
3 System Engineering and Business Process Engineering 53 - 68
3.1 Introduction
3.2 Computer-Based Systems
3.3 The System Engineering Hierarchy
3.3.1 Business Process Engineering
3.4 Product Engineering
3.5 Requirements Engineering
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
4 System Modelling and UML - I 69 - 102
4.1 Introduction
4.2 System Modelling and Analysis
4.3 UML and UML Use Case-Driven Object-Oriented Analysis
4.3.1 Unified Modelling Language (UML)
4.3.2 UML Use Case-Driven Object-Oriented Analysis
4.3.3 Use-Case Diagram Components
4.3.4 Use Cases for Testing and Validation
4.4 Static Modelling using Class Diagram
4.4.1 Class Diagram
4.4.2 Relationships
4.5 Activity Diagram
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
5 System Modelling and UML - II 103 - 132
5.1 Introduction
5.2 Sequence Diagram
5.3 Collaboration Diagram or Communication Diagram
5.4 State Chart Diagram
5.5 Component Diagram
5.6 Deployment Diagram
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

vi
Unit No. TITLE Page No.
6 Design Concepts and Principles 133 - 146
6.1 Introduction
6.2 Design Process
6.3 Design Principles
6.4 Design Concepts
6.5 Design Heuristics for Effective Modularity
6.6 Design Model
6.7 Design Documentation
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
7 Architectural Design 147 – 164
7.1 Introduction
7.2 Software Architecture
7.3 Data Design
7.4 Architectural Styles
7.5 Mapping Requirements in Software Architecture
7.5.1 Transform Mapping
7.5.2 Transaction Mapping
7.6 Refining Architectural Design
7.7 User Interface Design (UID)
7.7.1 The Golden Rules of User Interface Design
7.7.2 Task Analysis and Modelling
7.7.3 Interface Design Activities
7.7.4 Design Evaluation
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

vii
Unit No. TITLE Page No.
8 Software Testing Techniques 165 – 182
8.1 Introduction
8.2 Software Testing Fundamentals
8.3 Test Case Design
8.4 Testing Principles
8.5 White-Box Testing
8.5.1 Basis Path Testing
8.5.2 Control Structure Testing
8.6 Black-Box Testing
8.7 Software Testing Strategies
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
9 Software Configuration Management 183 – 196
9.1 Introduction
9.2 Software Configuration Management: Concept
9.3 Elements of Configuration Management System
9.4 The SCM Repository
9.5 SCM Process and Tasks
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

viii
Introduction to Software Process Models
UNIT

1
Structure:

1.1 Introduction
1.2 The Evolving Role of Software
1.3 Software Myths
1.4 Software Engineering – Layered Technology
1.4.1 Generic View of Software Engineering
1.5 Software Process Models
1.5.1 Waterfall Model
1.5.2 Incremental Process Model
1.5.3 Evolutionary Software Process Model
1.5.4 Rapid Application Development (RAD) Model
1.6 Agile Computing
1.6.1 Extreme Programming
1.7 Component-Based Development
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

Introduction to Software Process Models 1


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Analyse the various software myths
----------------------
• Explain the layered technology of software
---------------------- • Discuss the various software process models
----------------------

---------------------- 1.1 INTRODUCTION


---------------------- The software process models are an abstract representation of a software
process. It presents a description of a process from some particular perspective
---------------------- such as the specification, design, validation and evolution, wherein, the
development constraints, production of software systems, checking of software
----------------------
as per customers’ demands and changing the software in response to changing
---------------------- demand are considered. In this unit, we will be focusing on the evolutionary
role of software and the different software process models.
----------------------
Software process refers to the methods of developing software. In other
---------------------- words it can be also said that the process that deals with the technical and
management issues of software development is called a software process
----------------------

----------------------
1.2 THE EVOLVING ROLE OF SOFTWARE

---------------------- Nowadays, software takes on a dual role. It is a product and, at the


same time, the vehicle for delivering a product. As a product, it delivers the
---------------------- computing potential embodied by computer hardware or, more broadly, a
network of computers that are accessible by local hardware. Whether it resides
---------------------- within a cellular phone or operates inside a mainframe computer, software
is information transformer – producing, managing, acquiring, modifying,
----------------------
displaying, or transmitting information that can be as simple as a single bit or as
---------------------- complex as a multimedia presentation.
As any vehicle is used to deliver the product, software acts as the basis
----------------------
for the control of the computer (operating systems), the communication of
---------------------- information (networks), and the creation and control of other programs (software
tools and environments). Software delivers the most important product of our
---------------------- time – information.
---------------------- Software transforms personal data (e.g., an individual’s financial
transactions) so that the data can be more useful in a local context; it manages
---------------------- business information to enhance competitiveness; it provides a gateway to
worldwide information networks (e.g., Internet) and provides the means for
---------------------- acquiring information in all of its forms.
---------------------- The role of computer software has undergone significant change over a
time span of little more than 50 years. Dramatic improvements in hardware
---------------------- performance, profound changes in computing architectures, vast increases in

2 Software Engineering with UML


memory and storage capacity, and a wide variety of exotic input and output options Notes
have all precipitated more sophisticated and complex computer-based systems.
The programmers of an earlier era has been replaced by a team of software ----------------------
specialists, each focusing on one part of the technology required to deliver a
complex application. ----------------------

----------------------
1.3    SOFTWARE MYTHS
----------------------
Myth is defined as “widely held but false notation” by the Oxford
Dictionary. So as in other fields, the software arena also has some myths to ----------------------
demystify. Roger Pressman insists “Software myths - beliefs about software
----------------------
and the process used to build it - can be traced to earliest days of computing.
Myths have a number of attributes that have made them insidious.” ----------------------
So, software myths prevail. But though they do, they are not clearly ----------------------
visible and have the potential to harm all the parties involved in the software
development process, mainly the developer team. Tom DeMarco says, “in the ----------------------
absence of meaningful standards, a new industry like software comes to depend
instead on folklore.” The given statement points out that the software industry ----------------------
caught pace just some decades back, so it has not matured to a formidable ----------------------
level and there are no strict standards in software development. There does not
exist one best method of software development that ultimately equates to the ----------------------
ubiquitous software myths.
----------------------
Primarily, there are three types of software myths, all the three are stated
below: ----------------------
1. Management myth ----------------------
2. Customer myth
----------------------
3. Practitioner/Developer myth. Before defining the above three myths one
by one, let’s scrutinise why these myths occur on the first place. ----------------------
So the problem understanding, i.e., requirement analysis must be done properly ----------------------
to avoid any problems in later stages as it will have devastating effects.
Management Myths ----------------------

Managers with software responsibility, like managers in most disciplines, ----------------------


are often under pressure to maintain budgets, keep schedules from slipping,
and improve quality. Like a drowning person who grasps at a straw, a software ----------------------
manager often grasps at the belief in a software myth, if those beliefs will lessen ----------------------
the pressure (even temporarily). Some common managerial myths stated by
Roger Pressman include: ----------------------
i. We have standards and procedures for building software, so developers ----------------------
have everything they need to know.
----------------------
ii. We have state-of-the-art software development tools; after all, we buy the
latest computers. ----------------------
iii. If we’re behind schedule, we can add more programmers to catch up.
----------------------

Introduction to Software Process Models 3


Notes iv. A good manger can manage any project.
The managers completely ignore the fact that they are working on
----------------------
something intangible but very important to the clients, which invites more
---------------------- trouble than solution. So a software project manager must have worked well
with the software development process analysing the minute deals associated
---------------------- with the field, learning the nitty-gritty and the tips and tricks of the trade. The
realities are self-understood as it is already stated how complex the software
----------------------
development process is.
---------------------- Customer Myths
---------------------- A customer who requests computer software may be a person at the next
desk, a technical group down the hall, the marketing/sales department, or an
---------------------- outside company that has requested software under contract. In many cases, the
customer believes in the myths about software because software managers and
----------------------
practitioners do little to correct misinformation. Myths lead to false expectations
---------------------- (by the customer) and, ultimately, dissatisfaction with the developer.

---------------------- Commonly held myths by the clients are:


i. A general statement of objectives is sufficient to begin writing programs
---------------------- - we can fill in the details later.
---------------------- ii. 
Requirement changes are easy to accommodate because software is
flexible.
----------------------
iii. I know what my problem is; therefore, I know how to solve it. This
---------------------- primarily is seen evidently because the clients do not have a first-hand
experience in software development and they think that it’s an easy
----------------------
process.
---------------------- Practitioner/ Developer Myths
---------------------- Myths that are still believed by software practitioners have been fostered
by over 50 years of programming culture. During the early days of software,
---------------------- programming was viewed as an art form. Old ways and attitudes die hard. A
---------------------- malpractice seen in developers is that they think they know everything and
neglect the peculiarity of each problem.
---------------------- i. If I miss something now, I can fix it later.
---------------------- ii. Once the program is written and running, my job is done.
---------------------- iii. Until a program is running, there’s no way of assessing its quality.
iv. The only deliverable for a software project is a working program. Every
----------------------
developer should try to get all relevant requirement detail to effectively
---------------------- design and code the system.
Some misplaced assumptions that intensify the myths are listed below:
----------------------
i. All requirements can be pre-specified.
----------------------
ii. Users are experts at specifying their needs.
----------------------

4 Software Engineering with UML


iii. Users and developers are both good at visualisation Notes
iv. The project team is capable of unambiguous communication.
----------------------
On the whole, realities are always different from the myths. So the myths
must be demystified and work should be based on systematic, scientific and ----------------------
logical bases rather than on the irrational myths. The systemic view must be
----------------------
considered to determine the success of any software project. It’s not only a
matter of hard skills, but soft skills of the developer team also matter to come ----------------------
up with an efficient system.
----------------------
Check your Progress 1 ----------------------
Fill in the blanks. ----------------------
1. There are three types of software myths; these are ___________, ----------------------
___________ and __________.
2. Myths lead to _________expectations. ----------------------

----------------------
1.4 SOFTWARE ENGINEERING – LAYERED TECHNOLOGY ----------------------

Software engineering is a layered technology. Most engineering approaches ----------------------


(including software engineering) must rest on an organisational commitment to
quality. The different layers are discussed below. ----------------------

i. Quality: A product should meet its specification. This is problematical ----------------------


for software systems. There is a tension between customer quality
----------------------
requirements (efficiency, reliability, etc.), developer quality requirements
(maintainability, reusability, etc.), users (usability, efficiency, etc.), etc. ----------------------
But note that:
----------------------
−  ome quality requirements are difficult to specify in an unambiguous
S
way. ----------------------
−  oftware specifications are usually incomplete and often
S
----------------------
inconsistent.
ii. Process: The foundation for software engineering is the process’ layer. ----------------------
Software engineering process is the glue that holds the technology ----------------------
together and enables rational and timely development of computer
software. The work products are produced, milestones are established, ----------------------
quality is ensured, and changes are properly managed.
----------------------
iii. Methods: Software engineering methods provide the technical view for
building software. Methods encompass a broad array of tasks that include ----------------------
the requirements analysis, design, program construction, testing and
support. ----------------------

iv. Tools: Software engineering tools provide automated or semi-automated ----------------------


support for the process and the methods. The tools are integrated so that
----------------------

Introduction to Software Process Models 5


Notes the information created by one tool can be used by another. There is a
system for the support of software development, called Computer-Aided
---------------------- Software Engineering (CASE). CASE combines software, hardware and
software engineering database.
----------------------

----------------------

----------------------

----------------------
Fig 1.1 Software Engineering Layers
----------------------
1.4.1 Generic View of Software Engineering
----------------------
Engineering is the analysis, design, construction, verification and management
---------------------- of technical entities. Regardless of entities to be engineered, the following
questions must be asked and answered:
----------------------
• What is the problem to be solved?
---------------------- • What characteristics of entity are used to solve the problem?
---------------------- • How will the entity (and the solution) be realised?
---------------------- • How will the entity be constructed?
•  hat approach will be used to uncover the errors that were made in the
W
----------------------
design and construction of the entity?
---------------------- •  ow will the entity be supported over the long term, when the corrections,
H
---------------------- adaptations and enhancements are requested by the user of the entity?
Software is engineered by applying three distinct phases that focus on definition,
---------------------- development, and support.
---------------------- i. The definition phase focuses on what.
---------------------- ii. The development phase focuses on how.
iii. The support phase focuses on change. The changes are due to enhancements
----------------------
by changing customer requirements. The support phase reapplies the
---------------------- steps of definition and development phases. Four types of change are
encountered during the support phase:
----------------------
• Correction
---------------------- • Adaptation
---------------------- • Enhancement
---------------------- • Prevention

----------------------

----------------------

----------------------

6 Software Engineering with UML


Notes
Check your Progress 2
----------------------
State True or False.
----------------------
1. Software engineering is not a layered technology
----------------------
2. The foundation of software engineering is the quality layer.
3. Software engineering tools provide automated or semi-automated ----------------------
support for the process and the methods.
----------------------
4. Engineering is the analysis, design, construction, verification and
management of technical entities. ----------------------
5. The support phase focusses on change. ----------------------

----------------------
1.5 SOFTWARE PROCESS MODELS
----------------------
To develop a system, we need to go through a series of steps that is a road
----------------------
map which helps to build a system. The series of steps we follow forms a process.
So, a software process contains a set of activities and associated results which ----------------------
lead to software development. Some of the activities common to all software
are software process specification, which contains initiation and requirements, ----------------------
software design and specification, software testing and quality assurance and
----------------------
software maintenance. A software process model is a representation of software.
A generic process framework of software engineering involves generic ----------------------
major activities. These are: communication, planning, modelling, construction ----------------------
and deployment. In addition to these, project management, risk management,
quality assurance, change management are applied throughout the process. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig 1.2 Major Activities Of A Generic Process Model ----------------------
A linear process flow executes these activities in sequence. It begins with
communication and ends with deployment. An iterative process flow repeats ----------------------

Introduction to Software Process Models 7


Notes one or more activities before going to the next activity. A parallel process flow
executes one or more activities in parallel.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig 1.3


Descriptive Model:
----------------------
A descriptive process model describes what has happened in a software
---------------------- development . It describes the history of how a particular software system was
developed, defined as, “a model that describes ‘what to do’ according to a
---------------------- certain software process system. It may be used as the basis for understanding
---------------------- and improving software development process or for building empirically
(practical) grounded prescriptive models.. It is often developed as the result of
---------------------- a investigation and analysis
---------------------- Prescriptive Model:
A prescriptive model describes what should be done during software
----------------------
development, including responses to error situations.” Describes how a new
---------------------- software system should be developed. Used as a guidelines to organize and
structure how software development activities should be performed and in
---------------------- which order.
---------------------- All these process models involve generic activities mentioned above,
with different weight to these activities and each defines a process flow that
---------------------- executes each framework activity in a different manner. These activities are
linear, incremental or evolutionary.
----------------------
1.5.1 Waterfall Model
----------------------
This is also called the “Classic Life Cycle”. It suggests a systematic
---------------------- sequential approach to software development that begins at the system level
and progresses through analysis, design, coding and maintenance.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

8 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 1.4: The Waterfall Model
----------------------
Modelled after the conventional engineering cycle, the linear sequential model
encompasses the following activities: ----------------------
i. System/Information engineering and analysis: System engineering and
----------------------
analysis includes gathering requirement at the system level with small
amount of top-level analysis and design, as any software is always a part ----------------------
of a large system or business.
----------------------
ii. Software requirements analysis: The requirement gathering process
is intensified and focused specially on software. The requirements are ----------------------
documented and reviewed with the customer.
----------------------
iii. Design: Software design focuses on four distinct attributes of a
program – data structure, software architecture, interface representation ----------------------
and procedural or algorithmic details. The design process translates
requirements into representation of the software that can be assessed for ----------------------
quality before coding. ----------------------
iv. Code generation: The design must be translated into a machine-readable
form by the code generation process. ----------------------

v. Testing: Once the codes are generated, program testing begins and focuses ----------------------
on the logical internals of the software, assuring that all statements have
----------------------
been tested and on the functional externals.
vi. Maintenance: Software will undergo many changes after it is delivered ----------------------
to the customer because of the errors that have been encountered.
----------------------
Some of the limitations of this model are as follows:
----------------------
•  s it follows the sequential flow, the real projects rarely follow. It does not
A
directly support iteration. If any changes occur, it can cause confusion. ----------------------

Introduction to Software Process Models 9


Notes • I t is difficult for customers to provide explicitly all the requirements at the
beginning.
----------------------
•  ll the activities are executed sequentially, so the final version will be
A
---------------------- obtained only at the end of deployment activity. The customer must have
patience.
----------------------
1.5.2 Incremental Process Model
---------------------- The incremental model delivers a series of releases called increments that
provide progressively more functionality for the customer as each increment
----------------------
is delivered. Sometimes there is a situation in which the initial software
---------------------- requirements are well defined, but the overall scope of the development effort
a linear process. In this, multiple deliverables are identified. This model is
---------------------- iterative in nature, and delivers an operational product at each increment. It
delivers the needed functionality earlier than complete operational product.
----------------------
For example, a word-processing software developed using the incremental
---------------------- paradigm might deliver basic file management, editing and document
---------------------- production functions in the first increment and more sophisticated editing
and document production capabilities in the second increment, spelling and
---------------------- grammar checking in the third increment and advanced page layout capability
in the fourth increment.
----------------------
In this, the first increment delivers a core product. This is the outcome
---------------------- of basic requirements gathered from customers, but many supplementary
features may be undelivered. The core product used by the customer goes under
---------------------- evaluation and as a result a plan is developed for the next increment. The next
---------------------- increment can better address the customer needs with delivery of better features
and functionality. This is repeated until the complete product is produced.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 1.5: The Incremental Model
---------------------- The product is decomposed into a number of components, each of which
---------------------- are designed and built separately (called builds). Each component is delivered
to the client when it is complete. This allows partial utilisation of product and
---------------------- avoids a long development time. It also creates a large initial capital outlay with

10 Software Engineering with UML


the subsequent long wait avoided. This model of development also helps ease Notes
the effect of introducing completely new system all at once.
----------------------
Advantages
i. After each iteration, regression testing should be conducted. During this ----------------------
testing, faulty elements of the software can be quickly identified because
----------------------
few changes are made within any single iteration.
ii. It is generally easier to test and debug than other methods of software ----------------------
development because relatively smaller changes are made during each
----------------------
iteration. This allows for more targeted and rigorous testing of each
element within the overall product. ----------------------
iii. Customer can respond to features and review the product for any needful ----------------------
changes.
iv. Initial product delivery is faster and costs lower. ----------------------

Disadvantages ----------------------
i. Resulting cost may exceed the cost of the organisation. ----------------------
ii. As additional functionality is added to the product, problems may arise
----------------------
related to system architecture which were not evident in earlier prototypes.
1.5.3 Evolutionary Software Process Model ----------------------
Evolutionary models are iterative. Prototyping model and spiral model are the ----------------------
examples of evolutionary model.
----------------------
i. Prototyping Model
----------------------
This is an evolutionary model. For complex systems, software evolves over
a period of time. Business or product requirement changes over a period ----------------------
of time as the development progress. Prototyping follows an evolutionary
and iterative approach. This is specifically used when requirements are ----------------------
not well understood. It serves as a technique for identifying software
----------------------
requirements. It focuses on those aspects of the software that are visible
to the user. Feedback is used to refine prototype. ----------------------
A prototype is a working model that is functionally equivalent to a
----------------------
component of the product. In many instances, the client only has a
general view of what is expected from the software product. In such a ----------------------
scenario, where there is an absence of detailed information regarding the
input to the system, the processing needs and the output requirements, the ----------------------
prototyping model may be employed.
----------------------
This model reflects an attempt to increase the flexibility of the development
process by allowing the client to interact and experiment with a working ----------------------
representation of the product. The developmental process only continues
----------------------
once the client is satisfied with the functioning of the prototype. At that
stage, the developer determines the specifications of the client’s real ----------------------
needs.
----------------------

Introduction to Software Process Models 11


Notes A prototype typically implements only a small subset of the features of the
eventual program, and the implementation may be completely different
---------------------- from that of the eventual product. The purpose of a prototype is to allow
users of the software to evaluate proposals for the design of the eventual
---------------------- product by actually trying them out, rather than having to interpret and
---------------------- evaluate the design based on descriptions.
There are several benefits of using prototyping. The software designer
----------------------
and implementer can obtain feedback from the users early in the project.
---------------------- The client and the contractor can compare if the software made matches
the software specification, according to which the software program is
---------------------- built. It also allows the software engineer some insight into the accuracy
of the initial project estimates and whether the deadlines and milestones
----------------------
proposed can be successfully met.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 1.6: The Prototyping Paradigm
----------------------
The process of prototyping involves the following steps:
---------------------- Table 1.1: Prototyping Steps
---------------------- 1. Identify basic requirements Determine basic requirements including
the input and output information desired.
---------------------- 2. Develop initial prototype The initial prototype is developed that
includes only user interfaces.
---------------------- 3. Review The customers, including end-users, ex-
amine the prototype and provide feed-
---------------------- back on additions or changes.
---------------------- 4. Revise and enhance the Using the feedback, both the specifica-
prototype tions and the prototype can be improved.
---------------------- Negotiation about what is within the
scope of the contract/product may be
---------------------- necessary. If changes are introduced, then
a repeat of step 3 and 4 may be needed.
---------------------- Advantages of prototyping
---------------------- 1. 
Reduced time and costs: Prototyping can improve the quality of
requirements and specifications provided to developers, as what the user
---------------------- really wants can result in faster and less expensive software.
---------------------- 2. Improved and increased user involvement: Prototyping requires user

12 Software Engineering with UML


involvement and allows them to see and interact with a prototype allowing Notes
them to provide better and more complete feedback and specifications.
It reduces misunderstandings and miscommunications that occur when ----------------------
each side believes that the other understands what they said.
----------------------
Disadvantages of prototyping
----------------------
1. Insufficient analysis: The focus on a limited prototype can distract
developers from properly analysing the complete project. ----------------------
2. User confusion of prototype and finished system: Users can begin to
----------------------
think that a prototype, intended to be thrown away, is actually a final
system that merely needs to be finished or polished. This can lead them ----------------------
to expect the prototype to accurately model the performance of the final
system. Users can also become attached to features that were included in ----------------------
a prototype for consideration and then removed from the specification for
----------------------
a final system.
3. 
Developer attachment to prototype: Developers can also become ----------------------
attached to prototypes on which they have given a great deal of effort. This ----------------------
can lead to problems like attempting to convert a limited prototype into a
final system when it does not have an appropriate underlying architecture. ----------------------
4. Excessive development time of the prototype: A key property to ----------------------
prototyping is the fact that it is supposed to be done quickly. If the
developers lose sight of this fact, they very well may try to develop a ----------------------
prototype that is too complex.
----------------------
5. Expense of implementing prototyping: The startup cost for building a
development team focused on prototyping may be high. ----------------------
ii. Spiral Model ----------------------
The spiral model was defined by Barry Boehm in his 1988 article “A
----------------------
Spiral Model of Software Development and Enhancement”. The iterations
were typically 6 months to 2 years’ long. Each phase starts with a design ----------------------
goal and ends with the client reviewing the progress thus far. Analysis and
engineering efforts are applied at each phase of the project, with an eye ----------------------
towards the end goal of the project.
----------------------
• I t couples the iterative nature of prototyping with the controlled and
systematic approach of the waterfall model. ----------------------
• I t facilitates the more complete versions of the software with rapid ----------------------
development.
----------------------
• I t is a risk-driven process model generator. It has two main
features: one is the cyclic approach and another is a set of anchor ----------------------
point milestones. Cyclic approach is for incrementally growing a
system’s degree of definition and implementation while decreasing ----------------------
its degree of risk. In a set of anchor point milestone, a combination ----------------------
of work products and conditions are attained along the path of the
spiral. ----------------------

Introduction to Software Process Models 13


Notes The steps in the spiral model can be generalised as follows:
a. The new system requirements are defined in as much detail as possible.
----------------------
This usually involves interviewing a number of users representing all the
---------------------- external or internal users and other aspects of the existing system.
b. A preliminary design is created for the new system.
----------------------
c. A first prototype of the new system is constructed from the preliminary
---------------------- design. This is usually a scaled-down system, and represents an
approximation of the characteristics of the final product.
----------------------
d. A second prototype is evolved by a four-fold procedure:
----------------------
• Evaluating the first prototype in terms of its strengths, weaknesses
---------------------- and risks;

---------------------- • Defining the requirements of the second prototype;


• Planning and designing the second prototype;
----------------------
• Constructing and testing the second prototype.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 1.7: The Spiral Model
----------------------
The spiral model is used most often in large projects. The US military has
---------------------- adopted the spiral model for its Future Combat System program.
The spiral model is divided into a number of framework activities also called
----------------------
the “task regions”. Typically, there are between three and six task regions.
----------------------

----------------------

----------------------

----------------------

14 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Fig. 1.8: The Spiral Model with Six Task Regions ----------------------
i. 
Customer communication – task required to establish effective ----------------------
communication between developer and customer.
----------------------
ii. Planning – task required to define resources, timelines and other project-
related information. ----------------------
iii. Risk analysis – task required to assess both technical and management ----------------------
risk.
iv. Engineering – task required to build one or more representations of the ----------------------
applications ----------------------
v. Construction and release – task required to construct, test, install and
provide user support (e.g., documentation and training). ----------------------

vi. Customer/system evaluation – task required to obtain customer feedback ----------------------


based on the evaluation of the software representation created during the
----------------------
engineering stage and implemented during the installation stage.
Process Nature of Customer Risk Technology Domain Focus ----------------------
Models requirement interaction Level Knowledge
Waterfall Simple and universal Initial, once or Minimum Proven and Common Solution ----------------------
Model in nature twice universally Knowledge
understood ----------------------
Prototyping Simple, but Couple of Very Low Proven but Technology Prototype and
Model needs testing and times till needs testing solution ----------------------
confirmation on prototype is
critical aspects of approved ----------------------
technology solution
Incremental Calls progressive Very frequent; Medium Configuration High Solution ----------------------
Model introduction of continuous management implementation
functions, features basis for strategy
and implementation stage-wise ----------------------
confirmation
----------------------

----------------------

Introduction to Software Process Models 15


Notes Process Nature of Customer Risk Technology Domain Focus
Models requirement interaction Level Knowledge
---------------------- Spiral Model Complex, Continues to High Integration, Very High Tools,
large customer move together handling technology
specification, of multiple solution
---------------------- domain influences technologies implementation,
key, processes and and solutions customer
---------------------- technology to be participation
tested
----------------------
1.5.4 Rapid Application Development (RAD) Model
----------------------
RAD is used when there is a need to create software in a very short time
---------------------- span, usually within two to three months. It requires higher availability of the
designers for modelling and has high budget.
----------------------
Rapid Application Development (RAD) refers to a software development
---------------------- life cycle designed to give much faster development and higher quality results
than the traditional life cycle. Rapid application development is a software
---------------------- development methodology, which involves iterative development and the
construction of prototypes.
----------------------
The RAD model concentrates on short development cycle of system
---------------------- development. It is a high speed adaption of the waterfall model and it has a
component-based construction approach. It may deliver software within a very
----------------------
short period, if the requirements are well understood and the project scope
---------------------- is constrained. In this model, many functions or components of software are
constructed in parallel so that the customer can see and use it and provide
---------------------- feedback .The developments are time-boxed, delivered and then assembled into
working prototype.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 1.9: The RAD Model

---------------------- Using structured techniques, the developer first builds preliminary data
models and business process models of the business requirements. Prototyping
---------------------- then helps the analyst and users to verify those requirements and to formally
refine the data and process models. All flavors of RAD have the potential for
---------------------- providing a good framework for faster product development with improved

16 Software Engineering with UML


code quality, but successful implementation and benefits often hinge on project Notes
type, schedule, software release cycle and corporate culture. Large software
vendors like Microsoft and IBM may use RAD for flagship products. ----------------------
Following are the phases of RAD model: ----------------------
i. Business modelling: It identifies the information flow between various
business processes. ----------------------

ii. Data modelling: It defines the data objects from data modelling. ----------------------
iii. Process modelling: It converts defined data objects to achieve information ----------------------
flow as per specific defined business objective.
iv. Application generation: Automated tools are used to convert process ----------------------
model into code and actual system. ----------------------
v. Testing and turnover: It tests new components or functions with its
interfaces. ----------------------
Advantages of RAD model ----------------------
i. Develops application in very short time. ----------------------
ii. Reusability of components.
----------------------
iii. Encourages customer feedback.
----------------------
Disadvantages of RAD model
iv. Performance depends on teams in the software development. ----------------------
v. High skilled development team required. ----------------------
vi. 
Cost of modelling and automated code generation is very high, so ----------------------
inapplicable to cheaper projects.
----------------------
Check your Progress 3 ----------------------
Fill in the blanks. ----------------------
1. System engineering and analysis includes gathering requirement at
----------------------
the_______________ level
2. Software _________ focuses on four distinct attributes of a program. ----------------------
3. The incremental model delivers a series of releases, called __________ ----------------------
4. Evolutionary models are _______________
----------------------
5. Prototyping model and spiral model are examples of ________model.
6. A ___________ is a working model that is functionally equivalent to ----------------------
a component of the product. ----------------------
7. The spiral model is used most often in _____________projects.
----------------------
8. Rapid application development is a software _________methodology.
9. The __________model concentrates on short development cycle of ----------------------
system development.
----------------------

Introduction to Software Process Models 17


Notes 1.6 AGILE COMPUTING
---------------------- It is an SDLC model, which is a combination of iterative and incremental
process model. An agile method focusses on code rather than design. It is best
----------------------
suitable for small to medium-sized business system or software.
---------------------- It emphasises on process adaptability and customer satisfaction by quick
---------------------- delivery of software product. The agile method splits the product into small
incremental deliverables. The deliverables are provided in iterations of two
---------------------- to three weeks’ time. For every iteration, it involves a cross-functional team
working simultaneously on different phases of software SDLC model.
----------------------
This model is popular because of its flexibility and adaptability. Some of
---------------------- popular agile methods include rational unified process, extreme programming,
feature driven development and Dynamic System Development Model (DSDM).
----------------------
This method is considered a very realistic approach in software
---------------------- development and it promotes teamwork and cross-training. In this method,
every functionality of the software can be developed very rapidly and shown
---------------------- to the customer. It requires minimum resources. This methodology is perfectly
---------------------- suitable for changing requirements. It requires very little planning and is easy
to manage and gives flexibility to the developers. It enables simultaneous
---------------------- development of the software product.
---------------------- Some of the disadvantages are that it is not suitable for handling complex
dependencies. It involves more risk of sustainability, maintainability and
---------------------- extensibility. It depends heavily on customer interactions; so if customer is not
clear, it leads to software development in wrong direction. It has high level of
----------------------
dependency on individuals since there is less documentation. The transfer of
---------------------- technology to new team members is challenging due to lack of documentation.
Some agile principles are:
----------------------
i. Customer Involvement: Customers are completely involved in the
---------------------- development process.
---------------------- ii. Incremental Delivery: The software is developed in increments; at each
new increment the customer requirements are added.
----------------------
iii. Embrace Change: It always expects the customer requirements to
---------------------- change and the design should accommodate these changes.
---------------------- iv. Maintain Simplicity: It helps in removing the complexity of the system.
Agile developers recognise that documentation is an intrinsic part of any
---------------------- system, the creation and maintenance of which is a “necessary evil” to
some and an enjoyable task for others, an aspect of software development
---------------------- that can be made agile when you choose to do so.
---------------------- There are several valid reasons for documentation:
---------------------- i. Your project stakeholders require it: If your project stakeholders
request a document from you, perhaps at your suggestion, and understand
---------------------- the trade-offs involved (more on this later), then you must create the

18 Software Engineering with UML


document. It is important to note that Extreme Programming (XP) is very Notes
explicit about documentation being a business decision.
----------------------
ii. To define a contract model: Contract models define how your system
and an external one interacts with one another. Some interactions are bi- ----------------------
directional, whereas others are unidirectional, making the interaction(s)
explicit to everyone involved. Contract models are often required when ----------------------
an external group controls an information resource that your system
----------------------
requires, such as a database, legacy application or information service.
iii. To support communication with an external group: It is not always ----------------------
possible to co-locate a development team and it is not always possible
----------------------
to have project stakeholders (or at least the ones you need at the time)
available at all times. When you need to work with an external group of ----------------------
people, you need to find ways to communicate with them, and shared
documentation is often part of the solution in combination with occasional ----------------------
face-to-face discussions, teleconferencing, e-mail and collaborative
----------------------
tools. It is a mistake to use documentation as your primary means of
communication because it is far too easy to misunderstand something ----------------------
that has been written, but it is a good supporting mechanism.
----------------------
iv. To support organisational memory: One of the principles of agile
modelling is “enabling the next effort is your secondary goal,” which is ----------------------
meant as a counter-balance to the principle “Working software is your
primary goal”. An important implication is that we not only need to develop ----------------------
software, but we also need to develop the supporting documentation
----------------------
required to use, operate, support and maintain the software over time.
v. For audit purposes: The common theme was that we had to follow ----------------------
a defined process and capture proof that we did so, resulting in more ----------------------
documentation than we would have normally written. In these situations,
you still want to create just enough documentation to get the job done. ----------------------
vi. To think something through: Many people will write documentation ----------------------
to either verify for themselves some group work they had just been
involved with or simply to increase their own understanding. The act of ----------------------
writing, of putting your ideas down on paper, can help you to solidify
them and discover problems with your thinking. What appears clear and ----------------------
straightforward in your mind can often prove to be very complicated once ----------------------
you attempt to describe it in detail, and you can often benefit from writing.
1.6.1 Extreme Programming ----------------------

In this, the new versions of the software module may be build several ----------------------
times per day, and the increments are delivered to the customers every two
----------------------
weeks. For every build of the software module, all tests must be run and the
build accepted if the tests are successful. ----------------------
Extreme Programming (XP) is a pragmatic approach to program
----------------------
development that emphasises business results first and takes an incremental,
get-something-started approach to building the product, using continual testing ----------------------

Introduction to Software Process Models 19


Notes and revision.
Kent Beck, author of Extreme Programming Explained: Embrace
----------------------
Change, developed the concept of XP. According to Beck, code comes first
---------------------- in XP. However, Beck emphasises that in order to write the code, you have to
write a test for it first so that you will know when your code succeeds. Beck
---------------------- also introduces the relatively novel idea that code which is so-called “extreme”
level leads to a development process that is more responsive to customer needs
----------------------
(“agile”) than traditional methods, while creating software of better quality.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 1.10(A) Extreme Programming
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 1.10(B) Extreme Programming


Extreme Programming is described as being:
----------------------
i. An attempt to reconcile humanity and productivity.
---------------------- ii. A mechanism for social change.
---------------------- iii. A path to improvement.

---------------------- iv. A style of development.

20 Software Engineering with UML


v. A software development discipline. Notes
The main aim of XP is to reduce the cost of change. In traditional system
----------------------
development methods, the requirements for the system are determined at the
beginning of the development project and often fixed from that point on. This ----------------------
means that the cost of changing the requirements at a later stage will be high.
XP sets out to reduce the cost of change by introducing basic values, principles ----------------------
and practices. By applying XP, a system development project should be more
----------------------
flexible with respect to changes.
XP Activities ----------------------
XP describes four basic activities that are performed within the software ----------------------
development process.
----------------------
i. Coding: The advocates of XP argue that the only truly important product of
the system development process is code. Without code you have nothing. ----------------------
Coding can be drawing diagrams that will generate code, scripting a web-
based system or coding a program that needs to be compiled. Coding can ----------------------
also be used to figure out the most suitable solution. ----------------------
ii. Testing: One cannot be certain of anything unless one has tested it. Testing
is not a perceived, primary need for the customer. A lot of software is ----------------------
shipped without proper testing and still works. In software development, ----------------------
XP says this means that one cannot be certain that a function works unless
one tests it. This raises the question of defining what one can be uncertain ----------------------
about.
----------------------
iii. 
Listening: Programmers do not necessarily know anything about the
business side of the system under development. The function of the system ----------------------
is determined by the business side. For the programmers to find what the
functionality of the system should be, they have to listen to business. ----------------------
Programmers have to listen “in the large”; they have to listen to what the ----------------------
customer needs. Also, they have to try to understand the business problem,
and give the customer feedback about his or her problem, improve the ----------------------
customer’s own understanding of his or her problem.
----------------------
iv. Designing: From the point of view of simplicity, one could say that system
development does not need more than coding, testing and listening. If ----------------------
those activities are performed well, the result should always be a system
----------------------
that works. In practice, this will not work. One can come a long way
without designing but at a given time one will get stuck. The system ----------------------
becomes too complex and the dependencies within the system cease to be
clear. One can avoid this by creating a design structure that organises the ----------------------
logic in the system. Good design will avoid lots of dependencies within
----------------------
a system; this means that changing one part of the system will not affect
other parts of the system. ----------------------
Some of the extreme programming practices are as follows:
----------------------
• Incremental planning
• Small releases ----------------------

Introduction to Software Process Models 21


Notes • Simple design
• Test first development
----------------------
• Refactoring
---------------------- • Pair programming
• Collective ownership
----------------------
• Continuous integration
---------------------- • Sustainable space
---------------------- • Onsite customer

---------------------- Check your Progress 4


----------------------
State True or False.
---------------------- 1. An agile method focusses on design rather than code.
---------------------- 2. Contract models define how your system and an external one interacts
with one another.
----------------------
3. Extreme Programming (XP) is a pragmatic approach to object
---------------------- development.
---------------------- 4. The main aim of XP is to reduce the cost of change.

----------------------
1.7 COMPONENT-BASED DEVELOPMENT
----------------------
A Component-based Software Development (CBSE) approach is based
---------------------- on software reuse. It emerged from the failure of object-oriented development
to support effective reuse. So, a component-based software engineering is a
---------------------- process that focuses on the design and construction of software using reusable
---------------------- software components. Some of the main objectives of component-based
software engineering are as follows:
----------------------
i. To reduce cost and time
---------------------- ii. To improve quality of software
---------------------- iii. To detect defects within the system

---------------------- A component-based development follows software development


principles, such as independency between components, implementation of
---------------------- components are hidden, well-defined interfaces between components and
components’ platforms are shared and reduced development cost.
----------------------
Some of the CBSE essentials are as follows:
----------------------
i. Independency between components with well-defined interfaces.
---------------------- ii. Component standards which are used to integrate the components.
---------------------- iii. A middleware which is used for interoperability between components.

---------------------- iv. A development process for reuse.

22 Software Engineering with UML


Some of the problems of CBSE are: Notes
i. Component trustworthiness, if the source code is not available.
----------------------
ii. Who certifies the quality of the component?
----------------------
iii. How are the growing properties of the component compositions predicted?
iv. How do we do trade-off analysis between the features of one component ----------------------
and another? ----------------------
A component is an independent executable entity that can be constructed from
one or more executable objects. A component acts as a service provider. These ----------------------
services are made available through an interface and all the interactions to and ----------------------
from the components are done through interfaces.
Some of the characteristics of component are as follows: ----------------------

i. Standardised: This model must define interfaces, metadata, ----------------------


documentation and deployment.
----------------------
ii. Independent: It should be independent.
----------------------
iii. Composable: All the interactions must be through public interfaces. It
must also provide the external access. ----------------------
iv. Deployable: A component must be able to operate stand-alone. ----------------------
v. Documented: It should be documented for further needs.
----------------------
Some of the examples of component models are EJB (Enterprise Java Beans)
model, COM+ model (.NET model) and CORBA component model. ----------------------
A component model specifies how the interfaces should be defined and the ----------------------
elements that should be included in an interface definition. A component
developed for specific application can be reused for another application if ----------------------
it is likely to be associated with another domain. For example in a library
----------------------
management domain, the fundamental purposes are book issue, restock, book
return, etc. ----------------------

Check your Progress 5 ----------------------

----------------------
Fill in the blanks.
1. A component-based software development (CBSE) approach is based ----------------------
on software __________. ----------------------
2. A component-based development follows software __________
principles. ----------------------

3. The ___________model specifies how the interfaces should be ----------------------


defined.
----------------------
4. Component developed for specific application can be reused for
another ___________. ----------------------

----------------------

Introduction to Software Process Models 23


Notes
Activity 1
----------------------
Suppose you have to implement a Student Information System, which
----------------------
model would you prefer to use in order to implement this system? Justify
---------------------- your answer.

----------------------
Summary
----------------------
•  oftware myths prevail. Though they do are not clearly visible they have
S
---------------------- the potential to harm all the parties involved in the software development
---------------------- process, mainly the developer team.
•  oftware engineering is a layered technology. Most engineering
S
----------------------
approaches (including software engineering) must rest on an organisational
---------------------- commitment to quality.
•  software process contains a set of activities and associated results which
A
----------------------
leads to development of software.
---------------------- •  linear process flow executes these activities in sequence. It begins with
A
---------------------- communication and ends with deployment. An iterative process flow
repeats one or more activities before going to the next activity. A parallel
---------------------- process flow executes one or more activities in parallel.

---------------------- •  he incremental model delivers a series of releases, called increments


T
that provide progressively more functionality for the customer as each
---------------------- increment is delivered.

---------------------- •  prototype is a working model that is functionally equivalent to a


A
component of the product. In many instances, the client only has a general
---------------------- view of what is expected from the software product.
---------------------- •  he spiral model is divided into a number of framework activities also
T
called task regions. Typically, there are between three and six task regions.
----------------------
•  apid Application Development (RAD) refers to a software development
R
---------------------- life cycle designed to give much faster development and higher quality
results than the traditional life cycle. Rapid application development is a
---------------------- software development methodology, which involves iterative development
and the construction of prototypes.
----------------------
•  component-based software development (CBSE) approach is based on
A
---------------------- software reuse. It emerged from the failure of object-oriented development
to support effective reuse.
----------------------
•  xtreme Programming (XP) is a pragmatic approach to program
E
---------------------- development that emphasizes business results first and takes an
---------------------- incremental, get-something-started approach to building the product,
using continual testing and revision.
----------------------

24 Software Engineering with UML


Keywords Notes

----------------------
•  rocess: Collection of related, structured activities or tasks that produce
P
a specific service or product (serve a particular goal) for a particular ----------------------
customer or customers.
• Business modelling: It identifies the information flow between various ----------------------
business processes. ----------------------
• Extreme programming: Software development methodology which is
intended to improve software quality and responsiveness to changing ----------------------
customer requirements.
----------------------
Self-Assessment Questions ----------------------
1. What are evolutionary models? Explain different types of evolutionary ----------------------
models.
----------------------
2. What is Extreme Programming? Explain.
3. Software engineering is a layered technology. Discuss. ----------------------
4. Discuss the various software myths. ----------------------

Answers to Check your Progress ----------------------

Check your Progress 1 ----------------------


Fill in the blanks. ----------------------
1. There are three types of software myths; these are management myth, ----------------------
customer myth and practitioner/developer myth.
2. Myths lead to false expectations. ----------------------

Check your Progress 2 ----------------------


State True or False. ----------------------
1. False
----------------------
2. False
----------------------
3. True
4. True ----------------------

5. True ----------------------
Check your Progress 3 ----------------------
Fill in the blanks.
----------------------
1. System engineering and analysis includes gathering requirement at the
system level. ----------------------

2. Software design focuses on four distinct attributes of a program. ----------------------


3. The incremental model delivers a series of releases, called increments. ----------------------

Introduction to Software Process Models 25


Notes 4. Evolutionary models are iterative.
5. Prototyping model and spiral model are examples of evolutionary model.
----------------------
6. A prototype is a working model that is functionally equivalent to a
---------------------- component of the product.
---------------------- 7. The spiral model is used most often in large projects.

---------------------- 8. Rapid application development is a software development methodology.


9. The RAD model concentrates on short development cycle of system
---------------------- development.
---------------------- Check your Progress 4
---------------------- State True or False.
1. False
----------------------
2. True
----------------------
3. False
---------------------- 4. True
---------------------- Check your Progress 5
---------------------- Fill in the blanks.
1. A component-based software development (CBSE) approach is based on
----------------------
software reuse.
---------------------- 2. A component-based development follows software development
---------------------- principles.
3. The component model specifies how the interfaces should be defined.
----------------------
4. Component developed for specific application can be reused for another
---------------------- application.
----------------------
Suggested Reading
----------------------
1. Aggarwal, K. K. and Yogesh Singh. Software Engineering: Programs,
---------------------- Documentation, Operating Procedures. New Delhi: New Age International
---------------------- Publisher.
2. Agarwal, Bharat Bhushan and Sumit Prakash Tayal. Software Engineering.
---------------------- New Delhi: Laxmi Publications.
---------------------- 3. Jalote, Pankaj. An Integrated Approach to Software Engineering. Springer
Publications.
----------------------
4. Mishra, Jibitesh and Ashok Mohanty. Software Engineering. New Delhi:
---------------------- Pearson Publications.
---------------------- 5. Pressman, Roger S. Software Engineering: A practitioners Approach.
McGraw-Hill.
----------------------

26 Software Engineering with UML


Software Project Planning and Estimation
UNIT

2
Structure:

2.1 Introduction
2.2 Software Scope
2.2.1 Types of Scope
2.3 Software Project Estimation
2.3.1 Metrics for Software Quality
2.3.2 Halstead’s Software Science
2.3.3 McCabe’s Complexity Metric
2.4 Metrics in Project Estimation
2.4.1 Size Projection
2.4.2 Productivity Projection
2.5 Cost Estimation
2.5.1 Decomposition
2.5.2 Effort Estimation
2.5.3 Expert Judgement
2.5.4 Estimation by Analogy
2.5.5 Cost Estimation Tools
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

Software Project Planning and Estimation 27


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Explain the software scope and its types
----------------------
• Discuss the concept of software project estimation
---------------------- • Describe the metrics in project estimation
---------------------- • Elaborate on the concept of the cost estimation

----------------------
2.1 INTRODUCTION
----------------------
The software project management process begins with a set of activities
---------------------- that are collectively called project planning. The first of these activities is
estimation. The objective of software project planning is to provide a framework
---------------------- that enables the manager to make reasonable estimates of resources, cost, and
---------------------- schedule. Estimation need to be conducted in a well-planned manner. Useful
techniques for time and effort estimation do exist. Estimation lays a foundation
---------------------- for all other project planning activities, and project planning provides the road
map for successful software engineering. Estimation of resources, cost and
---------------------- schedule for a software development effort requires experience, access to good
---------------------- historical information, and the courage to commit to quantitative measures
when qualitative data are all that exists.
---------------------- Estimates should attempt to define best-case and worst-case scenarios so
---------------------- that project outcomes can be bounded. Although there is an inherent degree of
uncertainty, the software team embarks on a plan that has been established as a
---------------------- consequence of these tasks.
----------------------
2.2 SOFTWARE SCOPE
----------------------
Project scope is the part of project planning that involves determining
---------------------- and documenting a list of specific project goals, deliverables, tasks and
deadlines. Size often increases due to “scope creep” that occurs when problem
---------------------- requirements change. Increases in project size can have a geometric impact on
---------------------- project cost and schedule. Scope management process for a project includes the
following activities:
----------------------
1. Collect requirements: It is the process of defining and documenting
---------------------- the needs of the customers to meet the
objectives of the project.
----------------------
2. Defining the scope: This process involves developing a detailed
---------------------- description of the project and product.

---------------------- 3. Creating Work This process involves subdividing project


Breakdown Structure deliverables and project work into smaller,
---------------------- (WBS): more manageable components.

28 Software Engineering with UML


4. Verifying the scope: It is the process of formalising acceptance of Notes
the completed project deliverables.
----------------------
5. Controlling the scope: This process involves monitoring the status of
the project and product scope and managing ----------------------
changes to the scope baseline.
----------------------
2.2.1 Types of Scope
----------------------
Scope can be defined for project as well as product. In the context of a
project, the scope can be of the following types: ----------------------
1. Project scope: Project scope defines the work to be performed to deliver ----------------------
the software. In order to develop software, we perform various activities
such as planning, monitoring and control, budgeting, scheduling, ----------------------
communicating, reporting and documentation. Each such activity is
----------------------
clearly defined in the project scope. As each project is unique, project
requirement varies in detailing, for example, communication and reporting ----------------------
requirements may vary with customer.
----------------------
2. Product scope: Product scope defines the expectations of the customer
from the product. Product scope broadly consists of functional and non- ----------------------
functional requirements of the software. Functional requirements include
various application specific functionalities, such as payroll processing, ----------------------
ledger posting, stock update, etc. Non-functional requirements describe the
----------------------
quality and security requirements, such as user authorisation, backup and
restore, processing speed and response time, etc. Product scope document ----------------------
acts as a base document for managing software development activities,
such as requirement gathering, analysis and design, coding and testing, ----------------------
etc. Product scope is generally further elaborated into comprehensive
----------------------
Software Requirement Specification (SRS) document. SRS document is
usually prepared after preliminary scope definition. ----------------------
Generally, project scope document includes the following: ----------------------
1. Project objective: Objective of project is the definite purpose behind the
initiation of the project. The objective gives direction to the project. A ----------------------
project can have multiple objectives. Very few organisations specifically ----------------------
define the objective of the project; most of the time, objectives are ignored.
A project manager must define the objective of the project. Defining ----------------------
project objectives needs skill and clarity about the purpose. Ability to
visualise the work undertaken with possible gains and losses improves the ----------------------
quality of the work. Quite often, the objectives are stated as a formality. ----------------------
Such objectives never help the project team. A well-stated objective can
decide whether the project is a success or a failure. ----------------------
2. Technique for setting goal/objective: Setting goal or objective means ----------------------
writing desired outcome of the project. Our tendency to think in general
terms adds vagueness to the objective. Vague objectives neither support ----------------------
any direction nor help in planning the activities to achieve the desired
purpose. To set clear and precise objective, SMART technique can be ----------------------

Software Project Planning and Estimation 29


Notes used. Let us understand the meaning of the word SMART in defining the
objective.
----------------------
• ‘ S’ stands for specific. Specificity helps you to visualise your
---------------------- objective.
• ‘M’ stands for measurable. Your objective should be measurable.
----------------------
• ‘ A’ stands for achievable. Your capacity determines how much
---------------------- you can achieve in a given time frame. You should always take
into consideration your (in case of Project - Project Team’s) core
----------------------
strength.
---------------------- • ‘R’ stands for realistic. Can you achieve an unreal goal?
---------------------- • ‘ T’ stands for time bound. While setting your goal, you should
define the target date at which you want to achieve the desired
---------------------- result. Here you can state the start and end date in your objective.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 2.1: Software Project Scope


3. Product scope description: Let us quickly discuss the contents of product
----------------------
scope description.
---------------------- i. Project requirement: This section describes the project-
level requirement and not product requirements. Project-level
----------------------
requirements could be related to project planning, budgeting,
---------------------- schedule and estimation and communication. For example,
use of automated tools, such as MS Project or any other project
---------------------- management software could be project-level requirement.
---------------------- ii. Project deliverables: Once we understand project and product
requirement, we have to convert these requirements into
---------------------- deliverables. Deliverable is the actual output or end result delivered
to the customer. We must understand the difference between
----------------------
deliverables and requirements. For example, you are assigned,
30 Software Engineering with UML
as a Project Manager, to deliver the word-editing software; Notes
then main deliverable of the project is word-editing software.
However, providing facilities such as spell-checking, printing, ----------------------
mail connectivity in your editing software are the requirements of
the product. Deliverables are nothing but collective requirements. ----------------------
Deliverables comprise requirements. ----------------------
iii. Project boundary: Project boundary explicitly states what is
----------------------
included and excluded from the project. For example, in ERP
implementation project, you can explicitly state that historic legacy ----------------------
data migration is excluded from the scope of the project work,
since many a times the migration becomes a separate project and it ----------------------
heavily consumes your time and cost. If you do not explicitly define
----------------------
what is excluded from the project, your stakeholders may assume
that you are supposed to deliver. ----------------------
iv. Product acceptance criteria: Product acceptance criteria define
----------------------
how the delivered product is accepted by the customer. It defines
various processes and procedures and guidelines for accepting ----------------------
criteria. Once your product is ready, it needs to be formally accepted
by the customer for releasing the payment. Before accepting a ----------------------
product, the customer may want to check quality, fitness for use and
----------------------
features of the product as per scope.
v. Project constraints: In order to deliver a product, we are utilising ----------------------
various resources. These resources directly or indirectly affect the
----------------------
performance of the project. The main constraints are scope, budget,
schedule, human resources and technology. Each of these resources ----------------------
has a limitation with respect to the project. We cannot exploit these
constraints beyond their limitation. ----------------------
vi. Time constraint: When projects are limited by specific time ----------------------
frames, you cannot delay or exceed that time limit. For example,
some projects need to be finished in a specific time; after that time, ----------------------
there is no importance for that project, e.g., implementation of ----------------------
electoral voting system to be finished before the declared date of
election. ----------------------
vii. Budget constraint: Budget constraint defines total budget ----------------------
sanctioned for the project. If project exceeds beyond the budget,
the customer may not be liable for paying the extra amount; hence, ----------------------
enough care should be taken while defining the scope of the project
so that only required things are delivered to the customer within the ----------------------
given budget. ----------------------
viii. Schedule constraint: A constraint that affects or delays your project
activities is called scheduled constraint. For example, organisations ----------------------
have only one software architect assigned early on some project and ----------------------
he is not available for the project next two months. The availability
of a software architect can delay your project schedule by two ----------------------

Software Project Planning and Estimation 31


Notes months. Here the architect is the source of schedule constraint.
ix. Technology constraint: In IT industry, new technologies are always
----------------------
emerging and project team may not have hands-on experience in
---------------------- the newest technology. You cannot afford to have team expertise in
every technology and you need to manage the project with available
---------------------- technology. Many a times, the technology itself has limitation, for
example, the capacity of a database to store huge data, support for
----------------------
new features such as object-oriented technology. These constraints
---------------------- are called technology constraints and are written explicitly.
x. Project assumptions: Assumptions are the things that you believe to
----------------------
be true. With your prior experience, you assume that something will go
---------------------- in a particular way but in reality, it may not be true. In a project, you
assume that the key resource is available till the project completion but
---------------------- in reality, he may leave the project prior to completion. Another most
common assumption could be that the team will grasp new technology in
----------------------
short time. These assumptions are possible sources of risk and need to be
---------------------- mitigated to avoid project failure.

---------------------- Check your Progress 1


----------------------
Fill in the blanks.
---------------------- 1. __________is the part of project planning that involves determining
---------------------- and documenting a list of specific project goals, deliverables, tasks
and deadlines.
---------------------- 2. To set clear and precise objective, _________ technique can be used.
---------------------- Multiple Choice Multiple Response.
---------------------- 1. Types of scope are:
i. Project scope
----------------------
ii. Product scope
----------------------
iii. Estimation scope
---------------------- iv. Program scope
----------------------

---------------------- 2.3 SOFTWARE PROJECT ESTIMATION

---------------------- Effective software project estimation is one of the most challenging and
important activities in software development. Proper project planning and
---------------------- control is not possible without a sound and reliable estimate. As a whole, the
software industry does not estimate projects well and does not use estimates
----------------------
appropriately. We suffer far more than we should as a result and we need to
---------------------- focus on improving the situation.

----------------------

32 Software Engineering with UML


Software cost and effort estimation will never be an exact science. Too Notes
many variables—human, technical, environmental, political—can affect the
ultimate cost of software and effort applied to develop it ----------------------
Underestimating a project leads to understaffing it (resulting in staff ----------------------
burnout), under-scoping the quality assurance effort (running the risk of low
quality deliverables), and setting too short a schedule (resulting in loss of ----------------------
credibility as deadlines are missed). For those wanting to avoid this situation
----------------------
by generously padding the estimate, overestimating a project can be just about
as bad for the organisation! If you give a project more resources than it really ----------------------
needs without sufficient scope controls, it will use them. The project is then
likely to cost more than it should (a negative impact on the bottom line), take ----------------------
longer to deliver than necessary (resulting in lost opportunities), and delay the
----------------------
use of your resources on the next project.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 2.2: Software Project Estimation
----------------------
The four basic steps in software project estimation are:
i. Estimate the size of the development product. This generally ends up in ----------------------
either Lines of Code (LOC) or Function Points (FP), but there are other
----------------------
possible units of measure.
ii. Estimate the effort in person-months or person-hours. ----------------------
iii. Estimate the schedule in calendar months. ----------------------
iv. Estimate the project cost in dollars (or local currency). ----------------------
2.3.1 Metrics for Software Quality
----------------------
The overriding goal of software engineering is to produce a high-quality
system, application, or product within a time frame that satisfies a market need. ----------------------
To achieve this goal, you must apply effective methods coupled with modern
----------------------
tools within the context of a mature software process. A good software engineer
must measure if high quality is to be realized. ----------------------

Software Project Planning and Estimation 33


Notes Software quality metrics are a subset of software metrics that focus on the
quality aspects of the product, process and project. In general, software quality
---------------------- metrics are more closely associated with process and product metrics than with
project metrics.
----------------------
Nonetheless, the project parameters, such as the number of developers and
---------------------- their skill levels, the schedule, the size and the organisation structure certainly
affect the quality of the product. Software quality metrics can be divided further
----------------------
into end-product quality metrics and in-process quality metrics. The essence
---------------------- of software quality engineering is to investigate the relationships among in-
process metrics, project characteristics, and end-product quality, and, based on
---------------------- the findings, to engineer improvements in both process and product quality.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Process metrics enable an organization to take a strategic view by
---------------------- providing insight into the effectiveness of a software process. Project metrics
---------------------- are tactical. They enable a project manager to adapt project workflow and
technical approach in a real-time manner.
---------------------- Process metrics are the measure of the software development process, such as:
---------------------- - Overall development time
---------------------- - Type of methodology used

---------------------- Process metrics are collected across all projects and over long periods
of time. Their intent is to provide indicators that lead to long-term software
---------------------- process improvement.

---------------------- Project metrics are the measures of software project and are used to
monitor and control the project. They enable a software project manager to:
---------------------- - Minimise the development time by making the adjustments necessary to
---------------------- avoid delays and potential problems and risks.
- Assess product quality on an ongoing basis and modify the technical
----------------------
approach to improve quality.
---------------------- Project metrics are used in estimation techniques and other technical
work. Metrics collected from past projects are used as a basis from which effort
----------------------
and time estimates are made for current software project. As a project proceeds,
---------------------- actual values of human effort and calendar time expended are compared to the

34 Software Engineering with UML


original estimates. This data is used by the project manager to monitor and Notes
control the project.
----------------------
Product metrics are measures of the software product at any stage of
its development, from requirement to installed system. Product metrics may ----------------------
measure:
----------------------
- The complexity of the software design
- The size of the final program ----------------------
- The number of pages of documentation produced ----------------------
2.3.2 Halstead’s Software Science ----------------------
Halstead complexity metrics were developed by the late Maurice Halstead
as a means of determining a quantitative measure of complexity directly from ----------------------
the operators and operands in the module to measure a program module’s ----------------------
complexity directly from source code. Among the earliest software metrics,
they are strong indicators of code complexity. Halstead Science is an estimation ----------------------
technique to find out size, time and effort of a software.
----------------------
Number of operators and operands
----------------------
Halstead´s metrics is based on interpreting the source code as a sequence of
tokens and classifying each token to be an operator or an operand. ----------------------
First we need to compute the following numbers, given the program: ----------------------
• n1 = the number of distinct operators
• n2 = the number of distinct operands ----------------------
• N1 = the total number of operators ----------------------
• N2 = the total number of operands
----------------------
The number of unique operators and operands (n1 and n2) as well as the total
number of operators and operands (N1 and N2) are calculated by collecting the ----------------------
frequencies of each operator and operand token of the source program.
----------------------
From these numbers, following measures can be calculated:
----------------------
Program length (N)
The program length (N) is the sum of the total number of operators and operands ----------------------
in the program: ----------------------
N = N 1 + N2
----------------------
Vocabulary size (n)
The vocabulary size (n) is the sum of the number of unique operators and ----------------------
operands: ----------------------
n = n1 + n2
----------------------
Program volume (V)
The program volume (V) is the information contents of the program, measured ----------------------
in mathematical bits. It is calculated as the program length times the 2-base ----------------------
logarithm of the vocabulary size (n):

Software Project Planning and Estimation 35


Notes V = N * log2 (n)
Halstead’s volume (V) describes the size of the implementation
----------------------
of an algorithm. The computation of V is based on the number of
---------------------- operations performed and operands handled in the algorithm. Therefore,
V is less sensitive to code layout than the lines-of-code measures.
---------------------- The volume of a function should be at least 20 and at most 1,000. The volume
of a parameter-less one-line function that is not empty is about 20. A volume
----------------------
greater than 1,000 tells that the function probably does too many things.
---------------------- The volume of a file should be at least 100 and at most 8,000. These limits
are based on volumes measured for files whose LOCpro and V(G) are near their
----------------------
recommended limits. The limits of volume can be used for double-checking.
---------------------- Difficulty level (D)
---------------------- The difficulty level or error proneness (D) of the program
is proportional to the number of unique operators in the program.
---------------------- D is also proportional to the ratio between the total number of operands and the
---------------------- number of unique operands (i.e., if the same operands are used many times in
the program, it is more prone to errors).
---------------------- D = (n1 / 2) * (N2 / n2)
---------------------- Program level (L)
---------------------- The program level (L) is the inverse of the error proneness of the program,
i.e., a low-level program is more prone to errors than a high-level program.
----------------------
L=1/D
---------------------- Effort to implement (E)
---------------------- The effort to implement (E) or understand a program is proportional to
the volume and to the difficulty level of the program.
----------------------
E=V*D
----------------------
Estimated program length
---------------------- According to Halstead, The first hypothesis of software science is that the
length of a well-structured program is a function only of the number of unique
----------------------
operators and operands.
---------------------- The estimated length is denoted by N^
---------------------- N^= n1log2n1+n2log2n2

---------------------- Potential volume


Among all the programs, the one that has minimal size is said to have the
---------------------- potential volume, V*. Halstead argued that the minimal implementation of any
---------------------- algorithm was through a reference to a procedure that had been previously written.
The implementation of this algorithm would then require nothing more than invoking
---------------------- the procedure and supplying the operands for its inputs and output parameters.
V*= (2+n2*) log2 (2+n2*)
----------------------

36 Software Engineering with UML


Estimated program level/difficulty Notes
Halstead offered an alternate formula that estimates the program level.
----------------------
L^ =2n2/n1N2
----------------------
Hence, D =1 /L^
Effort ----------------------
Halstead hypothesised that the effort required to implement a program ----------------------
increases as the size of the program increases. It takes more effort to implement
a program at a lower level than the higher level. ----------------------

E= V/L^ ----------------------
Time to implement (T) ----------------------
John Stroud suggested that human mind is capable of making a limited
----------------------
number of elementary discriminations per second. Stroud claims that β
(stroud number) ranges between five and 20. Since Effort uses elementary ----------------------
discriminations as its unit of measure, the programming time would be:
T=E/β ----------------------
β is normally set to 18 since this seemed to give best results in Halstead earliest ----------------------
experiments.
----------------------
Example
Let us consider the following C program: ----------------------

main() ----------------------
{ ----------------------
int a, b, c, avg;
----------------------
scanf(“%d %d %d”, &a, &b, &c);
----------------------
avg = (a + b + c) / 3;
printf(“avg = %d”, avg); ----------------------

} ----------------------
The unique operators are: main, (), {}, int, scanf, &, =, +, /, printf ----------------------
The unique operands are: a, b, c, avg, “%d %d %d”, 3, “avg = %d»
----------------------
• , ,
----------------------
• , ,
----------------------
• Calculated Program Length:
----------------------

----------------------
• Volume: ----------------------

----------------------

Software Project Planning and Estimation 37


Notes

---------------------- • Difficulty:

---------------------- • Effort:

----------------------
• Time required to program: seconds
----------------------

----------------------
• Number of delivered bugs:
----------------------
2.3.3 McCabe’s Complexity Metric
----------------------
The cyclomatic (McCabe’s) complexity of a section of source code is the
---------------------- count of the number of linearly independent paths through the source code. For
instance, if the source code contained no decision points such as IF statements or
---------------------- FOR loops, the complexity would be 1, since there is only a single path through
the code. If the code had a single IF statement containing a single condition,
----------------------
there would be two paths through the code: one path where the IF statement is
---------------------- evaluated as TRUE and one path where the IF statement is evaluated as FALSE.
Mathematically, the cyclomatic complexity of a structured program is
----------------------
defined with reference to the control flow graph of the program, a directed
---------------------- graph containing the basic blocks of the program, with an edge between two
basic blocks if control may pass from the first to the second. The complexity M
---------------------- is then defined as,
---------------------- M = E − N + 2P

---------------------- where
E = the number of edges of the graph
----------------------
N = the number of nodes of the graph
----------------------
P = the number of connected components
---------------------- An alternative formulation is to use a graph in which each exit point is
connected back to the entry point. In this case, the graph is strongly connected,
----------------------
and the cyclomatic complexity of the program is equal to the cyclomatic number
---------------------- of its graph (also known as the first Betti number), which is defined as

---------------------- M = E − N + P.
This may be seen as calculating the number of linearly independent cycles
---------------------- that exist in the graph, i.e., those cycles that do not contain other cycles within
---------------------- themselves. Note that because each exit point loops back to the entry point,
there is at least one such cycle for each exit point.
---------------------- For a single program (or subroutine or method), P is always equal to 1. So
---------------------- a simpler formula for a single subroutine is:
M = E − N + 2.
----------------------

38 Software Engineering with UML


Cyclomatic complexity may, however, be applied to several such programs Notes
or subprograms at the same time (e.g., to all of the methods in a class), and in
these cases P will be equal to the number of programs in question, as each ----------------------
subprogram will appear as a disconnected subset of the graph.
----------------------
McCabe showed that the cyclomatic complexity of any structured
program with only one entrance point and one exit point is equal to the number ----------------------
of decision points (i.e., “if” statements or conditional loops) contained in that
----------------------
program plus one. However, this is true only for decision points counted at the
lowest, machine-level instructions. Decisions involving compound predicates ----------------------
like those found in high-level languages like IF cond1 AND cond2 THEN ...
should be counted in terms of predicate variables involved, i.e., in this example ----------------------
one should count two decision points, because at machine level it is equivalent
----------------------
to IF cond1 THEN IF cond2 THEN ....
Cyclomatic complexity may be extended to a program with multiple exit ----------------------
points; in this case it is equal to:
----------------------
π − s + 2,
----------------------
where π is the number of decision points in the program, and s is the
number of exit points. ----------------------

Check your Progress 2 ----------------------

----------------------
Multiple Choice Multiple Response.
1. The basic steps in software project estimation are: ----------------------
i. Estimate the number of stakeholders. ----------------------
ii. Estimate the effort in person-months or person-hours.
----------------------
iii. Estimate the schedule in calendar months.
iv. Estimate the project cost in dollars (or local currency). ----------------------
Fill in the blanks. ----------------------
1. __________ are the measures of software project and are used to ----------------------
monitor and control the project.
2. ___________ are measures of the software product at any stage of its ----------------------
development, from requirement to installed system. ----------------------

----------------------
Activity 1
----------------------
Consider the following program and find the program length, volume, ----------------------
difficulty, effort, time required to below program.
int f=1, n=7; ----------------------

for (int i=1; i<=n; i+=1) ----------------------


f*=i; ----------------------

Software Project Planning and Estimation 39


Notes 2.4 METRICS IN PROJECT ESTIMATION
---------------------- To obtain estimation, we can decompose the problem to be solved, or decompose
the process. Decomposition should be done in such a way that:
----------------------
• Size can be properly estimated.
---------------------- • Cost or effort required for each component can be accurately estimated.
---------------------- • The team’s ability to handle the components is well known.
---------------------- •  he estimated values will be relatively unaffected by changes to the
T
requirements.
----------------------
Software metrics are a way of putting a value/measure on certain aspects
---------------------- of development allowing it to be compared to other projects. These values have
to be assessed correctly otherwise they will not give accurate measurements
---------------------- and can lead to false estimations, etc.
---------------------- Metrics are used to maintain control over the software development
process. It allows managers to manage resources more efficiently so the overall
---------------------- team would be more productive. Some examples of metrics include size
---------------------- projections like source byte size, source lines of code, function pointers, GUI
features and productivity projections such as productivity metrics.
---------------------- The metrics can be used to measure size, cost, effort, product quality of
---------------------- a project, as well as putting a value on the quality of the process taken and
personal productivity. There are certain factors that have to be taken into
---------------------- account when comparing different projects with each other using metrics. If
one project is written in a different language, then the number of lines of code
---------------------- could be significantly different or perhaps the larger project has many more
---------------------- errors and bugs in it. Measurements such as Function Pointers give a better
indication because they are the actual methods that are in the project rather than
---------------------- the number of lines.

---------------------- Using metrics, companies can make much better estimations on the cost,
length, effort, etc. of a project which leads to them giving a more accurate
---------------------- view of the overall project. This better view will allow the company to bid
for projects more successfully, make projects more likely to succeed and will
---------------------- greatly reduce the risk of late delivery, failure, being penalised for late delivery,
---------------------- bankruptcy, etc.
The processes that manage the project and its code can have issues, such
----------------------
as build failures, patches needed, etc. that can affect the software metric’s
---------------------- measures. Using ISO 9000 can help alleviate these issues. For smaller
companies where customer retention is important, using metrics to better the
---------------------- software development process and improve on overall project quality, delivery
time, etc. will make the customers happy which may lead to continued business.
----------------------
2.4.1 Size Projection
----------------------
The different methods of size projection as one of the metrics in project
---------------------- estimation are discussed below.

40 Software Engineering with UML


• Source byte size Notes
Source byte size is a measure of the actual size of the source code data
----------------------
(e.g., in kilobytes). It measures the file size vs. packages, classes, methods,
etc. The overall byte size of the project can be estimated which would ----------------------
give a better indication of the type/size of hardware needed to use the
software. This becomes an issue on systems/devices where they are of a ----------------------
limited nature (e.g., watch, washing machine, intelligent fridge, etc.)
----------------------
The byte size of the source code would vary greatly depending on which
programming language was used to develop it. For example, a program ----------------------
developed in Java could be much smaller than the same program coded in
----------------------
COBOL. If we were to compare executable byte size of programs written
in different languages, we would see that there would be a difference too. ----------------------
The compiler compiles source code into byte code so different compilers
would give out different executable file sizes. ----------------------
As more development is done and the project increases, the overall byte ----------------------
size of the project increases. This will give estimations on how much
space is needed to store, backup, etc. the source files and also the size of ----------------------
transfers over the network. Although this is not much of a problem these
----------------------
days with the cost of storage, transfer bandwidth, etc. being so cheap, it is
a metric that can be used for this type of estimation (storage). ----------------------
As the byte size builds up, searching and indexing will take slightly longer ----------------------
every time it increases.
• Source Lines of Code (SLOC) ----------------------

SLOC gives the size of the project by counting all the lines of source ----------------------
code in a project. It is used to measure effort both before as an estimate
and after as an actual value. It comes from the days of FORTRAN and ----------------------
assembly coding. ----------------------
SLOC gives a much clearer image to developers on the size of the project.
----------------------
When code is written, integration and unit testing can be performed so
measures of programming productivity and quality can be assessed. ----------------------
Source lines of code themselves are not as meaningful as the other
----------------------
metrics. Just because one project has more lines of code than another does
not make it more complex or give it a better quality rating. When using ----------------------
number of lines of code as a metric, other metrics would need to be used
such as product quality. When product quality is looked at with number ----------------------
of lines of code, it gives a much better reflection of the overall project’s
----------------------
quality, radio of good code to buggy code, efficiency of the code, etc.
Source lines of code can be measured from another point of view. This is ----------------------
measuring the actual number of lines of code written in a specific amount ----------------------
of time. When looking at a project level, the number of lines of code that
is measured would typically come from the overall lines of code written ----------------------
throughout the project within a specific amount of time.
----------------------

Software Project Planning and Estimation 41


Notes If the SLOC metric was being applied to an individual developer or a
team then the number of lines of code would obviously be measured on
---------------------- the lines written by the developer or team respectively.
---------------------- When developers use auto-generated code (from GUI designers,
frameworks, etc.) it can lead to incorrect productivity measures. These
---------------------- lines of code should be removed from the calculation to give a better
indication of the actual number of lines written by the developer/team.
----------------------
When using SLOC to assess different projects written in different
---------------------- programming languages, it cannot be taken directly. This is because
different programming languages can take more/less lines to do the same
----------------------
functions. The measure of number of lines of code need to be condensed/
---------------------- expanded so more meaningful values can be assessed. The use of function
points would give a better indication because the number of function
---------------------- points would remain the same (i.e., a function point may take 10 lines
in C# and 30 lines in FORTRAN but there still is only one function).
----------------------
Since the number of lines of code would be different, even for the same
---------------------- functionality, the effort required would be completely different.
When comparing projects by using SLOC, it is far more useful if there are
----------------------
orders of magnitudes between them.
---------------------- There are two ways to measure lines of code:
---------------------- 1. Physical SLOC = Lines of source code + Comments + Blank lines1
---------------------- 2. Logical SLOC = Number of lines of functional code (“statements”)
1
if blank lines are less the 25% of the section.
----------------------
Names of SLOC measures:
---------------------- • K-LOC – 1,000 Lines of Code
---------------------- • K-DLOC - 1,000 Delivered Lines of Code
• K-SLOC - 1,000 Source Lines of Code
----------------------
• M-LOC - 1,000,000 Lines of Code
---------------------- • G-LOC - 1,000,000,000 Lines of Code
---------------------- • T-LOC - 1,000,000,000,000 Lines of Code
[K – Kilo, M – Mega, G – Giga, T – Tera]
----------------------
• Function points
---------------------- The function point metric was described by Alan J. Albrecht in 1979 at IBM
---------------------- and its official release was in 1984 for the community. This is a relatively
old technique for measurement of certain software module or property.
---------------------- Function Point Analysis (FPA) is a technique accepted by International
Organisation for Standardisation (ISO) for measuring functional size
---------------------- of Information Systems (IS). Function point is a measurement unit or
---------------------- software metric for FPA that is the end-user analysis of the functions
needed for the software. FPA does not take into an account technology
---------------------- used for the software project, programming language or tools. Function
points are grouped into five types of functionality:
42 Software Engineering with UML
 Internal logical files – logical data that is nurtured inside the Notes
application.
----------------------
 External interface files – logical data that resides outside the

application but is restrained with the application that is measured. ----------------------
 External input – preservation, management and processing of

----------------------
logical data through external input, through peripherals and other
sources. ----------------------
 External output – logical output of data by application.
----------------------
 External inquiries – requests and responses for external data
procedures. ----------------------

Each of these types of functionality is given a metric called weighting ----------------------


factor. Those weighted functions are known as Unadjusted Function
Points (UFPs). Reviewing 14 General System Characteristics (GSCs) and ----------------------
summing those assessed GSCs, we get Degree of Influence (DI). Technical ----------------------
Complexity Factor (TCF) is 0.65 + 0.01 * DI, further Function Points are
calculated UFPs * TCF. Implementation of function point metrics is a ----------------------
very effective way to measure the size of the software at the beginning
of the development phase after establishing needs and requirements of ----------------------
the software. Since late 70s up till now, software engineering has been ----------------------
developing and many of the function points have been outdated or less
relevant to modern software development moving from procedural ----------------------
programming practice to object oriented.
----------------------
• Objects
----------------------
In software development, there is a need for application extensibility
and software reuse. Object- oriented languages like Java and C++ makes ----------------------
it possible to develop applications that are easy to change, add a new
functionality by reusing existing resources. By the reuse of existing ----------------------
resources we have to manage dependencies that are between modules
----------------------
of the application and cause of the changes that may arise through the
dependencies. These factors are described as software package metrics ----------------------
that are derived from:
----------------------
 Class cohesion: A measurement for the unity of purpose in the

object or class; elements within the class or object should make as ----------------------
much purpose as possible.
----------------------
 Coupling: Dependency that is between two or more classes is

heavily related together. Changing one class may force drastic ----------------------
changes in other classes that are highly coupled together. Low
coupling is when changing one class does not require changes in ----------------------
another classes or modules because modules communicate together ----------------------
through well-established interfaces.
 Cardinality: Number of objects in the relationship between classes. ----------------------

----------------------

Software Project Planning and Estimation 43


Notes  Open-Closed Principle (OCP): One of the most important

principles of object-oriented design. OCP means opened for module
---------------------- extension and closed from modification (changing the source code
of the module).
----------------------
 Single responsibility: Changes may occur in the class domain

---------------------- logic or format. We need to minimise those reasons by separating
the class into two or more classes, if we need to introduce a change.
----------------------
This change would not affect the whole class or module if placed
---------------------- into two separate responsibilities.
 Dependency Inversion Principle (DIP) or inversion of control:

----------------------
Dependency upon abstraction but not upon concretion. Every
---------------------- dependency should target interface or abstract class.
 Interface segregation principle: Creation of many client specific

----------------------
interfaces is better than general purpose interface. This is because
---------------------- many clients depend on the functions of the same class that require
change and recompilation of the project.
----------------------
 Listkov substitution principle: Subclasses or derived classes

---------------------- should be substitutable for their base classes; the user of the base
class should function if the derived class of the base class is passed
---------------------- to the base class.
---------------------- There are many other principles that make up software package metrics
that define measure.
----------------------
• GUI features
----------------------
Since the 70s and 80s when command line interfaces were dominant,
---------------------- things started to change with Windows, Icons, Menus and Pointing
devices. WIMP and Graphical User Interface (GUI) substituted consol
---------------------- input in the late 80s. It is very difficult to measure the functionality of the
application vs. GUI. All depends on how efficiently algorithms that solve
----------------------
the problem are implemented to add a new functionality. Significance
---------------------- of the lines contained in the software or lines written is not too much.
Developers working on the project write on average 10 to 15 lines a day.
---------------------- The real importance is what those lines offer to the user, what functionality
do they provide behind the graphical interface.
----------------------
• I t is very difficult to measure GUI metrics because user interfaces have
---------------------- special characteristics. Visibility in design plays a very important role.
Functions should be visible for users, easy to find and predict the steps
----------------------
that follow on basis of common sense.
---------------------- • F
 eedback on the notion of visibility, how long should we wait for the

---------------------- response, e.g., pressing the button.


• C
 onstraint is a graphical design principle of restraining users from
---------------------- performing particular operations, fading out options on the menu or
---------------------- restricting access to other graphical representations. This minimises
making a wrong choice.
44 Software Engineering with UML
• C
 onsistency is an operation that uses similar elements for achieving Notes
similar tasks.
----------------------
• A
 ffordance is an important feature of the design of GUI that is obvious for
the user to know how to use the application, e.g., button is highlighted while ----------------------
moving over the mouse pointer. For the user, it is fairly understandable
that it is the operation of pressing on it. ----------------------
2.4.2 Productivity Projection ----------------------
The different productivity projection methods are discussed below.
----------------------
Software engineering productivity
----------------------
Projecting productivity is all about measurements. In general, these
measurements involve the rate at which a software engineer produces software ----------------------
and the accompanied documentation. While quality is also an important aspect
of the produced software, the measurement is not quality oriented. In essence, ----------------------
the goal is to measure the useful functionality produced in a unit of time. ----------------------
Productivity metrics
----------------------
Metrics on productivity are divided into two main categories:
----------------------
1. Size of product based on some output from the software process, i.e.,
lines of delivered source code, object code instructions, etc. ----------------------
2. Function-related measurements based on the functionality of the ----------------------
deliverables. This is expressed in function points.
Function points ----------------------

Function points are determined on the basis of a combination of programmer ----------------------


characteristics, such as external inputs and outputs, user interactions, external
interfaces and files used by the system followed by associating a weight with ----------------------
each of these characteristics. Finally, a “function point count” is computed by ----------------------
multiplying each raw count by the weight and summing all values.
----------------------
Challenges in software metrics
The biggest challenge that lie in measures is mainly the estimation process of ----------------------
the size, the total elapsed time assigned to programming. In addition, it can be
----------------------
difficult to define elements such as “a line of code”, “programs to determine
part of the system”. ----------------------
Quality and productivity
----------------------
Although metrics can provide estimates for productivity, they usually do not
take quality into account. One can write thousands lines of working code, but ----------------------
the challenge remains to determine how to measure the quality of this code in ----------------------
regard to productivity.
----------------------

----------------------

----------------------

Software Project Planning and Estimation 45


Notes
Check your Progress 3
----------------------
State True or False.
----------------------
1. Metrics are used to maintain control over the software development
---------------------- process.
---------------------- 2. SLOC gives the size of the project by counting all the words of source
code in a project.
----------------------
3. Coupling represents independency between two or more classes that
---------------------- are heavily related together.

----------------------
2.5 COST ESTIMATION
----------------------

---------------------- A cost estimate is the approximation of the cost of a program, project


or operation. The cost estimate is the product of the cost estimating process.
---------------------- The cost estimate has a single total value and may have identifiable component
values. A problem with a cost overrun can be avoided with a credible, reliable
---------------------- and accurate cost estimate. An estimator is the professional who prepares cost
---------------------- estimates.
2.5.1 Decomposition
----------------------
Cost estimations in general are based on a form of reference data also
---------------------- known as analogy data. This reference data can be data from previous successful
projects, consultancy data, available models such as mathematical relationships
---------------------- or parametric cost models, and rules-of-thumb in software cost estimations. The
---------------------- apply factor of these forms of data depends on the current stage in the software
life cycle. A combination of these methods can be especially useful in the early
---------------------- conceptual stages of development when available models are combined with
high-level reference data which provide a general concept overview. When the
---------------------- requirements and design become clearer in a later stage of the project, more
---------------------- specified functional decompositions are likely to become the main method of
cost estimation.
----------------------
2.5.2 Effort Estimation
---------------------- In order make a correct estimate of the costs involved in a project, it is
important to make a breakdown of the required work elements. A good tool to
----------------------
do this could be the application of a Work Breakdown Structure (WBS).
---------------------- The planner estimates the effort (e.g., person-months) that will be required
---------------------- to accomplish each software engineering tasks for each software function.
These data comprise the central matrix of the effort table. Labour rates (i.e.,
---------------------- cost/unit effort) are applied to each of the software engineering tasks. It is very
likely the labour rate will vary for each task. Senior staff is heavily involved
---------------------- in requirements analysis and early design tasks; junior staff (inherently less
---------------------- costly) is involved in later design tasks, code and early testing.

46 Software Engineering with UML


2.5.3 Expert Judgement Notes
Suitable domain experts provide estimates for fine-grained tasks, and
----------------------
using suitable software and statistical tools a reliable measurement is achieved.
The emphasis is on the knowledge and experience of the expert. ----------------------
Categorise expert judgement as either intuitive or structured. Intuitive
----------------------
expert judgement relies solely on the experience and opinion of the expert.
Structured judgement for cost estimation also relies on expert knowledge but ----------------------
validates estimates using historical data and statistical tools.
----------------------
At the task level, work breakdown structures are often used to achieve a
high degree of granularity of tasks. The chosen expert then provides a range of ----------------------
estimated values for the task (actual, best case, worst case). Various statistical
formulas are applied to these measures to ensure a reasonable result. ----------------------
Jorgensen proposes the following steps for estimation experts: ----------------------
1. Evaluate estimation accuracy, but avoid high evaluation pressure. ----------------------
2. Avoid conflicting estimation goals.
----------------------
3. Ask the estimators to justify and criticise their estimates.
----------------------
4. Avoid irrelevant and unreliable estimation information.
5. Use documented data from previous development tasks. ----------------------
6. Find estimation experts with relevant domain background and good ----------------------
estimation records.
----------------------
7. Estimate top-down and bottom-up independently of each other.
----------------------
8. Use estimation checklists.
9. Combine estimates from different experts and estimation strategies. ----------------------
10. Assess the uncertainty of the estimate. ----------------------
11. Provide feedback on estimation accuracy and development task relations. ----------------------
12. Provide estimation of training opportunities.
----------------------
2.5.4 Estimation by Analogy
----------------------
Use Estimation by Analogy (EBA) to identify completed projects and
features that are similar to a new project and use that historical data to create ----------------------
estimates for the cost and effort of a newer project.
----------------------
EBA hinges on identifying the “analogies” between previous projects
and planned projects. Some software applications exist which can help identify ----------------------
such projects (e.g., The ANGEL Project). By identifying a feature or component
that is of similar complexity to a previous feature, and making a reasonable ----------------------
judgement on the relative sizes of the feature, an estimation can be arrived at.
----------------------
Steve McConnell outlines a five-step approach to EBA for a new project as
follows: ----------------------
1. Get detailed size, effort and cost results for a similar previous project. ----------------------

Software Project Planning and Estimation 47


Notes 2. Compare the size of the new project to a similar past project.
3. Build up the estimate for the new project’s size as a percentage of the old
----------------------
project’s size.
---------------------- 4. Create an effort estimate based on the size of the new project compared to
the previous project.
----------------------
5. Check for consistent assumptions across the old and new projects.
----------------------
A few key factors govern the accuracy of estimates:
---------------------- • B
 reak down the project into relatively detailed features. Measuring too
---------------------- few features will not provide enough accuracy, too much detail meanwhile
risks introducing extraneous elements into the model.
---------------------- • J udgment is required when calculating comparisons. Measurements of
---------------------- completed projects may need to be adjusted to account for complexity,
ability or other facts that had a bearing on the outcome of that project.
----------------------
• M
 cConnell stresses that you should resist the temptation to inflate
---------------------- estimates to accommodate inherent inaccuracy in estimates. For example,
if your estimates suggest a figure between 40 and 50 weeks, resist the
---------------------- temptation to communicate an effort of 55 weeks.
---------------------- 2.5.5 Cost Estimation Tools

---------------------- It is estimated that there has been 75 major software cost estimation tools
produced over the last decade.
---------------------- Some software measurement tools are listed below:
---------------------- • T
 he COCOMO site provides various tools that support COCOMO based
measurement.
----------------------
• T
 he ANGEL project from Bournemouth University. Based on research on
---------------------- Analogy method of estimation. The version of the software currently on
the site required JDK 1.4 to install but will run with Java 1.4 and above.
----------------------
To get around this problem do the following:
---------------------- • Save the angel.jar installation file to a directory.
---------------------- • Extract the contents using the command.
jar xf angel.jar.
----------------------
• Locate the file copy.jar that was extracted using the previous
---------------------- command.
---------------------- • Extract the contents of copy.jar using the command.
jar xf copy.jar.
----------------------
• Locate the bin directory and in there you will find batch files and
---------------------- shell scripts for running ANGEL.
---------------------- • NASA’s NASA Cost Estimation Website provides various cost estimation
models. While heavily focused on aerospace and aeronautics, it is still
---------------------- worth looking over.

48 Software Engineering with UML


• QSM provides a suite of products for software products called SLIM Notes
tools. QSM is one of the leading providers of commercial software
measurement tools. ----------------------

----------------------
Check your Progress 4
----------------------
Fill in the blanks.
----------------------
1. Cost estimations in general are based on a form of reference data also
known as ________. ----------------------
2. Structured judgement for cost estimation also relies on _________
----------------------
but validates estimates using historical data and statistical tools.
3. The __________ has a single total value and may have identifiable ----------------------
component values. ----------------------

----------------------
Activity 2
----------------------
Find and list the cost estimation tools used in your organisation. ----------------------

----------------------
Summary
----------------------
•  roject scope is the part of project planning that involves determining
P
and documenting a list of specific project goals, deliverables, tasks and ----------------------
deadlines. ----------------------
• Scope management process for a project includes collecting the
----------------------
requirements, defining the scope, creating Work Breakdown Structure
(WBS), verifying the scope, controlling the scope. ----------------------
• To set clear and precise objective, the SMART technique can be used.
----------------------
•  ffective software project estimation is one of the most challenging and
E
important activities in software development. Proper project planning and ----------------------
control is not possible without a sound and reliable estimate.
----------------------
• The four basic steps in software project estimation are:
----------------------
 Estimate the size of the development product. This generally ends
up in either Lines of Code (LOC) or Function Points (FP), but there ----------------------
are other possible units of measure.
 Estimate the effort in person-months or person-hours. ----------------------
 Estimate the schedule in calendar months. ----------------------
 Estimate the project cost in dollars (or local currency).
----------------------
•  oftware quality metrics are a subset of software metrics that focus on the
S
quality aspects of the product, process and project. In general, software ----------------------
quality metrics are more closely associated with process and product
----------------------
metrics than with project metrics.

Software Project Planning and Estimation 49


Notes • Types of Metrics are process metrics, product metrics and project metrics.
•  alstead complexity metrics were developed by the late Maurice Halstead
H
----------------------
as a means of determining a quantitative measure of complexity directly
---------------------- from the operators and operands in the module to measure a program
module’s complexity directly from source code.
----------------------
•  he cyclomatic (McCabe’s) complexity of a section of source code is
T
---------------------- the count of the number of linearly independent paths through the source
code.
----------------------
•  etrics are used to maintain control over the software development
M
---------------------- process. It allows managers to manage resources more efficiently so the
overall team would be more productive.
----------------------
•  LOC gives the size of the project by counting all the lines of source code
S
---------------------- in a project.

---------------------- •  unction point is a measurement unit or software metric for FPA that is
F
the end-user analysis of the functions needed for the software.
---------------------- •  cost estimate is the approximation of the cost of a program, project or
A
---------------------- operation. The cost estimate is the product of the cost estimating process.
The cost estimate has a single total value and may have identifiable
---------------------- component values.
---------------------- •  se Estimation by Analogy (EBA) to identify completed projects and
U
features that are similar to a new project and use that historical data to
---------------------- create estimates for the cost and effort of a newer project.
----------------------
Keywords
----------------------
•  oftware scope: It describes the data and control to be processed,
S
---------------------- function, performance, constraints, interfaces and reliability.
---------------------- • SMART: Specific, Measurable, Achievable, Realistic and Time bound.
---------------------- •  stimation by Analogy: It is used to identify completed projects and
E
features that are similar to a new project and that historical data is used to
---------------------- create estimates for the cost and effort of a newer project.
----------------------
Self-Assessment Questions
----------------------
1. Explain the different metrics in project estimation.
----------------------
2. Discuss McCabe’s complexity metric software project estimation.
---------------------- 3. What are the different cost estimation tools? Explain.
---------------------- 4. What do you understand by software scope? Explain the types of scope.
----------------------

----------------------

50 Software Engineering with UML


Answers to Check your Progress Notes
Check your Progress 1 ----------------------
Fill in the blanks. ----------------------
1. 
Project scope is the part of project planning that involves determining
and documenting a list of specific project goals, deliverables, tasks and ----------------------
deadlines. ----------------------
2. To set clear and precise objective, SMART technique can be used.
----------------------
Multiple Choice Multiple Response
----------------------
1. Types of scope are:
i. Project scope ----------------------
ii. Product scope ----------------------
Check your Progress 2 ----------------------
Multiple Choice Multiple Response.
----------------------
1. The basic steps in software project estimation are:
----------------------
ii. Estimate the effort in person-months or person-hours.
iii. Estimate the schedule in calendar months. ----------------------

iv. Estimate the project cost in dollars (or local currency). ----------------------
Fill in the blanks. ----------------------
1. 
Project metrics are the measures of software project and are used to
----------------------
monitor and control the project.
2. 
Product metrics are measures of the software product at any stage of its ----------------------
development, from requirement to installed system.
----------------------
Check your Progress 3
----------------------
State True or False.
1. True ----------------------

2. False ----------------------
3. False ----------------------
Check your Progress 4
----------------------
Fill in the blanks.
----------------------
1. Cost estimations in general are based on a form of reference data also
known as analogy data. ----------------------
2. Structured judgement for cost estimation also relies on expert knowledge ----------------------
but validates estimates using historical data and statistical tools.
----------------------
3. The cost estimate has a single total value and may have identifiable
component values. ----------------------

Software Project Planning and Estimation 51


Notes
Suggested Reading
----------------------
1. 
Stellman, Andrew and Jennifer Greene. Applied Software Project
---------------------- Management. O’Reilly Media.

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

52 Software Engineering with UML


System Engineering and Business Process Engineering
UNIT

3
Structure:

3.1 Introduction
3.2 Computer-Based Systems
3.3 The System Engineering Hierarchy
3.3.1 Business Process Engineering
3.4 Product Engineering
3.5 Requirements Engineering
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

System Engineering and Business Process Engineering 53


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Explain the concept of computer-based systems
----------------------
• Discuss the concept of business process and product engineering
---------------------- • Understand requirements engineering model
----------------------

---------------------- 3.1 INTRODUCTION


---------------------- A system is a set of interacting or interdependent components forming
an integrated whole. Every system is delineated by its spatial and temporal
----------------------
boundaries, surrounded and influenced by its environment, described by
---------------------- its structure and purpose and expressed in its functioning. Fields that study
the general properties of systems include systems science, systems theory,
---------------------- systems modeling, systems engineering, cybernetics, dynamical systems,
thermodynamics, complex systems, systems analysis and design and systems
----------------------
architecture. They investigate the abstract properties of systems’ matter and
---------------------- organisation, looking for concepts and principles that are independent of domain,
substance, type or temporal scale. Some systems share common characteristics
---------------------- including:
---------------------- • A
 system has structure; it contains parts (or components) that are directly
or indirectly related to each other.
----------------------
• A
 system has behaviour; it exhibits processes that fulfill its function or
---------------------- purpose.

---------------------- • A
 system has interconnectivity; the parts and processes are connected by
structural and/or behavioral relationships.
---------------------- • A
 system’s structure and behaviour may be decomposed via subsystems
---------------------- and sub-processes to elementary parts and process steps.
• A
 system has behaviour that, in relativity to its surroundings, may be
----------------------
categorised as both fast and strong.
---------------------- The term system may also refer to a set of rules that governs structure
and/or behaviour. Alternatively, and usually in the context of complex social
----------------------
systems, the term institution is used to describe the set of rules that govern
---------------------- structure and/or behaviour. In this unit, we will discuss the concepts of computer-
based systems and the points related to systems engineering and requirements
---------------------- engineering.
----------------------
3.2 COMPUTER-BASED SYSTEMS
----------------------
A computer-based system is essentially an information system using computer
---------------------- technology to carry out some or all of its planned tasks. The basic components

54 Software Engineering with UML


of computer-based information systems are: Notes
•  ardware: These are the devices like the monitor, processor, printer and
H
----------------------
keyboard, all of which work together to accept, process, show data and
information. ----------------------
•  oftware: These are the programs that allow the hardware to process the
S
----------------------
data.
•  atabases: These are the gathering of associated files or tables containing
D ----------------------
related data.
----------------------
•  etwork: It is a connecting system that allows diverse computers to
N
distribute resources. ----------------------

•  rocedures: These are the commands for combining the components


P ----------------------
above to process information and produce the preferred output.
----------------------
The first four components (hardware, software, database and network)
make up what is known as the information technology platform. Information ----------------------
technology workers could then use these components to create information
systems that watch over safety measures, risk and the management of data. ----------------------
These actions are known as information technology services. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 3.1: A Computer-Based System ----------------------
Certain information systems support parts of organisations; others support
----------------------
entire organisations, and still others, support groups of organisations. Recall
that each department or functional area within an organisation has its own ----------------------

System Engineering and Business Process Engineering 55


Notes collection of application programs or information systems. These Functional
Area Information Systems (FAIS) are supporting pillars for more general IS
---------------------- namely, business intelligence systems and dashboards.
---------------------- As the name suggests, each FAIS supports a particular function within
the organisation, e.g., accounting IS, finance IS, Production/Operation
---------------------- Management (POM) IS, marketing IS and human resources IS. In finance and
accounting, managers use IT systems to forecast revenues and business activity,
----------------------
to determine the best sources and uses of funds, and to perform audits to ensure
---------------------- that the organisation is fundamentally sound and that all financial reports and
documents are accurate.
----------------------
Other types of organisational information systems are
---------------------- ●● transaction processing systems,
●● enterprise resource planning,
----------------------
●● office automation system,
---------------------- ●● management information system,
●● decision support system,
----------------------
●● expert system,
---------------------- ●● executive dashboard,
●● supply chain management system and electronic commerce system.
----------------------
Dashboards are a special form of IS that support all managers of the
---------------------- organisation. They provide rapid access to timely information and direct
access to structured information in the form of reports. Expert systems attempt
---------------------- to duplicate the work of human experts by applying reasoning capabilities,
knowledge and expertise within a specific domain.
----------------------
Mainly, the usages of these elements are described as:
----------------------
•  rocedures: These are the steps which define the specific use of each
P
---------------------- system element or the procedural context in which the system resides.
---------------------- •  ocumentation: It is the descriptive information that portrays the use
D
and operation of the system.
----------------------

---------------------- Check your Progress 1

---------------------- Fill in the blanks.


---------------------- 1. ___________ are the steps which define the specific use of each
system element or the procedural context in which the system resides.
----------------------
2. ___________ is the descriptive information that portrays the use and
---------------------- operation of the system.
---------------------- 3. ___________ may also refer to a set of rules that governs structure
and/or behaviour.
----------------------
4. 
A _____________ is essentially an information system using
---------------------- computer technology.

56 Software Engineering with UML


Notes
Match the following.
----------------------
i. Hardware a. Commands for combining the components to
process information and produce the output. ----------------------
ii. Software b. Connecting system that allows diverse computers
to distribute resources. ----------------------
iii. Databases c. Gathering of associated files or tables containing
----------------------
related data.
iv. Networks d. Programs that allow the hardware to process the ----------------------
data.
v. Procedures e. Devices which work together to accept, process, ----------------------
show data and information.
----------------------

----------------------
3.3 THE SYSTEM ENGINEERING HIERARCHY
----------------------
System engineering is an interdisciplinary field of engineering that
focuses on how to design and manage complex engineering systems over their ----------------------
life cycles. Issues such as reliability, logistics and coordination among different
teams (requirements management), evaluation measurements, and other ----------------------
disciplines become more difficult when dealing with large or complex projects. ----------------------
System engineering deals with work processes, optimisation methods and risk
management tools in such projects. It overlaps technical and human-centred ----------------------
disciplines, such as control engineering, industrial engineering, organisational
studies and project management. System engineering ensures that all likely ----------------------
aspects of a project or system are considered and integrated into a whole. ----------------------
Regardless of its domain of focus, system engineering encompasses a
----------------------
collection of top-down and bottom-up methods to navigate the hierarchy. The
system engineering process usually begins with a “world view,” that is, the ----------------------
entire business of product domain is examined to ensure that the proper business
or technology context is established. The world view is refined to focus more ----------------------
fully on specific domain of interest.
----------------------
Within a specific domain, the need for targeted system elements (e.g.,
data, software, hardware, and people) is analysed. Finally, the analysis design ----------------------
and construction of a targeted system element is initiated. At the top of the
----------------------
hierarchy, a very broad context is established and at the bottom, detailed
technical activities performed by the relevant engineering discipline (e.g., ----------------------
hardware or software engineering) are conducted.
----------------------
The system engineering process begins with a world view, the business
or product domain is examined in order to ensure that the proper business ----------------------
or technology context can be established. The world view is mainly refined
to focus on a specific domain of interest, within a specific domain; the need ----------------------
for targeted system elements is analysed. Finally, the analysis, design and
----------------------
construction of targeted system elements are initiated. At the world view level,
a very broad context is established. Moreover, at the bottom level, detailed ----------------------

System Engineering and Business Process Engineering 57


Notes technical activities are conducted by the relevant engineering discipline such as
software engineering.
----------------------
The key to system engineering is a clear understanding of context. For
---------------------- software development this means creating a “world view” and progressively
narrowing its focus until all technical detail is known.
----------------------
In software engineering there is rarely one right way of doing something.
---------------------- Instead, designers must consider the tradeoffs present in the feasible solutions
and select one that seems advantageous for the current problem. This section lists
---------------------- several factors that need to be examined by software engineers when evaluating
alternative solutions (assumptions, simplifications, limitations, constraints and
----------------------
preferences).
---------------------- Regardless of its domain of focus, system engineering encompasses a
collection of top-down and bottom-up methods to navigate the hierarchy
----------------------
illustrated below:
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 3.2: System Engineering Hierarchy
----------------------
3.3.1 Business Process Engineering
---------------------- Business process engineering is a way in which organisations study their
current business processes and develop new methods to improve productivity,
----------------------
efficiency and operational costs. The following are its important aspects:
---------------------- •  ses an integrated set of procedures, methods and tools to identify how
U
---------------------- information systems can best meet the strategic goals of an enterprise.
• Focusses first on the enterprise and then on the business area.
----------------------
• Creates enterprise models, data models and process models.
----------------------
•  reates a framework for better information management distribution and
C
---------------------- control.

58 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 3.3: Business Process Engineering Hierarchy
----------------------
3.4 PRODUCT ENGINEERING
----------------------
Product engineering makes the customer’s desire for the set of defined ----------------------
capabilities into a resulting working product. This goal is achieved by
establishing product architecture and a support infrastructure. The product ----------------------
architecture components mainly consist of people, hardware, software and
data. Also, the support infrastructure includes the technology required to tie the ----------------------
components together and the information to support the components. ----------------------
Requirements engineering elicits the requirements from the customer
and allocates function and behaviour to each of the four components. System ----------------------
component engineering happens next as a set of concurrent activities that ----------------------
address each of the components separately.
– Each component takes a domain-specific view but maintains ----------------------
communication with other domains. ----------------------
– The actual activities of the engineering discipline takes on an element
----------------------
view.
•  nalysis modeling allocates requirements into function, data and
A ----------------------
behaviour.
----------------------
•  esign modeling maps the analysis model into data/class, architectural,
D
interface and component design. ----------------------

----------------------

----------------------

----------------------

----------------------

System Engineering and Business Process Engineering 59


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 3.4: Product Engineering Hierarchy
----------------------
Check your Progress 2
----------------------

---------------------- Fill in the blanks.

---------------------- 1. __________ is an interdisciplinary field of engineering.


2. The key to system engineering is a clear understanding of __________.
----------------------
3. _____________ is a way in which organisations study their current
---------------------- business processes.
---------------------- 4. ______________modeling maps the analysis model into data/class.

----------------------

----------------------
3.5 REQUIREMENTS ENGINEERING
----------------------
The process of requirements engineering is regarded as one of the most
---------------------- important aspects of building a software system. Within a software development
project, across all phases, it specifically deals with all the activities related to
---------------------- requirements. It is an integral part of the Software Development Life Cycle
---------------------- (SDLC) under the software development and software project management
processes and is based on the use of various methodologies, tools and techniques
---------------------- of software engineering.
---------------------- The broad spectrum of tasks and techniques that lead to an understanding
of requirements is called requirements engineering. From a software process
---------------------- perspective, requirements engineering is a major software engineering action
that begins during the communication activity and continues into the modeling
----------------------
activity. It must be adapted to the needs of the process, the project, the product,
---------------------- and the people doing the work. Requirements engineering builds a bridge to
design and construction.
----------------------

60 Software Engineering with UML


Essentially, the requirements engineering phase occurs at the beginning of Notes
the software development life cycle; however, depending on the SDLC process
model adopted, its scope extends beyond the initial phases throughout the ----------------------
lifetime of the system. It requires competencies related to product development
techniques, project management skills and people management skills besides ----------------------
understanding of software process management. ----------------------
The process of requirements engineering, which makes use of various
----------------------
tools, techniques and methodologies, must be adapted to the needs of the specific
process model used, project, product, or people doing the work. Generally, the ----------------------
process of requirements engineering involves chronological process steps and
related activities which may involve several iterations depending on the type of ----------------------
the system being developed and the SDLC process model being followed.
----------------------
Renowned experts in the domain of software such as Gerald Weinberg,
Roger Pressman and Barry Boehm have suggested several approaches and ----------------------
models to describe the process of requirements engineering for gathering and
----------------------
understanding software requirements and preparing specifications. For example,
Gerald Weinberg has suggested the requirement engineering steps for analysing ----------------------
requirements as shown in Figure 3.5 below.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 3.5: Weinberg’s Steps in Analysing Requirements ----------------------
Similarly, Roger Pressman has suggested the requirements engineering
----------------------
steps as shown in Figure 3.6 below.
----------------------

----------------------

----------------------

----------------------

----------------------

System Engineering and Business Process Engineering 61


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 3.6: Pressman’s Requirements Engineering Steps
----------------------
Pressman’s steps include requirement elicitation (understanding what the
---------------------- customer wants), requirement analysis and negotiation (analysing needs and
negotiating a reasonable solution), requirement specification (specifying the
----------------------
solution unambiguously), system modeling, requirement validation (validating
---------------------- the specification) and requirement management.

---------------------- Finally, the requirements engineering steps suggested by Barry Boehm are as
shown in Figure 3.7 below.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

62 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Fig. 3.7: Boehm’s Requirements Engineering Steps ----------------------


In Boehm’s model, win conditions, negotiation, mutual gain, tradeoffs ----------------------
and win-win agreements are taken into account for prioritising requirements
and preparing the requirements specification activities. ----------------------

For the purpose of our discussion and understanding, listed below are the ----------------------
process steps and the related activities of requirements engineering based on
the above models. ----------------------

i. Requirements elicitation: This process step broadly involves the ----------------------


requirements inception, requirements identification and requirements
elicitation activities. ----------------------

•  equirements inception relates to the use of context-free questions


R ----------------------
to establish a basic understanding of the problem, the people who
----------------------
want the solution, the overall nature of the solution expected, and for
gauging the effectiveness of the collaboration between customers ----------------------
and developers.
----------------------

System Engineering and Business Process Engineering 63


Notes •  equirements identification involves enlisting and articulating the
R
basic well-known and fairly defined needs.
----------------------
•  equirements elicitation refers to finding out or extracting from the
R
---------------------- clients/users requirements which are unclear, vague or concealed
and need explicit articulation for the understanding of the developer
---------------------- team. This phase also covers aspects, such as what the overall
product/solution objectives are, which needs are to be supported on
----------------------
priority, how the product/solution fits into business needs, and what
---------------------- kind of use will be made of the product/solution on a day-to-day
basis.
----------------------
ii. Requirements analysis: This process step broadly involves the
---------------------- requirements elaboration, requirements analysis and requirements
negotiation activities.
----------------------
•  equirements elaboration focuses on the development of a refined
R
---------------------- technical model of software functions, user interactions, features
and constraints based on the requirement elicitation information.
----------------------
•  equirements analysis involves prioritising the requirements,
R
---------------------- preparing a checklist for each requirement, highlighting and
reviewing problems, breaking down requirements into suitable
---------------------- level of detail comprehendible to developers, arriving at a high
---------------------- level of abstract of the product/solution.
•  equirements negotiation involves checking requirements and
R
---------------------- resolving stakeholder/user conflicts involving requirements
---------------------- categorisation and organisation into subsets, establishing
relationship among requirements, reviewing requirements for
---------------------- correctness, confirmation of requirement priority based on customer
needs.
----------------------
iii. Requirements specification: This process step broadly involves
---------------------- requirements specification and system modeling activities.
---------------------- •  equirement specification refers to the documentation of the
R
requirements in a software requirements specification document
---------------------- which is a written work product, based on several well-defined
standards and formats, describing the function, performance and
----------------------
development constraints of the product/solution.
---------------------- •  ystem modeling involves creation of models depicting the various
S
requirements at various levels of details using entity relationship
----------------------
diagrams, data flow diagrams, state transition diagrams, activity
---------------------- diagrams, and use-case diagrams, often using a notation such as the
unified modeling language. System models aid in communication
---------------------- and seeking confirmation of clients/users on the completeness and
prioritisation of requirements, the functions and behaviour of the
----------------------
proposed product/solution, the logical structure of data, data flows
---------------------- and the relationship between entities of the system.

64 Software Engineering with UML


iv. Requirements validation and verification: This process step broadly Notes
involves requirements validation and requirements verification activities.
----------------------
•  equirements validation involves the conduction of formal
R
technical reviews to examine and conform that each of the work ----------------------
products after development adhere to the quality norms as per the
respectively specified requirement and that all the work products ----------------------
conform to the overall standards defined at the process, project and
----------------------
the product level.
•  equirements verification involves checking that the documented
R ----------------------
software requirements specification and system models which were
----------------------
arrived at, at the end of the requirement specification phase are
consistent and meet stakeholder/client end-user needs. ----------------------
v. Requirements management: This process step broadly involves
----------------------
requirements change control, requirements tracing, requirements version
control and requirements status tracking activities. These generally relate ----------------------
to sets of activities that help project team to identify, control and track
requirements and changes as project proceeds. ----------------------
•  equirements change control involves receiving requirements
R ----------------------
change proposals after the system is developed and put into use,
analysing their impacts and updating the requirement documents ----------------------
after approval. ----------------------
•  equirements tracing involves identifying requirements in the
R
requirement documents, tagging them with a unique identifier, ----------------------
classifying them by their type (e.g., functional, data, behavioural, ----------------------
interface or output), defining links between the requirement
documents and the system elements, creating the traceability tables ----------------------
(e.g., features, source, dependency, subsystem, interface) and
finally updating the traceability tables whenever requirements are ----------------------
modified. ----------------------
•  equirements version control involves defining the version
R
identification scheme for the set of requirements in the requirements ----------------------
document, identifying version for each requirement and updating ----------------------
them whenever requirements are modified or new ones added.
----------------------
•  equirements status tracking involves defining the status of
R
requirements based on their implementation in the final product/ ----------------------
solution, recording the status updates when requirements are met in
the latest versions of the final product/solution and preparing status ----------------------
reports for intimation of all concerned with the project.
----------------------

----------------------

----------------------

----------------------

System Engineering and Business Process Engineering 65


Notes
Check your Progress 3
----------------------

---------------------- State True or False.


1. Requirements version control involves defining the version
----------------------
identification scheme.
---------------------- 2. The process of requirements engineering is regarded as one of the
most important aspects of building a software system.
----------------------
3. Requirements inception relates to the use of context-full questions.
----------------------
4. Requirements analysis involves non-prioritising the requirements.
---------------------- 5. System modeling involves creation of models depicting the various
---------------------- requirements.

----------------------
Activity 1
----------------------

---------------------- Consider the library management system and gather the requirements of
the same and illustrate the various steps/methods used in its requirements
---------------------- engineering.
----------------------
Summary
----------------------

---------------------- •  he term system may refer to a set of rules that governs structure and/
T
or behaviour. Alternatively, and usually in the context of complex social
---------------------- systems, the term institution is used to describe the set of rules that govern
structure and/or behaviour.
----------------------
•  computer-based system is essentially an information system using
A
---------------------- computer technology to carry out some or all of its planned tasks.
•  ystem engineering deals with work processes, optimisation methods
S
----------------------
and risk management tools in projects. It overlaps technical and human-
---------------------- centred disciplines, such as control engineering, industrial engineering,
organisational studies and project management.
----------------------
•  he system engineering process begins with a world view, the business or
T
---------------------- product domain is examined in order to ensure that the proper business or
technology context can be established.
----------------------
•  usiness process engineering is a way in which organisations study
B
---------------------- their current business processes and develop new methods to improve
productivity, efficiency and operational costs.
---------------------- •  roduct engineering makes the customer’s desire for the set of defined
P
---------------------- capabilities into a resulting working product. This goal is achieved by
establishing product architecture and a support infrastructure. The product
---------------------- architecture components mainly consist of people, hardware, software
and data.
66 Software Engineering with UML
•  he process of requirement engineering, which makes use of various
T Notes
tools, techniques and methodologies, must be adapted to the needs of the
specific process model used, project, product or people doing the work. ----------------------

----------------------
Keywords
----------------------
•  ystem engineering: It uses a host of tools that include modeling and
S
simulation, requirements analysis and scheduling to manage complexity. ----------------------
•  roduct engineering: The process of designing and developing a device,
P ----------------------
assembly or system such that it can be produced.
----------------------
•  equirement engineering: It emphasises the use of systematic and
R
repeatable techniques that ensure the completeness, consistency and ----------------------
relevance of the system requirements.
----------------------

Self-Assessment Questions ----------------------

1. Explain the various steps of requirements engineering. ----------------------


2. 
Discuss the importance and relevance of various levels of system ----------------------
engineering hierarchy.
----------------------
3. State the various levels of product engineering.
4. Discuss the hierarchy of business process engineering. ----------------------

----------------------
Answers to Check your Progress
----------------------
Check your Progress 1
----------------------
Fill in the blanks.
----------------------
1. 
Procedures are the steps which define the specific use of each system
element or the procedural context in which the system resides. ----------------------
2. 
Documentation is the descriptive information that portrays the use and
----------------------
operation of the system.
3. 
System may also refer to a set of rules that governs structure and/or ----------------------
behaviour.
----------------------
4. A computer-based system is essentially an information system using
computer technology. ----------------------

Match the following. ----------------------


i. – e. ----------------------
ii. – d.
----------------------
iii. – c.
----------------------
iv. – b.
v. – a. ----------------------

System Engineering and Business Process Engineering 67


Notes Check your Progress 2
Fill in the blanks.
----------------------
1. System engineering is an interdisciplinary field of engineering.
----------------------
2. The key to system engineering is a clear understanding of context.
---------------------- 3. 
Business process engineering is a way in which organisations study their
---------------------- current business processes.
4. Design modeling maps the analysis model into data/class.
----------------------
Check your Progress 3
----------------------
State True or False.
---------------------- 1. True
---------------------- 2. True

---------------------- 3. False
4. False
----------------------
5. True
----------------------

---------------------- Suggested Reading


---------------------- 1. Sommerville, Ian. Software Engineering. Addison-Wesley.

---------------------- 2. 
Watson, Gregory H. Business Systems Engineering: Managing
Breakthrough Changes for Productivity and Profit. Wiley.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

68 Software Engineering with UML


System Modelling and UML - I
UNIT

4
Structure:

4.1 Introduction
4.2 System Modelling and Analysis
4.3 UML and UML Use Case-Driven Object-Oriented Analysis
4.3.1 Unified Modelling Language (UML)
4.3.2 UML Use Case-Driven Object-Oriented Analysis
4.3.3 Use-Case Diagram Components
4.3.4 Use Cases for Testing and Validation
4.4 Static Modelling using Class Diagram
4.4.1 Class Diagram
4.4.2 Relationships
4.5 Activity Diagram
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

System Modelling and UML - I 69


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Understand the basic concepts of system modelling
----------------------
• Explain the use of UML to do system analysis
---------------------- • Demonstrate use case diagram, class diagram and activity diagram
----------------------

---------------------- 4.1 INTRODUCTION


---------------------- Modelling is a central part of all the activities that lead up the deployment of
---------------------- good software. Models communicate the desired structure and behavior of a
system, we can visualize and control system’s architecture. Models are build
---------------------- to better understand the system we are building, often exposing opportunities
for simplification, reuse and manage risk.
----------------------
Developing a model is a creative work. System modelling helps analysts
---------------------- to understand the functionality of the system whereas models are used to
communicate with customers. An analyst is a person working on creating
---------------------- different models which help him to communicate with customers. The analyst
---------------------- has different perspectives. There are basic three types of perspectives. The first
is external perspective showing the systems context or environment. The second
---------------------- is the behavioural perspective showing the behaviour of the system, and the
third one is the structural perspective showing the system or data architecture.
----------------------

---------------------- 4.2 SYSTEM MODELLING AND ANALYSIS


---------------------- There are different types of models like data processing model that shows the
data is processed at different stages in a system; composition model shows
---------------------- how entities are composed of other entities; architectural model shows the
---------------------- principal subsystem; classification model shows how entities have common
characteristics; and response or stimulus model shows the system’s interaction
---------------------- with events.

---------------------- Context models: These are used to describe operational context of a system and
they clearly define the system boundaries by classifying external and internal
---------------------- entities. There are several social and organisational aspects which may cause
or affect the decision on where to position the system boundaries. Architectural
---------------------- models show the system and its relationship with other systems.
---------------------- Process models: Process models are useful for identifying different types
of processes within the system. These models are also useful for identifying
---------------------- and showing the different process that are supported by the system. Data flow
---------------------- models may be used to show the process and the flow of the information from
one process to another process.
----------------------

70 Software Engineering with UML


Behavioural models: These models are useful to depict and describe the Notes
overall behaviour of a system. There are two types of behavioural model;
one is data processing model and the other is state machine model. The data ----------------------
processing model shows how data is processed as it flows through the system.
Data processing models may be Data Flow Diagrams (DFDs) used to show the ----------------------
system’s data processing. DFD shows how the data flows through the system. ----------------------
It contains simple notations that the customer can understand easily. It shows
start to end data flow within a system. The state machine shows the system’s ----------------------
responses to events.
----------------------
There are two types of events within the system - external events and internal
events. It shows how the system will behave in response to these events. These ----------------------
state machines contain states as nodes and events as arcs between two nodes.
----------------------
When an event occurs, the system moves from one state to another state. These
two types describe different aspects of the system, so both are required to depict ----------------------
behaviour of a system.
----------------------
Semantic data models: Semantic data models are used to describe the logical
structure of data. It is like the entity-relation-attribute model. It is widely used ----------------------
in database design called ER diagrams. In Unified Modelling Language (UML),
there is no specific notation for this model. But object and its association model ----------------------
can be used to describe semantic data models.
----------------------
Object models: Object models are used to describe the system in terms of
object classes and their association. An object class is a logical construction ----------------------
over a set of objects with common attributes and operations. There are different
----------------------
types of relationships used in object models, such as generalisation, aggregation,
dependency and realisation. Different object models may be produced, such as ----------------------
inheritance models, aggregation models and interaction models. As we live in
the world of objects, these are the entities. An object model is a natural way of ----------------------
depicting the real-world entities within the system.
----------------------
So, a system model is an abstract view of the system. Different types of models
provide different system information. Context models show the position of ----------------------
a system in its environment with the other systems and processes. Data flow ----------------------
models may be used to model the data processing in a system. State machine
models the systems behaviour in response to internal or external events. Semantic ----------------------
data models describe the logical structure of the data which is imported to or
exported by the system. Object models describe logical system entities, their ----------------------
classification and aggregation. Interaction models show the interaction between ----------------------
the system and other side actors (users).
Analysis is concerned with the primary abstractions like classes and objects. It ----------------------
requires a mechanism that represents the problem domain. In object-oriented ----------------------
analysis and design, the class models help in analysing the system by identifying
different classes and representing the relationships among them. It is represented ----------------------
by class diagram in UML. UML dynamic models like collaboration diagrams
are also useful to describe the different collaborations between classes. In the ----------------------
analysis, only the classes that are in the problem domain are modelled. There ----------------------

System Modelling and UML - I 71


Notes is also scope of modelling the supporting classes like interface, databases,
communication, etc. when constructing a system modelling and analysis plays
---------------------- an important role.
----------------------
Check your Progress 1
----------------------

---------------------- Fill in the blanks.

---------------------- 1. An __________ is a person who works on creating different models


which help him to communicate with customers.
---------------------- Match the following.
---------------------- i. Context models a. Describe the logical structure of data
---------------------- ii. Process models b. Define system boundaries
iii. Behavioural model c. Identify various types of processes
----------------------
iv. Semantic data models d. State machine model
----------------------
v. Object model e. Describes classes and relationships
----------------------

----------------------
4.3 UML AND UML USE CASE-DRIVEN OBJECT-
---------------------- ORIENTED ANALYSIS
---------------------- In this section, we will be discussing about the UML and UML use case-
---------------------- driven object- oriented analysis.
4.3.1 Unified Modelling Language (UML)
----------------------
UML is a standard language for writing software blueprints. UML is a
---------------------- general-purpose notation that is used to visualise, specify, construct, document
the artifacts of software systems. UML is not dependent on any one language
----------------------
or technology. It moves us from fragmentation to standardization. UML is the
---------------------- result of an effort taken by Booch, Rumbaugh and Jacobson to simplify and
consolidate the large number of OO development methods and notations.
---------------------- Building a House Building Software

----------------------
1. Design and Layout 1. OOAD
----------------------
2. Blue Print 2. UML
----------------------
3. Actual construction 3. Coding
---------------------- work

---------------------- UML consists of two types of diagrams: structural diagrams and


behavioural diagrams. Structural diagrams focus on static approach of software
---------------------- system. Different structural diagrams used in UML are class diagram, object
---------------------- diagram, component diagram and deployment diagrams. Behavioural diagrams

72 Software Engineering with UML


focus on dynamic aspects of software system. Use-case diagrams, interaction Notes
diagrams, sequence and collaboration diagrams, state diagrams and activity
diagrams are behavioural diagrams. ----------------------
Both behavioural and structural diagrams are used to analyse and ----------------------
design the software system with the help of modeling. UML is the popular
language adapted by programmers and developers for analysing, designing and ----------------------
documenting the software system.
----------------------
Benefits offered by UML:
----------------------
1. Improves communication among project team leading to a uniform and
common understanding of the system. ----------------------
2. Improves the developer’s insight and visualization of the complex system. ----------------------
3. Developers learn fasters to incorporate the system’s details correctly in
the design. ----------------------

4. Prototype design is more appropriate, where the specific complexity of ----------------------


structure and behavior is considered in each iteration. This improve the
system in increments, and part by part. ----------------------

Behavioral Diagram A type of diagram that depicts behavioral features ----------------------


of a system or business process. Show what should ----------------------
happen in the system. They describe how the objects
interact with each other to create a functioning system. ----------------------
Structural Diagram Depicts the elements of specification that are
----------------------
irrespective of time. Show the things in the system
being model ----------------------

----------------------
Table 4.1
----------------------
Table 4.2 Diagrams in UML
----------------------
Activity Diagram Depicts high level business processes, including data
flow, or to model the logic of complex logic within a ----------------------
system.
Class Diagram Shows a collection of static model elements such ----------------------
as classes and types, their contents, and their ----------------------
relationships.
Package Diagram Collection of classes belonging to one sub system in ----------------------
one bunch.
----------------------
Object Diagram Depicts objects and their relationships at a point in
time, typically a special case of either a class diagram ----------------------
or a communication diagram.
Sequence Diagram Models the sequential logic, in effect the time ordering ----------------------
of messages between classifiers. ----------------------

----------------------

System Modelling and UML - I 73


Notes State Chart Diagram Describes the states of an object or interaction may be
in, as well as the transitions between states. Formerly
---------------------- referred to as a state diagram, or state-transition
---------------------- diagram.
Use Case Diagram Shows use cases, actors and their interrelationships.
---------------------- Collaboration Shows instances of classes, their interrelationships
---------------------- Diagram and the message flow between them. Typically
focuses on the structural organization of objects that
---------------------- send and receive messages.
Component Diagram Depicts the components that compose and
---------------------- application, system or enterprise. The components,
---------------------- their interrelationships, interactions and their public
interfaces are depicted.
---------------------- Deployment Shows the execution architecture of systems. This
Diagram includes nodes, either hardware or software execution
----------------------
environments, as well as the middleware connecting
---------------------- them.

---------------------- Table 4.2


4.3.2 UML Use Case-Driven Object-Oriented Analysis
----------------------
Use cases are used during analysis of project to identify and partition
---------------------- system functionality. They separate the system into actors and use cases. It is
a requirement analysis concept. It depicts the use of the system or product and
---------------------- helps to describe the system’s actions from the point of view of a user. It gives
---------------------- a brief on the sequence of events involved during the user interaction with the
system and specifies the behavioural aspects of a system without specifying
---------------------- the structure of the system. So a use-case diagram is a pictorial representation
of who is using what from the system. The use-case diagrams are built in the
---------------------- initial stages of the system development. Its purpose is to specify context of the
---------------------- system. It helps in capturing the system requirements, validating the system
architecture, showing the implementation aspects of the system and generating
---------------------- test cases.
---------------------- In short, the use-case diagram is described as follows during the different
phases of software development.
----------------------
During the software development, different models are developed at
---------------------- different phases of the software development life cycle. So, a use-case diagram
has different roles in these models as follows:
----------------------
• A use-case diagram is expressed in requirement model.
---------------------- • It is implemented in analysis model.
---------------------- • It is realised in design model.
---------------------- • It is structured in implementation model.
• It is verified in test model.
----------------------

74 Software Engineering with UML


Usually, the use cases are developed by system analysts and domain experts. Notes
4.3.3 Use-Case Diagram Components
----------------------
The various use-case diagram components which are used to draw the use
cases are discussed below. ----------------------
1. Actors: An actor is a role that a user plays with respect to the system. ----------------------
For example, a person, an organisation or another system, user, etc. It is
represented in UML as follows: ----------------------
E.g., a customer actor, a human actor. ----------------------

----------------------

----------------------

----------------------

----------------------
Customer
----------------------
Fig. 4.1: Representation of an Actor
There are also non-human actors. Another system or organisation is represented ----------------------
as follows: ----------------------
E.g., an ATM service
----------------------

----------------------

----------------------

----------------------
Fig. 4.2: Non-Human Actor
So, an actor includes all user roles that interact with the system. It also includes ----------------------
system components that are responsible for initiating a use case.
----------------------
There are different types of actors which interact with the system.
----------------------
•  rimary actor: A primary actor is a user whose goals are fulfilled by
P
the system. For example, an actor who interacts with the system with a ----------------------
specific goal.
----------------------
•  upporting actor: A supporting actor provides a service (e.g.,
S
information) to the system, clarifies the external interfaces and protocols. ----------------------
It can be a human actor or a non-human actor.
----------------------
•  ffstage actor: An offstage actor has an interest in the behaviour but is
O
not primary or supporting, e.g., government - ensures all interests (even ----------------------
subtle) are identified and satisfied.
----------------------
Thus, an actor is an external entity that can produce or consume data. An actor
must serve as a source or destination to the system. It must be external to the ----------------------
system. An actor interacts with the system using use cases. Use cases are the
----------------------
functionalities or some behaviour from the system.

System Modelling and UML - I 75


Notes There are several examples of actors like humans, machines, external systems,
organisational units, sensors, etc.
----------------------
To find the actors for a system, we can have several questions which will help
---------------------- to find actors:
• Who are the primary users of the system?
----------------------
• Who requires system support for daily tasks?
----------------------
• Who are the system’s secondary users?
---------------------- • What hardware does the system handle?
---------------------- • Which other (if any) systems interact with the system in question?
•  o any entities interacting with the system perform multiple roles as
D
---------------------- actors?
---------------------- •  hich other entities (human or otherwise) might have an interest in the
W
system’s output?
----------------------
So, an actor is someone who interacts with the use case (system function).
---------------------- Usually a noun is used, e.g., customer, employee, accountant, sales manager,
professor, instructor, researcher, etc.
----------------------
2. Use case: Represented by ellipse
----------------------

---------------------- Perform Task

----------------------
A use case is a system function or process. An actor performs his task
---------------------- with the use case. It is named by verb.

---------------------- For example, consider an online shopping system where the customer can
buy the product online. So the following actors and corresponding use cases can
---------------------- be constructed.

---------------------- Actor/User User Goal /Use Cases


Customer Search for products
---------------------- Add to cart
---------------------- Pay bill
Shop owner Deliver the product
---------------------- Billing
---------------------- Manage products
Update website
----------------------

----------------------

----------------------

----------------------

----------------------

76 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig: 4.3: Use-Case Diagram showing Customer (Actor) interacting with
the System ----------------------

Scenarios: ----------------------
A scenario is a sequence of steps an actor performs with the use case. For ----------------------
example, in the above diagram a customer interacts with the use-case search
Product. He can follow the below sequence of steps: ----------------------
1. Open the category to search on website. ----------------------
2. Customer enters the product details into the search option. ----------------------
3. System looks for the available products in the database.
----------------------
4. Customer can view the different products by specified price and category.
----------------------
5. Customer can view the information related to product.
6. Customer selects the products. ----------------------
3. Association, include, extends and generalisation ----------------------
Symbol Meaning ----------------------
Association is a link between the actor and the use case. ----------------------
It is denoted by a solid line.
<<include>> It means one use case must call another use case. For ----------------------
--------------> example, Login use case must include verifying user-id ----------------------
and password use case.
<<extends>> Extends relationship, it means one use case calls another ----------------------
< -------------- use case under certain conditions.
----------------------
The child use case inherits the behaviour and meaning of
the parent use case. The child may add to or override the ----------------------
behaviour of its parent. ----------------------

----------------------

System Modelling and UML - I 77


Notes i. Association relationship
• It is a link between the actor and the use case.
----------------------
•  n association can be of two types: uni-association where there is a
A
---------------------- one-way communication between the actor and the use case; another is
bidirectional association in which both can send messages to each other.
----------------------
• It is represented by a solid line between actor and use case.
----------------------
ii. Use case “include” relationship
---------------------- •  sed to describe similar behaviour across several use cases. The included
U
---------------------- use case can be replicated and reused across several use cases.
• It is a kind of macros in programming language.
----------------------
•  uppose a use case “P” includes another use case “Q”. At a particular
S
---------------------- point in “P” where “Q” is included, control will be transferred to the
steps listed for “Q” and after the steps in “Q” are carried out, control is
----------------------
transferred back to the main use case “P”. Suppose other use cases “R”
---------------------- and “S” want to include the use case “Q”, they can do so. The use case
“Q” is written only once and used multiple times by different use cases.
----------------------
• Include relationship supports reuse.
---------------------- • Avoid using include relationship, if it is not reused.
---------------------- Example: Consider an online computer store, where a customer has two
options, one is to buy a computer and another is he can take a computer on rent.
---------------------- Both can use the option pay by credit card.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.4: Use-Case Diagram shows the use of Include Relationship
----------------------
iii. Use case “extend” relationship
---------------------- • “extend” relationship is used to depict additional functionality into a use
---------------------- case. .
• The use case which contains the additional functionality can be extended
---------------------- by a new use case.
---------------------- • It is denoted by dashed arrow with <<extend>> stereotype.
• The arrowhead of the extend relationship points to old use case.
----------------------

----------------------

78 Software Engineering with UML


Example: Consider a manufacturing company paying some part of salary Notes
to their employees as gift coupons. So when an employee pays his utility bills
to the supermarket he can have the option of redemption of gift coupons given ----------------------
by the company.
----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.5: Use Case Diagram showing use of Extend Relationship
----------------------
iv. Use case generalisation relationship
----------------------
•  new use case is derived from the old use case. The old use case is called
A
base use case whereas new use case is called derived use case. ----------------------
• It is similar to parent-child relationship. ----------------------
• The derived use case is a specialised version of the old use case.
----------------------
Example: Consider a package which is used to draw different shapes like
circle, triangle, etc. ----------------------
So the base use case is “draw shape” and the derived use cases are “draw ----------------------
triangle”, “draw circle”, etc.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.6: Use Case Diagram showing use of Generalisation
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - I 79


Notes Few More Examples of Use Case Diagrams

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 4.7

80 Software Engineering with UML


4.3.4 Use Cases for Testing and Validation Notes
Use cases can be used for testing. Testing has two objectives - verification
----------------------
and validation. Verification ensures that the system is implemented correctly
according to the requirements and the design. Validation ensures that the system ----------------------
under development really satisfies the user needs. Use-case scenarios give a
proper method to the system to ensure the benefits to users or actors. ----------------------
The use case provides the functional view of the software project from the ----------------------
start making it the main source for validation. If the use case does not satisfy
the user needs, validation is not possible. When the software developer or ----------------------
analyst prepares the use case, this model is discussed with the stakeholders of
----------------------
the system ensuring that the model meets the user requirements. Use cases play
an important part in helping testers organise their test and develop test cases. ----------------------

Check your Progress 2 ----------------------

----------------------
Fill in the blanks.
----------------------
1. UML consists of two types of diagrams: _______________ and
_____________. ----------------------
2. UML is the popular language adapted by programmers and developers
for ________, __________ and ___________ the software system. ----------------------
Match the following. ----------------------
i. Actor a. Sequence of steps an actor performs ----------------------
with the use case.
----------------------
ii. A use case b. 
It means one use case must call
another use case. ----------------------
iii. A scenario c. It means one use case calls another
----------------------
use case under certain conditions.
iv. Association relationship d. 
The child use case inherits the ----------------------
behaviour and meaning of the parent
----------------------
use case.
v. Include relationship e. A system function or process. ----------------------
vi. Extend relationship f. A role that a user plays with respect ----------------------
to the system.
----------------------
vii. Generalisation relationship g. A link between actor and use case.
----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - I 81


Notes Multiple Choice Single Response.
---------------------- 1. Which of the following notations are used in use-case diagrams?
i. Actors
----------------------
ii. Use cases
----------------------
iii. Class
---------------------- iv. i. and ii.
---------------------- 2. Which of the following is used to depict some additional functionality
required of a use case by putting the description of the additional
----------------------
functionality in another use case?
---------------------- i. Include
---------------------- ii. Realisation

---------------------- iii. Association


iv. Extend
----------------------
3. Use-case model is realised by:
----------------------
i. Domain object model
---------------------- ii. Design model
---------------------- iii. Analysis model

---------------------- iv. Implementation model


v. Testing model
----------------------

---------------------- Activity 1
----------------------
1. Draw a use-case diagram for a library management system. Assume
---------------------- suitable actors and use cases. Try use include, extend and generalisation
---------------------- relationships.
2. Draw a use-case diagram for clinic management system. Assume
----------------------
suitable actors and uses cases.
----------------------

---------------------- 4.4 STATIC MODELLING USING CLASS DIAGRAM


---------------------- The techniques of static modelling using class diagram are discussed in
the below sections.
----------------------
4.4.1 Class Diagram
----------------------
Class is a binding of data (attributes) and functions (methods) in a unit. It is
---------------------- a base for construction of objects and shows the conceptual view of the system.
A class is called the concept whereas object is a fundamental. Class diagrams
---------------------- are useful for conceptual and implementation level of software development.

82 Software Engineering with UML


It also describes the static view of a system in terms of classes and relationships Notes
among them.
----------------------
To create a class diagram, you need to identify and describe different
important items in the system. After the definition of a number of classes, the ----------------------
relationship between these classes needs to be identified.
----------------------
A class in UML is drawn with a rectangle, which is divided into three
compartments: ----------------------
• The name compartment
----------------------
• The attributes compartment
----------------------
• The operations compartment
----------------------
Name
----------------------
Attributes ----------------------

Operations ----------------------

----------------------
Fig. 4.7: Class in UML
----------------------
Example of class
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

The top compartment contains the name of the class. The name should be ----------------------
decided from the problem domain and should be a noun. The second compartment
----------------------
has attributes that describe properties of the objects. The attributes can have
different visibility. Visibility describes the accessibility of the attributes within ----------------------
other members of the class as well as from other class. If an attribute has the
visibility of private, it cannot be accessed from other classes. If an attribute has ----------------------
the visibility of public, it can be used and viewed from outside the class. If an
----------------------
attribute has the visibility protected, it can be accessible to its derived classes,
but not from other classes. ----------------------
UML has formal syntax for the description of an attribute:
----------------------
Visibility/name: type [multiplicity] =default-value {property-string}
----------------------

System Modelling and UML - I 83


Notes Visibility of attributes denoted by + for public, - for private, # for protected
whereas some attributes are read only denoted by ‘/’.
----------------------
The third compartment of class has operations or methods. Operations are
---------------------- useful to describe the state of the object. Operations manipulate the attributes or
perform other actions. Operations are normally called functions or methods. An
---------------------- operation may be described as return type, name of operation and zero or more
parameters.
----------------------
UML has a formal syntax for an operation:
----------------------
Visibility name (parameter-list): return-type-expression {property-string}
---------------------- Visibility for the operations is same as visibility for attributes.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.8: A Typical Class with Attributes and Operations
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

84 Software Engineering with UML


Objects represent classes that can be created at runtime. Class is a Notes
logical construction of attributes and functions and these are implemented and
initialised in objects. ----------------------
Objects in UML are represented as follows: ----------------------
C: Customer
----------------------

----------------------

01: Order 02: Order 03: Order ----------------------


Number = 12 Number = 32 Number = 40 ----------------------

S1: Special Order S2: Special Order N1: Normal Order ----------------------
Number = 20 Number = 30 Number = 60 ----------------------
Fig. 4.9: Object diagram
----------------------
Mapping class to java code
----------------------
public class Triangle {
private float base; ----------------------
private float height;
private float area; ----------------------
private static int noOfTriangles;
----------------------
public void setBase(float b){
} ----------------------
public float getBase(){
} ----------------------
public void setHeight(float h){
----------------------
}
public float getHeight(){ ----------------------
}
public void calculateArea(){ ----------------------
}
----------------------
public float getArea(){
} ----------------------
}
----------------------
4.4.2 Relationships in UML
Relationships provides a pathway for communication among objects. it is ----------------------
another connection between things. When we model a system, we are supposed ----------------------
to not only identify the things that form a system, but we should also model how
these things are related to one another. ----------------------
Relationships show how elements are associated with each other and this ----------------------
association (link) describes the functionality of an application.
There are different types of relationships that can be used among classes. ----------------------
A class diagram is constructed using a collection of different classes and ----------------------

System Modelling and UML - I 85


Notes relationships among them. The different types of relationships that can be used
are association, realisation, dependency and generalisation.
----------------------
An association is a connection between classes. It depicts that object of one class
---------------------- recognises the object of another class. An association is normally bidirectional,
which means that if an object is associated with another object, both objects are
---------------------- known to each other.
---------------------- Person Uses  Computer
----------------------
Fig. 4.10: Association between Person and Computer
----------------------

----------------------

----------------------

----------------------

----------------------
Association between Person and Company with adornments (tells more about
---------------------- an association)

---------------------- A person uses a computer. The person has an association to the computer class.

Student 1...* Owns  0...* Vehicle


----------------------
 Owned by
----------------------

---------------------- Fig. 4.11: Association between Student and Vehicle


A student owns many (zero-to-many) vehicles. A vehicle can be owned by
----------------------
many (one-to-many) students.
---------------------- 0...*
Student Owns Vehicle
----------------------
Fig. 4.12: Navigation Association
----------------------

---------------------- Teacher ID 1 Teaches  0...* Student


 Taught by
----------------------
Fig. 4.13: Qualified Association
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

86 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Multiplicity
----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.14: Recursive Association
Aggregation is a stronger version of association. Aggregation is of two ----------------------
types: shared aggregation and composite aggregation. A shared aggregation
----------------------
indicates “whole-part” relationship. For example, a computer consists of
different parts like motherboard, monitor, keyboard, mouse, etc. The keywords ----------------------
used to identify aggregates are “consists of”, “contains”, “is part of”, that is,
words that indicate a whole-part relationship between the classes involved. ----------------------
Shared aggregation is denoted by a hollow diamond at whole-part.
----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.15: Shared Aggregations
----------------------

System Modelling and UML - I 87


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
More examples on aggregation
----------------------
Composite aggregation a whole-part association between two classes such that
---------------------- the parts reside within the whole. Destruction of the whole results in automatic
destruction of the parts. Multiplicity on the part side can be many but on the
----------------------
whole side it has to be zero or one. The composite aggregation is denoted by
---------------------- filled diamond at whole side.

----------------------

----------------------

----------------------
Fig. 4.16: Composite Aggregation
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Generalisation is a relationship in which the child inherits the properties


from the parent. Child is a specialised class from the generalised one. The child
----------------------
class acquires the properties and methods of the parent class. The specific class
---------------------- (child class) contains the extra behaviour in addition to the parent.

88 Software Engineering with UML


The general class (parent) is called the base class or superclass and the Notes
more specific class is called the derived class or subclass.
----------------------

----------------------

----------------------

----------------------

Fig. 4.17: Class Diagram showing use of Generalisation Relationship ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Abstract class is a class that is not allowed to have any instances. ----------------------
Attributes and operations are only declared within this class. Subclasses inherit ----------------------
these features from the abstract class. Each subclass will have its own definition
for each method declared in the abstract superclass. It is represented by italic ----------------------
word superclass or the keyword {abstract} beside the superclass name in the
name compartment of the superclass. A class that has one abstract operation ----------------------
is compulsorily an abstract class. A subclass that inherits from an abstract ----------------------
superclass must implement all operations of that superclass or itself become
abstract. Abstract operations are denoted by the keyword {abstract} beside the ----------------------
operation declaration.
----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - I 89


Notes

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.18: Class Diagram showing Abstract Class
----------------------
A realisation is a type of abstraction that shows that elements of one
---------------------- model or class realise a more general element of another model. In general, an
interface can be realised by a class to implement the abstract elements of an
---------------------- interface. An interface contains only method signatures. They do not specify
any implementation neither they are allowed to have any attributes. Interface
----------------------
can be represented by a rectangle having two compartments. Convention is
---------------------- to write <<interface>> and its name on the next line of the first compartment.
The second compartment consists of the method names and signatures of the
---------------------- interface.
----------------------

----------------------

----------------------

----------------------
Fig. 4.19: An Interface Structure in UML
----------------------
Interface can be realised by another classes to perform their task. For example,
---------------------- there are two applications which want to implement the calculator interface.
The realisation relationship is used.
----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 4.20: Realisation Relationship

----------------------

----------------------

----------------------

----------------------

90 Software Engineering with UML


Packages and classes: A package is used to group classes into a unit. It Notes
can never be instantiated. All the classes that are part of a package are owned
or referenced by that package. Destruction of package results in automatic ----------------------
destruction of all its containing classes. The classes of a package can include
other packages, interfaces, components or nodes. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.21: Package P with Classes A and B ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.22: Package P extends Package Q ----------------------
A dependency is a relationship in which elements of one class are dependent
----------------------
on elements of another class. Changes in one element will affect the dependent
elements. ----------------------
Class A depends on another class C if changes to C cause changes to A. Suppose
----------------------
class A in Package P depends on class C in package Q, then we can say that
“Package P is dependent on Package Q”. While designing it is important to ----------------------
minimise dependencies between packages.
----------------------

----------------------

----------------------

----------------------
Fig. 4.23: The Dependency of Package P on Package Q ----------------------

System Modelling and UML - I 91


Notes
Check your Progress 3
----------------------
Fill in the blanks.
----------------------
1. A ___________ is a conceptual view of system.
---------------------- 2. A class notation in UML contains ___________, __________ and
---------------------- ___________compartments.
Match the following.
----------------------
i. Association a. To implement the abstract elements of an
---------------------- interface.
ii. Shared aggregation b. It depicts that object of one class recognise
---------------------- the object of another class.
---------------------- iii. Composite aggregation c. Indicates “whole-part” relationship.
iv. Generalisation d. Destruction of whole results in automatic
---------------------- destruction of parts.
v. Realisation e. Parent-child relationship
----------------------
Multiple Choice Single Response.
---------------------- 1. Which of the following relationship between elements specifies
behaviour and provides implementation?
----------------------
i. Composition
---------------------- ii. Include relationship
iii. Association
----------------------
iv. Realisation
---------------------- 2. It is a whole-part association between two classes such that a part can
reside within many wholes at the same time.
----------------------
i. Composite aggregation
---------------------- ii. Generalisation
---------------------- iii. Shared aggregation
iv. None of these
---------------------- 3. Which of the following is true?
---------------------- i. Association may also correspond to relation between instances
of three or more classes.
---------------------- ii.  Association lines may be unlabelled or they may show
---------------------- association name.
iii. None of these.
---------------------- iv. i and ii.
---------------------- 4. It is a whole-part association between two classes such that the parts
reside within the whole.
---------------------- i. Composite aggregation
---------------------- ii. Realisation
iii. Shared aggregation
---------------------- iv. Composition

92 Software Engineering with UML


Notes
Activity 2
----------------------
Use the use-case diagram used in Activity 1 for library management ----------------------
system and draw the class diagram.
----------------------

4.5 ACTIVITY DIAGRAM ----------------------

An activity diagram is used to model the flow of work. It basically shows ----------------------
the communication between the systems. When objects are interacting with
----------------------
each other, the objects also perform work in terms of activities. These activities
and their order are described in an activity diagram. Activity diagrams do not ----------------------
have to reference a specific object but can just reference a high-level flow.
A typical work flow contains different states in the system, which are called ----------------------
activity states.
----------------------
An activity state does not wait for an event to occur, to transfer from one
activity state to next activity state. When one activity state gets completed the ----------------------
control will transform to the next activity state. An activity should have definite ----------------------
start and end. The activity diagram has provisions to model activities which
can be performed concurrently by different persons in an organisation. It can ----------------------
also branch to indicate activities to be performed only if certain conditions are
fulfilled. ----------------------

Activity diagrams are used: ----------------------


•  o capture actions (work) that will be performed when a function or
T ----------------------
operation is executing.
----------------------
• To represent the internal work in an object.
•  o show the sequence of actions that can be performed and how the other
T ----------------------
objects around them are affected.
----------------------
• To show the execution of scenarios in uses cases.
----------------------
•  o show the business functionalities in terms of actors, workflows,
T
organisation and objects in the business. ----------------------
For example, the following diagram shows the different actions performed ----------------------
when scanning a document to an application.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - I 93


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.24: Activity Diagram
----------------------
When user calls ScanAllDocs function from the UserWindow class, the action
---------------------- starts. The first action is to show a message box on the screen; after this the
condition is checked - whether the scanner is connecter or not. If the scanner is
----------------------
connected, the documents are scanned and the scanned document is saved. If
---------------------- the scanner is not connected the activity ends.
The different symbols used in activity diagram are as follows:
----------------------
Symbol Meaning
----------------------
Start (initial) state
----------------------

---------------------- Final state

----------------------
Junction
----------------------

---------------------- Fork
----------------------
Join
----------------------

----------------------

----------------------

----------------------

94 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.25: Depicting Parallel Activities ----------------------
Swimlanes: In order to make the activity diagram denote “who does
what”, it must be arranged into vertical zones, each zone separated by solid ----------------------
lines. Each zone can represent the activities of a particular class or department. ----------------------
There are two departments - customer service and the Finance. The work of
accepting selected books, packing them, calculating the bill, giving the bill to ----------------------
the customer and the packed books to the cashier is done by the customer service
department. Actual acceptance of the cash and handing over the purchase to the ----------------------
customer is done by the finance department. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - I 95


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 4.26: Activity Diagram showing use of Swimlanes
----------------------

---------------------- Check your Progress 4


---------------------- State True or False.
---------------------- 1. Activity diagram begins with an initial node.

---------------------- 2. At least one activity diagram can be constructed for each use case.
3. To specify who does what, you can divide an activity diagram flow.
----------------------
4. In an activity diagram, all actions coming into a fork must be
---------------------- completed before processing continues.
---------------------- 5. In an activity diagram, a subactivity indicator indicates separate
activity diagram.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

96 Software Engineering with UML


Notes
Case Study 1
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Solution – Case 1 ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - I 97


Notes
Case Study 2
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Solution – 2a
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

98 Software Engineering with UML


Solution b – Activity diagram with swim-lanes Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Summary
----------------------
•  system model is an abstract view of the system. Different types of
A
----------------------
models provide different system information.
• Context models show the position of a system in its environment with the ----------------------
other system and process.
----------------------
• Data flow models may be used to model the data processing in a system.
State machine model the systems behaviour in response to internal or ----------------------
external events.
----------------------
• Semantic data models describe the logical structure of the data which is
imported to or exported by the system. ----------------------

• Object models describe logical system entities, their classification and ----------------------
aggregation. An interaction model shows the interaction between the
system and other side actors (users). ----------------------

•  se cases are used during analysis of a project to identify and partition


U ----------------------
system functionality. They separate the system into actors and use cases.
It is a requirement analysis concept. ----------------------

System Modelling and UML - I 99


Notes •  lass is a binding of data (attributes) and functions (methods) in a unit. It
C
is a base for construction of objects and shows the conceptual view of the
---------------------- system. A class is called the concept whereas object is a fundamental.
---------------------- •  n activity diagram is used to model the flow of work. It basically shows
A
the communication between the systems. When objects interact with each
---------------------- other, the objects also perform work in terms of activities.
---------------------- •  typical work flow contains different states in the system. These are
A
called activity states. An activity state does not wait for an event to occur
---------------------- to transfer from one activity state to the next activity state. When one
activity state gets completed the control will transform to the next activity
----------------------
state. An activity should have definite start and end.
----------------------

----------------------
Keywords

---------------------- • Actor: An entity or an object.


• Use case: Function or method.
----------------------
• Class: A logical construction.
----------------------
• Scenario: Sequence of steps or actions in a use case.
---------------------- • Activity: Comprises action events.
----------------------
Self-Assessment Questions
----------------------
1. What is UML? Write the use of different diagrams in UML.
----------------------
2. What is a use case? Explain the different types of relationships used in
---------------------- use-case diagrams with an example of each.
---------------------- 3. What is a class? Explain the different types of relationships used in class
diagrams with an example of each.
----------------------
4. What is the need to draw an activity diagram during system or software
---------------------- development? What are the different symbols used in an activity diagram?
Draw an activity diagram for a scenario where a customer withdraws cash
---------------------- from an ATM machine.
----------------------
Answers to Check your Progress
----------------------
Check your Progress 1
----------------------
Fill in the blanks.
---------------------- 1. An analyst or system analyst is a person who works on creating different
---------------------- models which help him to communicate with customers.

----------------------

----------------------

100 Software Engineering with UML


Match the following. Notes
i. – b.
----------------------
ii. – c.
----------------------
iii. – d.
iv. – a. ----------------------
v. – e. ----------------------
Check your Progress 2 ----------------------
Fill in the blanks.
----------------------
1. UML consists of two types of diagrams: structural diagrams and
behavioural diagrams. ----------------------
2. UML is the popular language adapted by programmers and developers for ----------------------
analysing, designing and documenting the software system.
----------------------
Match the following.
i. – f. ----------------------

ii. – e. ----------------------
iii. – a. ----------------------
iv. – g.
----------------------
v. – b.
----------------------
vi. – c.
vii. – d. ----------------------
Multiple Choice Single Response. ----------------------
1. Which of the following notations are used in use-case diagrams? ----------------------
iv. i. and ii.
----------------------
2. Which of the following is used to depict some additional functionality
required of a use case by putting the description of the additional ----------------------
functionality in another use case?
----------------------
iv. Extend
----------------------
3. Use-case model is realised by:
ii. Design model ----------------------
Check your Progress 3 ----------------------
Fill in the blanks. ----------------------
1. A class is a conceptual view of system.
----------------------
2. A class notation in UML contains class name, attributes and operation
compartments. ----------------------

----------------------

System Modelling and UML - I 101


Notes Match the following.
i. – b.
----------------------
ii. – c.
----------------------
iii. – d.
---------------------- iv. – e.
---------------------- v. – a.

---------------------- Multiple Choice Single Response.


1. Which of the following relationship between elements specifies behaviour
----------------------
and provides implementation?
---------------------- iv. Realisation
---------------------- 2. It is a whole-part association between two classes such that a part can
reside within many wholes at the same time.
----------------------
iii. Shared aggregation
---------------------- 3. Which of the following is true?
---------------------- ii. Association lines may be unlabelled or they may show association
name.
----------------------
4. It is a whole-part association between two classes such that the parts
---------------------- resides within the whole.
---------------------- i. Composite aggregation

---------------------- Check your Progress 4

---------------------- State True or False.


1. True
----------------------
2. True
----------------------
3. False
---------------------- 4. False
---------------------- 5. True
----------------------
Suggested Reading
----------------------
1. Fowler, Martin. UML Distilled: A Brief Guide the Standard Object
---------------------- Modelling Language. Addison-Wesley.
---------------------- 2. 
Rumbaugh, James, Ivar Jacobson and Grady Booch. The Unified
Modelling Language Reference Manual. Addison-Wesley.
----------------------
3. Sommerville, Ian. Software Engineering. Addison-Wesley.
----------------------
4. Joseph Schmuller. Teach Yourself UML in 24 hours
----------------------

102 Software Engineering with UML


System Modelling and UML - II
UNIT

5
Structure:

5.1 Introduction
5.2 Sequence Diagram
5.3 Collaboration Diagram or Communication Diagram
5.4 State Chart Diagram
5.5 Component Diagram
5.6 Deployment Diagram
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

System Modelling and UML - II 103


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Implement the use-case behaviour using sequence diagram
----------------------
• Explain modelling using collaboration diagram
---------------------- • Discuss an object behaviour using state diagram
---------------------- Elaborate on the organisation of different components using
• 
component diagram
----------------------
• Describe system deployment using deployment modelling
----------------------

---------------------- 5.1 INTRODUCTION


---------------------- Sequence diagrams are used to illustrate the dynamic behaviour of a
group of objects that communicate by passing messages in order to perform a
---------------------- certain task. We know, if we have to depict the behaviour of the system, use-case
---------------------- diagram helps to list the behaviour of the system. To implement the behaviour
sequence, diagrams are used. In this unit, we will discuss more about the same.
----------------------
5.2 SEQUENCE DIAGRAM
----------------------
In a use-case diagram, a use case has sequence of steps to perform a task.
----------------------
These steps are called scenarios. There are two types of scenarios: first, which
---------------------- leads to task to be performed successfully and second, the task which is not
performed successfully. So the use-case diagram has the scenarios which lead
---------------------- to success as well as possibility of the use case to be in failure. Certain steps are
to be performed to make a failure use case turn to successful scenarios. While
----------------------
describing the documentation of use case in terms of listing the scenarios, the
---------------------- developer should find possible sequence of steps which can lead to success as
well as failure and to convert the failure scenarios into success scenarios.
----------------------
A modeller can model the implementation of these scenarios using
---------------------- sequence diagram. Sequence diagrams are types of interaction diagrams used to
show the manner in which messages are passed between objects as the system
---------------------- executes to implement a specific behaviour.
---------------------- The two types of interaction diagrams are sequence diagram and
communication diagram or collaboration.
----------------------
Consider an ATM system in which a customer wants to withdraw cash.
----------------------

----------------------

----------------------

----------------------

104 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig.5.1: Sequence Diagram ----------------------
In Figure 5.1, there are three objects of the respective classes - ATM, ----------------------
Server and Customer shown by rectangles. The formal syntax is object name
followed by colon followed by class name with entire text underline. ----------------------
E.g., Objectname:className ----------------------
It indicates object. The object may be with name or without name.
----------------------
E.g., : className
----------------------
Figure 5.1 shows unnamed objects. The dashed vertical line shows the
lifeline of the object. The solid line shows activation boxes; at that point objects ----------------------
are active. The activation box indicates objects are executing or waiting for
response from another object. ----------------------
In the above example, the object communication is as follows: ----------------------
1. Customer object asks to execute InsertCard () function. It is used for ----------------------
acceptance of card.
----------------------
2. The object of ATM sends a message to object of class Server to execute
VerifyCard () function. It does verification of card. ----------------------
3. After verification of card, ATM Object asks for pin number to customer
----------------------
class through EnterPin () function.
4. Customer asks for cash through RequestCash () function. ----------------------
5. ATM object checks the availability of cash using VerifyAvailability() ----------------------
function.
----------------------
6. ATM object dispense cash to customer using DispenceCash() function.
7. Deletion of an object is shown by a large ‘X’ at the end of the lifeline. ----------------------

System Modelling and UML - II 105


Notes Component of Sequence Diagram:
1) Active Objects/Roles:
----------------------
Active objects are objects that play a role in the system, whether it be an
---------------------- object instance or an actor. It is represented by the UML object symbol
without attributes .
----------------------
2) Lifelines:
----------------------
Lifelines are vertical dashed lines that indicate what is happening to an
---------------------- object in a chronological fashion.

---------------------- 3) Activation Boxes:


Activation boxes (activations) represent the time an object needs to
---------------------- complete a task.
----------------------

----------------------

----------------------

----------------------
Steps to draw sequence diagram
----------------------
1. Define who (which object) will initiate the interaction
---------------------- 2. Draw the first message to sub system
---------------------- 3. Draw message to other sub system
---------------------- 4. Draw return message to actor
5. Send / Respond to anonymous actor
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

106 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------
Depiction of Asynchronous Messages ----------------------
Suppose an object of class “P” sends a message msg1 ( ) to object of class ----------------------
“Q”. If the first object does not have to wait for the return then the message is
asynchronous, i.e., the object of class “P” can continue to do its own processing ----------------------
like sending a message msg2 ( ) to object of class “R”. It does not have to wait
for the object of class “B” to finish executing its operation. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig.5.2: Asynchronous Messages
----------------------
Creation of New Objects
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.3: Creation of New Object

System Modelling and UML - II 107


Notes Consider the case of an object of class “P” creating an object of the class
“Q”. It is depicted by showing an arrow from an activation box over the lifeline
---------------------- of the object of the class “P” to the created object of class “Q”.
---------------------- Combination Fragments
• Sequence diagrams can be broken down into chunks called fragments.
----------------------
• Around each fragment a frame is drawn. There is a specifier in the upper
---------------------- left-hand corner of the frame that represents an operator that states how the
fragment is handled.
----------------------
• There are one or more than one operand regions within the fragment.
----------------------
•  hey are placed vertically and each is separated by a horizontal dashed
T
---------------------- line.
---------------------- The Alt Combination Fragment

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.4: “alt” Combination Fragment specifies Conditional Behaviour
----------------------
• “ alt” combination fragment specifies conditional behaviour. Either one
---------------------- out of the two operations will be invoked.
---------------------- • I n Figure 5.4, if the Video Player is free then message is sent by
VideoServer object to VideoPlayer Object to invoke “play” method. If
---------------------- the Video Player is busy then message is sent to Queue object to execute
---------------------- Enqueue() operation.
• I f there are multiple conditions and if it is necessary to execute a sequence
---------------------- of instruction and if all the conditions fail, then an “else” can be included.
---------------------- The Loop Combination Fragment
----------------------

----------------------

----------------------

108 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Fig. 5.5: “loop” Combination Fragment ----------------------

•  uppose it is necessary for the Video Player to play the track “movie1.
S ----------------------
avi” five times. The keyword “loop” with parameters 1 5 is included in
----------------------
the pentagram of the fragment. So play (movie1.avi) operation will be
invoked five times. ----------------------
The Opt Combination Fragment
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.6: “opt” Combination Fragment ----------------------
• I t is used to model an “if-then” statement. If a certain condition occurs then
the execution of the messages takes place. This combination fragment is ----------------------
similar to the “alt” combination fragment with the exception that there ----------------------
is no else part to it. The keyword “opt” is used in the pentagram at the
top left-hand corner of the frame. For example, the computer sends a ----------------------
message play(movie1.avi) to the VideoServer. If the VideoPlayer is free,
the VideoServer sends the play() message to it. ----------------------

System Modelling and UML - II 109


Notes The Par Combination Fragment

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.7: “par” Combination Fragment
----------------------
• I t depicts the concurrent execution of operations. The word “par” is
---------------------- included at the top left-hand corner of the enclosing frame within a
pentagram. A message - message1 ( ) - is sent to object of the class Q by
----------------------
the object of class P.
---------------------- •  pon receipt of this message, it sends two messages - message2 ( ) and
U
message3 ( ) - to itself at the same time. Upon execution of these messages,
----------------------
control is transferred back to the object of class P.
---------------------- The Break Combination Fragment
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 5.8: “break” Combination Fragment

110 Software Engineering with UML


•  he frame has the keyword “break”. It indicates that when a break is
T Notes
encountered, all statements within the frame are executed but the
remainders of statements outside the frame are skipped. ----------------------
The Ref Combination Fragment ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.9: “ref” Combination Fragment
In the above figure, upon entering the pin by the customer, verifyPin ----------------------
sequence diagram will be called in which detail steps of verifying pin can be ----------------------
modelled. It is used for reducing the complexity of the diagram.
Recursion ----------------------

•  recursive operation is one that will continue invoking itself till some
A ----------------------
terminating condition is met. While representing recursive operations
----------------------
in a sequence diagram, the message must always be synchronous. The
FirstFunc() operation will call itself till some terminating condition ----------------------
(which must be compulsorily present) is met.
----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.10: Recursion
----------------------
Iteration over a Collection
----------------------

----------------------

----------------------

System Modelling and UML - II 111


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 5.11: Iteration over a Collection


•  here is a multiobject which represents multiple objects of the class Y.
T
---------------------- An object of class X sends a message msg1 ( ) to Y. An asterisk is placed
---------------------- preceding the message name and the multiobject is indicated as shown.
Invoking Static Messages
----------------------
•  n object of class X sends a message to class Y asking it to execute the
A
---------------------- static operation msg1 ( ). The message being sent to a class Y and not to
an object is indicated by not underlining Y.
----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.12: Message Sending
----------------------

---------------------- Check your Progress 1


----------------------
State True or False.
----------------------
1. Sequence diagrams represent dynamic models of how objects change
---------------------- their states in response to events.
2. A sequence diagram depicts the interaction among objects during a
----------------------
certain period of time.
---------------------- 3. In sequence diagram, asynchronous messages are shown by circles at
arrow head.
----------------------
4. “par” fragment in sequence diagram depicts concurrent operations.
----------------------

----------------------

----------------------

112 Software Engineering with UML


Notes
Activity 1
----------------------
Assume the list of behaviour in use-case diagram for library management ----------------------
system (refer Unit 4, Activity 1) and implement it using sequence diagram.
Draw possible implementation of different scenarios through different ----------------------
sequence diagrams.
----------------------

5.3 COLLABORATION DIAGRAM OR COMMUNICATION ----------------------


DIAGRAM ----------------------
Collaboration diagram focusses on communication and links among a set ----------------------
of objects, while sequence diagram focusses on time-ordered communication.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - II 113


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 5.13: Collaboration Diagram for playing a Movie


---------------------- Collaboration diagrams are also called communication diagrams. It is
another form of interaction diagram. The sequence of messages is indicated by
----------------------
explicitly numbering them. There are three objects of the classes -Computer,
---------------------- VideoServer and VideoPlayer. The object of the type computer sends a message
to the object of the type VideoServer asking it to execute its play () operation.
---------------------- This message is given the number 1.
---------------------- The receipt of this message prompts the object of the type VideoServer
to send a message to the object of the type VideoPlayer to execute its play ()
---------------------- operation. The message number is 1.1. It is called nested message.
---------------------- Suppose computer object has to send the message to another object, it can
be numbered as 2 and the subsequent messages can be labeled as 2.1, 2.1.1, etc.
----------------------
Labeling Messages
---------------------- • Formal syntax:
---------------------- [predecessor] [guard condition] sequence expression [return value ‘:=’]
message-name ‘(‘ [argument list] ‘)’
----------------------
Characters in single quotes like: = and () are literal values. Terms in [ ]
---------------------- are not compulsory. Other terms are replaced by actual values. Terms in
braces {} are repeated zero or more times.
----------------------
•  redecessor: It is a list of the sequence number of messages that must
P
---------------------- occur before the current message is sent. This feature is useful if branches
are present. If no branch is present, then Predecessor can be safely omitted.
----------------------
Syntax of the predecessor:
----------------------
sequencenumber1 {‘,’ sequencenumber2}’/’
---------------------- The forward slash indicates the end of the list. It is indicated when an
---------------------- explicit predecessor is shown, e.g., 1, 1.1, 1.2,2, 2.1 /3: msg1 (). It means that
for msg1 () to be passed, messages with sequence numbers 1 (with nested
---------------------- messages 1.1 & 1.2) and 2 (with nested message 2.1) must be passed.
---------------------- • Guard condition: It must be true before the message can be passed.
It is stated in any programming language or psuedocode. No UML
---------------------- specification is needed to state it.

114 Software Engineering with UML


For example, [VideoPlayer free] 1.1. play (). The message play() will be Notes
sent only if the VideoPlayer is free.
----------------------
•  equence expression: It is a list of integers optionally separated by
S
dots followed by a single letter name followed by a recurrence term and ----------------------
terminated by a colon.
----------------------
•  yntax: integer {‘.’ integer} [name] [recurrence]’:’For example, 1.1a
S
*[i=1..10]:play(). The above example indicates that the message to ----------------------
execute play() is labeled 1.1a and it will iterate 10 times.
----------------------
•  eturn value: For example, 1.1a [i<10]:y=play() ,If i<10 only then play()
R
will be executed and the output of play() will be assigned to y. ----------------------
Messages to self: ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.14: Message to Self ----------------------
This is indicated by drawing a link from the object to itself.
----------------------
Instance Creation:
----------------------

----------------------

----------------------

----------------------

Fig. 5.15: Example of Instance Creation ----------------------

Creating instances ----------------------


In the UML, the convention to create an object is to name the function ----------------------
creating it as “create”. But if any other name is used, then the message can be
adorned with the <<create>> stereotype. Suppose, for example, an object of ----------------------
the type A creates an instance of the class B by using the create message and
----------------------
passing 2 parameters - a and b.
Iteration for a single message ----------------------

----------------------

----------------------

Fig. 5.16: Example of Iteration for a Single Message ----------------------

System Modelling and UML - II 115


Notes On receipt of message msg (), the object of class A sends a message msg2()
to the object of class B ‘N’ times. It is indicated by putting an asterisk after
---------------------- the message number. Suppose the modeller does not want to show the number
of times the message is sent, then he can omit the brackets and the entire text
---------------------- within them.
---------------------- Iteration over a collection
----------------------

----------------------

----------------------

----------------------
Fig. 5.17: Example of Iteration over a Collection
---------------------- Suppose there is a collection of objects called B. On receipt of message msg()
---------------------- the object of the class A sends a message msg2() to every object in the collection.
It is indicated by showing an asterisk after the message number as well as at the
---------------------- end of the link on the collection side. Double-box indicates the multi-object.

---------------------- Invoking static messages

----------------------

----------------------

----------------------
Fig. 5.18: Example of invoking Static Messages
----------------------

---------------------- Check your Progress 2


----------------------
State True or False.
---------------------- 1. Collaboration diagram is a type of interaction diagram.
---------------------- 2. Collaboration diagram is used to model the communication between
objects over a certain period of time.
----------------------
3. Sequence numbers to messages are used in collaboration diagram.
----------------------
4. Collaboration diagrams can be an alternative to sequence diagrams.
----------------------

---------------------- Activity 2
----------------------
Refer to the sequence diagram in Activity 1 and draw the collaboration
---------------------- diagram. Compare the diagrams.
----------------------

----------------------

116 Software Engineering with UML


5.4 STATE CHART DIAGRAM Notes
A state chart diagram describes states of an object during its life cycle and ----------------------
behaviour of object in those states along with its events and actions which cause
change in the state. ----------------------
State Chart Diagram ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

The state diagram shows the state of a single object ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Example of a state diagram
----------------------

----------------------

----------------------

----------------------
A state machine visualises an object of a class as an individual. It depicts
behaviour of object with the rest of the world by detecting events and giving ----------------------
responses. State diagrams model the dynamic aspects of a system as an isolated
entity. It shows all the possible states that an object can have during its life ----------------------
cycle and how it responds to an event when it is in a particular state. So a state ----------------------
machine is a graph of states and transitions. A state is associated with an object
of a class which describes the responses of that object to event that it receives. ----------------------

----------------------

----------------------

----------------------

System Modelling and UML - II 117


Notes Consider a state diagram of a CD player.

----------------------

----------------------

----------------------

----------------------
Fig. 5.19: States of a DVD/CD Player
---------------------- Types of Events
---------------------- There are five types of events.
---------------------- 1. 
Time event: The time is calculated either as absolute time or the passage
of relative amount of time. For example, settings on each machine are
---------------------- such that it will go into locked mode if it is idle for two minutes. So the
passage of time of two minutes in the idle state transforms the machine to
----------------------
the locked state.
---------------------- 2. 
A guard condition event: This is shown as a guard condition on a state
transition. When the transition is set to occur, the condition is tested. If it
----------------------
is true then the state changes.
---------------------- 3. 
Change event: It is evaluated continuously till it becomes true and finally
when it becomes true, the transition fires.
----------------------
4. 
Call event: It is the receipt of an explicit synchronous request among
---------------------- objects that wait for a response.
---------------------- Suppose an object “ob1” sends a message to object “ob2”. “ob2” processes
the call event either by transitioning to a new state or failing to make a
---------------------- transition. Either way, the control returns to calling object.
---------------------- 5. 
Signal event: Here, the calling object sends asynchronous messages to
receiving objects. The sender does not wait for the receivers to process
----------------------
the messages and return. It continues its own work independently.
---------------------- It is not necessary for an event to be attached to a state transition. The
state of an object can change when its internal actions are executed. Thus,
----------------------
the performance of all actions in a state transitions the object to a new
---------------------- state.
States and Transitions
----------------------
•  state when represented using a rectangular box with rounded edges can
A
---------------------- have three compartments.
---------------------- •  he first compartment contains the name of the state, e.g., Stopped,
T
Ready, etc.
----------------------
•  he second compartment is optional. It indicates the behaviour in response
T
---------------------- to events. There are three reserved event names in UML. They are:
----------------------  entry: It indicates actions to be done upon entering into a state.

118 Software Engineering with UML


 do: It indicates actions to be done while in the state. Notes
 exit: It indicates actions to be done on exit from a state.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.20: Representation of a State
----------------------
The syntax for the activity compartment is: eventname argument-list ‘/’ action-
expression. ----------------------
•  he third compartment is also an optional compartment depicting internal
T ----------------------
transitions. An internal transition is one which has a source state but no
target state. The active state does not change as a result of its firing. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Fig. 5.21: State Transition Representation ----------------------


Formal syntax for specifying a state transition ----------------------
• Formal syntax: ‘[‘ guard condition ‘]’ ‘/’ action expression send-clause ----------------------
• Event signature: It consists of the event name and parameters.
----------------------
Eventname ‘(‘list of parameters separated by commas’)’
----------------------
•  uard condition: It is tested at the time the event fires. This transition
G
takes place only if the guard condition is true. If both event signature ----------------------
and guard condition are present, then the event must occur and the guard
condition must be true for the transition to take place. ----------------------
•  ction expression: It is an expression to be executed when the transition
A ----------------------
fires. In case of multiple actions, they are fired from left to right and they
are separated by a forward slash ‘/’ on the diagram. ----------------------

----------------------

System Modelling and UML - II 119


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.22: Syntax for specifying a State Transition
---------------------- When go() event is triggered the state is changed from A to B. At that time, i
---------------------- gets incremented by 1 and j by 2. i=i+1 and j=j+2 are the action expressions.
•  end-Clause: It is a special syntax for sending a message during a
S
---------------------- transition from one state to another.
----------------------

----------------------

----------------------

----------------------
Fig. 5.23: Send-Clause for specifying a State Transition
---------------------- When ‘print’ event occurs, the object sends a message to itself to execute
---------------------- its own print function. Syntax of the send clause is:
‘^‘destination-expression.destinationmessagename’(‘arguments’)’
----------------------
E.g. Nopaper ^ indicator.light(red)
----------------------
A transition may have more than one send-clause each with its own ^
---------------------- delimiter. The sequence of action-expression statements, operations and send-
clauses determines the order of the execution.
----------------------
Substates
---------------------- Internally, a state can have substates. There are two types of substates: and-
---------------------- substate and or-substate.
•  R-substate: A state can have multiple substates but only 1 substate may
O
---------------------- be true at a given time.
---------------------- • AND-substate: The current state can have concurrent substates. Several
of them may be true in parallel. And-substates can be used while modelling
----------------------
the states of concurrent threads.
----------------------

----------------------

----------------------

120 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.24: Active State
----------------------
There is a superstate called Active. When the object enters this state, it
enters the states B and D at the same time. Suppose an event X causes the ----------------------
transition to substate C from substate B. It is independent and has no effect on ----------------------
the second nested substate.
However, if the object transitions from Active superstate to some ----------------------
superstate, say, Passive, a transition from all concurrent substates occurs. The
----------------------
object can either be in substate B or C and D or E at any time it is in Active state.
So, states B and C are or-substates and so are states D and E. ----------------------
The History Indicator (Shallow and Deep History)
----------------------
The history indicator allows the state to remember the last substate that
it was in before the occurrence of the event changed the state. The symbol H is ----------------------
used even before the initial substate, in our case before B.
• Shallow history: It remembers only the history of the immediate nested ----------------------
state machine. ----------------------
• Deep history: If there are multiple layers of nesting, UML provides for
another symbol H* to indicate “deep history”. Deep history remembers ----------------------
down to the innermost substate at any depth. ----------------------
• If the nesting is at one level only as in the previous example, shallow and
deep history indicators are equivalent. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Fig. 5.25: History Indicator ----------------------

System Modelling and UML - II 121


Notes The junction state

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.26: Junction State
----------------------
A junction state is denoted by a circle. When the event “event1” occurs, the
---------------------- sequence of actions are action2, action1 and action3. A junction builds a single
transition from multiple transition segments. However, among the segments,
---------------------- only the first segment can have an event trigger.
---------------------- The synch state

---------------------- When state X is entered into, substates A and B are also active
simultaneously. Each concurrent region is independent of the other, with each
---------------------- one having its own thread of control. Suppose, for the object to enter into substate
D, it was necessary that the transitions from substate A from region 1 and
---------------------- substate B of region 2 should have fired. Synch state models the circumstances
---------------------- in which the transformation to a substate in one region also depends upon the
firing of a transition from a substate in the other region.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 5.27: Synch State


It connects two concurrent regions that belong to the same composite
----------------------
state. Transition from state ‘A’ is given as input to a fork in the first concurrent
---------------------- region.
Two threads of control emanate from the fork. One is a transition to
----------------------
substate ‘C’ and the other is given as input to the synch state. The output of
---------------------- the synch state is given as input to the join in the other concurrent region along
with the output from the first substate of that region. The output of the join is
---------------------- the transition to the second substate in the second region.
---------------------- Suppose transition from A fires which will be an input to the fork. The
object will also transition to substate C in the first concurrent region. However,
---------------------- for the object to transition in the second concurrent region to substate D, the

122 Software Engineering with UML


transition from the join has to fire. Transition from join will fire if only the Notes
transition from B and the synch state have fired.
----------------------
Stub state
Suppose, in a particular state machine, there is a transition to a submachine ----------------------
reference state. So, the transition to the initial state of the submachine occurs.
----------------------
The occurrence of the event e1 will transition the object from state A to the
submachine reference state, i.e., to state C. ----------------------
But sometimes when a transition to a submachine reference state occurs,
----------------------
it is desirable to transition to a state other than the start state of the target
submachine. So a stub state is placed within the submachine reference state ----------------------
which identifies a state within the referenced submachine. This identified state
in the submachine becomes active when a transition to the stub state occurs. ----------------------

----------------------

----------------------

----------------------
Fig. 5.28: Stub State ----------------------
Suppose the model is such that on occurrence of the event e2, the transition
should be to state E of the submachine B and not to state C. A crossbar is placed ----------------------
within the submachine reference state and it is labelled with the state of the ----------------------
submachine (in our case E) to which the transition must occur from state A
on the occurrence of event e2. The crossbar represents a stub state. There may ----------------------
be multiple stub states within the submachine reference state, but connections
between any two stub states are prohibited. ----------------------

----------------------
Check your Progress 3
----------------------
State True or False. ----------------------
1. The entry event in state diagram indicates actions to be while in the ----------------------
state.
2. Idle or Active represents state category. ----------------------

3. A transition into a concurrent composite state is to make a transition ----------------------


directly to one of its substates.
----------------------
4. 
A state diagram contains three compartments; second and third
compartments are optional. ----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - II 123


Notes
Activity 3
----------------------

---------------------- Consider the sequence diagram in Activity 2 for library management system
and draw the state diagram depicting the different states of the objects
---------------------- within it.
----------------------

---------------------- 5.5 COMPONENT DIAGRAM

---------------------- In software development, the end-products reside on a physical node and


they are either executables or contribute in the execution of some program.
---------------------- Thus, the physical end-product lives in the world of bits. They are modelled in
the UML as components. A component depends on some interfaces and realises
----------------------
others. It can serve as a link between a logical and a physical model. Logically,
---------------------- an interface can be specified for a class. Ultimately, a physical component will
realise this interface.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.29: Component Diagram
----------------------
Representation of Components: Depiction of Components and Interfaces
----------------------
There are two types of relationships between components and interfaces.
---------------------- A component can provide interfaces and also depend on other interfaces.

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 5.30A: Representation of Components

124 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------
Fig. 5.30B: Representation of Components
----------------------

----------------------

----------------------
Fig. 5.30C: Representation of Components ----------------------
Types of Components
----------------------
There are three types of components:
----------------------
1. Deployment component
----------------------
2. Work product
3. Execution components ----------------------
Consider, for example, a Java program to calculate the Fibonacci series ----------------------
of a number and write the output to a file named “Fibonacci.dat” created during
the execution of the program named “Fibonacci .cpp”. ----------------------
The file “Fibonacci .cpp” is compiled in the visual environment and an ----------------------
executable Fibonacii.exe is created. When it is executed, a file “Fibonacci .dat”
is created and the output is written to it. A deployment component is necessary ----------------------
and sufficient to form an execution system on its own, e.g., “Fibonacci .exe” ----------------------
Work product components assist in the construction of an executable system
but do not participate in it, e.g., “Fibonacci .cpp” ----------------------

Execution components are created as a result of an executing system, e.g., ----------------------


“Fibonacci .dat”.
----------------------
Stereotypes Applicable to Components
----------------------
• File (document which contains source code or data)
• Table (a database table), ----------------------
•  xecutable (an executable file which can be deployed and executed on a
E ----------------------
node)
----------------------
• Library (static or dynamic object library)
----------------------
• Document (any generic document).
----------------------

----------------------

System Modelling and UML - II 125


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Check your Progress 4
----------------------

---------------------- State True or False.


1. A component is nothing but an abstraction over classes or objects that
---------------------- can be deployed on a physical node.
---------------------- 2. A component can have required and provided interfaces.
---------------------- 3. Mainly there is a dependency relationship among the components.
4. A main component can contain subcomponents.
----------------------

126 Software Engineering with UML


Notes
Activity 4
----------------------
Draw a component diagram for an online shopping system. Depict all the ----------------------
components and their specification in detail.
----------------------

5.6 DEPLOYMENT DIAGRAM ----------------------

During the development of software, classes, interfaces packages, etc. ----------------------


represent the logical entities while components represent the physical packaging ----------------------
of these logical entities.
However, in order to execute these components, they have to be deployed ----------------------
on a hardware device called a node. A node has some memory and processing ----------------------
capabilities.
----------------------

----------------------

----------------------

----------------------

----------------------

Fig. 5.31: Depiction of node ----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 5.32: Exposure of Components deployed on a Node ----------------------
Like a class, a node also can have attributes and operations. The server can
----------------------
have the properties like value of RAM, capacity of hard disk, frequency, etc. It
can have operations like startUp (), shutdown () and restart (). A node can have ----------------------
relationships with other nodes like associations and can include role names and
multiplicity. The association will be the actual physical connection between the ----------------------
nodes like Ethernet cable.
----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - II 127


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig 5.33: Depiction of a Node with Attributes Operations and deployed
---------------------- Components
Case Study – Deployment Diagram
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Check your Progress 5
----------------------
Fill in the blanks.
----------------------
1. ___________ shows organisation of nodes carrying components.
----------------------
2. __________ comprises one or more components.
----------------------
3. Deployment node contains _________ components.
---------------------- 4. A node has _______ and _______ capability.
----------------------

----------------------

128 Software Engineering with UML


Notes
Activity 5
----------------------
Draw a deployment diagram for online shopping system. ----------------------

----------------------
Summary
----------------------
•  sequence diagram represents the interaction among different objects
A
of a system in the time order. These are used to document the systems ----------------------
requirements depending on the scenarios of the use-case diagram.
----------------------
•  collaboration diagram is a type of interaction diagram. Objects are
A
connected with numbered (sequenced) arrows. The numbered arrows are ----------------------
the links which depict the information flow between the objects.
----------------------
•  omponent diagrams are used to visualise the components of the system.
C
A component contains the software modules which can be deployed over ----------------------
a physical node. It constructs executables. It can be used to describe the
----------------------
physical artifact of the system.
•  eployment diagrams are used to model the topology of the physical
D ----------------------
nodes. A physical node may be a computer machine or a machine which
----------------------
gives interfaces to the client. A physical node on which the software
components are deployed is represented by a box which contains ----------------------
compartments name, attributes, functionalities and executables.
----------------------
Keywords ----------------------
•  equence diagram: An interaction diagram that shows how processes
S
----------------------
operate with one another and in what order.
•  ollaboration diagram: It represents a combination of information
C ----------------------
taken from class, sequence and use-case diagrams describing both the
static structure and dynamic behaviour of a system. ----------------------

•  tate diagram: A type of diagram used in computer science and related


S ----------------------
fields to describe the behaviour of systems.
----------------------
•  omponent diagram: It depicts how components are wired together to
C
form larger components and or software systems. ----------------------

Self-Assessment Questions ----------------------

----------------------
1. What is a sequence diagram? Explain the different types of fragmentation
used in sequence diagrams with an example. ----------------------
2. Differentiate between sequence diagram and collaboration diagram.
----------------------
3. What is a state diagram? What are its different types of compartments?
Explain in detail. ----------------------
4. Explain component diagram and deployment diagram in detail. ----------------------

System Modelling and UML - II 129


Notes Answers to Check your Progress
---------------------- Check your Progress 1
---------------------- State True or False.

---------------------- 1. False
2. True
----------------------
3. False
----------------------
4. True
---------------------- Check your Progress 2
---------------------- State True or False.

---------------------- 1. True
2. False
----------------------
3. True
----------------------
4. True
---------------------- Check your Progress 3
---------------------- State True or False.

---------------------- 1. False
2. True
----------------------
3. True
----------------------
4. True
---------------------- Check your Progress 4
---------------------- State True or False.

---------------------- 1. True
2. True
----------------------
3. True
----------------------
4. True
---------------------- Check your Progress 5
---------------------- Fill in the blanks.
---------------------- 1. Deployment diagram shows organisation of nodes carrying components.
2. Deployment node comprises one or more components.
----------------------
3. Deployment node contains work product components.
----------------------
4. A node has memory and processing capability.
----------------------

----------------------

130 Software Engineering with UML


Notes
Suggested Reading
----------------------
1. Eriksson, Hans-Erik, Magnus Penkar, Brian Lyons and David Fado.
UML2 ToolKit. Wiley. ----------------------
2. Fowler, Martin. UML Distilled: A Brief Guide to the Standard Object
----------------------
Modeling Language. Addison-Wesley.
3. Miles, Russ and Kim Hamilton. Learning UML 2.0. O’Reilly Publication. ----------------------

4. 
Rumbaugh, James, Ivar Jacobsobn and Grady Booch. The Unified ----------------------
Modelling Language User Guide. Addison-Wesley.
----------------------
5. Joseph Schmuller. Teach Yourself UML in 24 hours
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

System Modelling and UML - II 131


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

132 Software Engineering with UML


Design Concepts and Principles
UNIT

6
Structure:

6.1 Introduction
6.2 Design Process
6.3 Design Principles
6.4 Design Concepts
6.5 Design Heuristics for Effective Modularity
6.6 Design Model
6.7 Design Documentation
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

Design Concepts and Principles 133


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Explain the design process and design principles
----------------------
• Elaborate on the design concepts
---------------------- • Implement design heuristics for effective modularity
---------------------- • Discuss design model and design documentation

----------------------

---------------------- 6.1 INTRODUCTION


---------------------- Software design encompasses the set of principles, concepts, and practices
that lead to the development of a high-quality system or product. Design
----------------------
principles establish an overriding philosophy that guides in the design work
---------------------- you must perform. Design concepts must be understood before the mechanics
of design practice are applied, and design practice itself leads to the creation of
---------------------- various representations of the software that serve as a guide for the construction
activity that follows.
----------------------
Software design is the core of software engineering process. The
---------------------- requirements are gathered at the software analysis phase and the software
design is the final engineering action within the modeling activity. It helps in
----------------------
construction of code for the software.
---------------------- A software analysis model has different elements. Each element in the
software analysis model provides the information for the design model.
----------------------

---------------------- 6.2 DESIGN PROCESS


---------------------- Software design is an iterative process through which requirements are
translated into a “blueprint” for constructing the software. Initially, the blueprint
----------------------
depicts a holistic view of software. That is, the design is represented at a high
---------------------- level of abstraction—a level that can be directly traced to the specific system
objective and more detailed data, functional, and behavioral requirements. As
---------------------- design iterations occur, subsequent refinement leads to design representations
at much lower levels of abstraction.
----------------------
These can still be traced to requirements, but the connection is more subtle.
----------------------
Some elements that provide the information to the design model are
---------------------- categorised into scenario-based elements, flow-oriented elements, class-based
elements and behavioural elements.
----------------------

----------------------

----------------------

134 Software Engineering with UML


Figure 6.1 shows the design model. Notes

Component ----------------------
Level Design
----------------------

----------------------
Interface
Design ----------------------

----------------------
Architectural Design ----------------------

----------------------

----------------------
Data Design
----------------------
Fig. 6.1: Design Model ----------------------
•  he top layer in the design model is the component-level design which
T
----------------------
transforms class based, flow oriented and behavioural information from
the analysis model. ----------------------
•  he interface design depicts how the software communicates with the
T
----------------------
users. It uses flow control information from flow-oriented elements like
data flow diagrams from analysis model. It also transforms scenario- ----------------------
based information from the analysis model.
----------------------
•  he architectural design transforms flow based and class-based elements.
T
An architecture is a framework for software system under development. ----------------------
•  ata design also called class design transforms class-based elements into
D ----------------------
design.
So, all these layers are used to transform the different analysis elements ----------------------
into the design. Collectively, it describes the transformation from analysis ----------------------
model to design model.
----------------------
Software design is a blueprint of the software which depicts the overall
view of the software. It is an iterative process. Iterations will occur until the ----------------------
software goal is reached.
----------------------
McGlaughlin suggests three characteristics for evaluation of a good design.
• The design must implement all of the explicit requirements contained ----------------------
in the analysis model, and it must accommodate all of the implicit
----------------------
requirements desired by the customer.
• The design must be a readable, understandable guide for those who ----------------------
generate code and for those who test and subsequently support the ----------------------
software.
----------------------

Design Concepts and Principles 135


Notes • The design should provide a complete picture of the software, addressing
the data, functional and behavioural domains from an implementation
---------------------- perspective.
---------------------- To evaluate the quality of a design representation, the developer must
establish technical criteria for good design.
----------------------
A design should contain the hierarchical organisation of all the
---------------------- subsystems within the software in a controlled manner. A good design should
distinguish clearly between the representation of data, architecture, interfaces
---------------------- and components within the design model. Most of the designs use a standard
notation which can be used to effectively communicate to the community of
----------------------
developers.
---------------------- Hewlett-Packard developed a set of software quality attributes – FURPS
– that is, functionality, usability, reliability, performance and supportability.
----------------------
These attributes represent a target for all software designs.
---------------------- Functionality: This is assessed by evaluating capability of the program,
• 
---------------------- generality of functions and the security of the overall system.
Usability: It is assessed by considering the users of the system, consistency
• 
---------------------- and documentation.
---------------------- Reliability: It is assessed by evaluating the accuracy of output, measuring
• 
failure of the system and recovery procedures.
----------------------
Performance: It is assessed by measuring the processing speed, response
• 
---------------------- time, resource consumption, throughput and efficiency.
---------------------- Supportability: It is concerned with maintainability, testability and
• 
compatibility of the system. It also assesses the configurability and ease
---------------------- of installation of the system.
----------------------
Check your Progress 1
----------------------

---------------------- State True or False.


1. Software designing is a kernel of software engineering.
----------------------
2. Flow-oriented element and class-based element from analysis model
---------------------- is transformed by component level in data model.
---------------------- 3. Software designing does not help in code construction in software
development.
----------------------
4. 
In software design process, the developer requires to establish
---------------------- technical criteria.

---------------------- 5. A software design model consists of a hierarchical model of software


modules.
----------------------

----------------------

136 Software Engineering with UML


6.3 DESIGN PRINCIPLES Notes
A design process contains steps that enable the software designer to ----------------------
describe all the elements that are analysed in the software analysis step. A
designer must use creative skills and past experiences while modelling the ----------------------
software.
----------------------
It is similar to an architect’s plan for a building. It includes the plan of the
building, 2D and 3D view of the building, guidance for constructing each part ----------------------
of the building. ----------------------
Davis describes the set of principles for software design:
----------------------
1. 
The design process should not suffer from tunnel vision. It means that a
good designer should consider alternative approaches. ----------------------
2. 
The design should be traceable to the analysis model. It suggests that the ----------------------
design model transforms the analysis elements, so all the elements of the
analysis model should be traceable. ----------------------
3. 
The design should reinvent the wheel. It means that the design should be ----------------------
representing new ideas and integration of patterns of those that already
exist. ----------------------
4. 
The design should minimise intellectual distance between the software ----------------------
and the problem as it exists in the real world.
----------------------
5. 
The design should exhibit uniformity and integration.
6. 
The design should be structured to degrade gently, even when bad data, ----------------------
events or operating conditions are encountered. ----------------------
7. The design should be reviewed to minimise conceptual (semantic) errors.
----------------------
8. Design is not coding,
----------------------
9. The design should be structured to accommodate change.
10. The design should be assessed for quality as it is being created. ----------------------

----------------------
Check your Progress 2
----------------------
State True or False. ----------------------
1. While designing the software, a designer should not consider the
----------------------
alternative solutions.
2. Designing is nothing but code construction for software. ----------------------
3. Software design should be assessed for quality. ----------------------

----------------------

----------------------

----------------------

Design Concepts and Principles 137


Notes 6.4 DESIGN CONCEPTS
---------------------- A set of fundamental software design concepts has evolved over the
history of software engineering. Although the degree of interest in each concept
----------------------
has varied over the years, each has stood the test of time. Each provides the
---------------------- software designer with a foundation from which more sophisticated design
methods can be applied. Each helps you answer the following questions:
----------------------
●● What criteria can be used to partition software into individual components?
---------------------- ●● How is function or data structure detail separated from a conceptual
representation of the software?
----------------------
●● What uniform criteria define the technical quality of a software design?
----------------------
Some fundamental design concepts are as follows:
---------------------- 1. Abstraction
---------------------- •  bstraction refers to hiding details. In the modular software design
A
many levels of abstractions can be used. Each level hides its details
---------------------- from another level. The highest level gives a broader view of the
---------------------- system, whereas the lowest level gives detailed description.
•  data object is a collection of data that describes the data object.
A
---------------------- A data attribute describes a data object. A programming language
---------------------- provides the abstraction over the attributes. Some of the languages
are Ada, Modula, CLU, etc.
---------------------- 2. Architecture
---------------------- •  software architecture gives an overall view of the software. It
A
consists of a hierarchical structure which depicts the components
----------------------
and their relationship.
---------------------- • Shaw and Garlan describe a set of properties of architecture design:
---------------------- Structural properties: The architecture design defines the
• 
system components and their interactions.
----------------------
Extra-functional properties: The architecture design should
• 
---------------------- address how the design architecture achieves requirements for
performance, capacity, reliability, adaptability and security.
----------------------
Families of related systems:The architecture design should
• 
---------------------- draw upon repeatable patterns in the design of families of
similar systems.
----------------------
•  n architectural design consists of different methods. These are
A
---------------------- structural model, framework model, dynamic model, process model and
functional model. The structural model represents an organised collection
---------------------- of components. Framework models are used to increase the level of
---------------------- abstraction by identifying repeatable architectural design frameworks that
are used in similar types of applications. The behaviour of the software
---------------------- can be depicted by the dynamic models. The process models are used

138 Software Engineering with UML


to focus on the design of the business and technical process. Functional Notes
models are used to represent functional hierarchy of a system.
----------------------
3. Modularity
•  software is an integration of different components which are
A ----------------------
separately named as modules.
----------------------
•  eyer defines five criteria to evaluate a design method for an
M
effective modular system: ----------------------
Modular decomposability: It is a systematic mechanism
•  ----------------------
of design for decomposing a problem into sub-problems. It
reduces the complexity and helps to achieve the modularity ----------------------
for the system. ----------------------
Modular composability: In this design method, the existing
• 
design components are assembled into a new system. It helps ----------------------
in reusability of the components for the new systems. ----------------------
Modular understandability: A module can be understood
• 
as a standalone unit. It makes applications easier to build and ----------------------
easier to change. ----------------------
Modular continuity: Changes to the system requirements result
• 
----------------------
in changes to individual modules instead of complete system.
Modular protection: When an abnormal condition occurs
•  ----------------------
within a module, then its effects, changes are limited within
----------------------
that module. The other modules can be protected from these
abnormal changes. ----------------------
Modularity is a criterion for the structure of software which describes ----------------------
individual modules and their interconnection. The two important terms used
are cohesion and coupling. Cohesion means keeping two or more modules ----------------------
together. The strength of connection between modules is called coupling. A
highly coupled module increases the dependency. A loosely coupled module ----------------------
decreases the dependency between them and makes modules independent. ----------------------
4. Refinement
----------------------
•  tepwise refinement is a top-down design strategy proposed by
S
Niklaus Wirth. It is a simple, realistic method. The basic idea behind ----------------------
this is to start with a high-level problem, break down the problem
into small number of sub-problems to solve. Repeat this until all the ----------------------
sub-problems are solved. ----------------------
•  efinement helps designers to expose low-level details. Abstraction
R
----------------------
and refinement are complementary concepts.
5. Information hiding ----------------------
•  ach module in the software has data and functions or procedures.
E ----------------------
These data and functions are hidden from the other modules. So
----------------------

Design Concepts and Principles 139


Notes changes in modules do not affect other modules. So, modularity in
the software is effective and it enforces access constraints.
----------------------
• It is related to abstraction, cohesion and coupling.
---------------------- 6. Refactoring
---------------------- • I t is a design method used for agile methods. It is a reorganisation
technique. It is used to simplify the design or code of a module
---------------------- without changing the function or behaviour.
---------------------- •  artin Fowler defines refactoring as “the process of changing a
M
software system in such a way that it does not alter the external
---------------------- behaviour of the code [design] yet improves its internal structure.”
---------------------- •  fter refactoring the software, the design is examined for
A
redundancy. It is used to improve the design of the existing code.
----------------------
7. Functional independency
----------------------
• I t is related to independency between the modules within the
---------------------- software system. Each module or unit within the software system
has specific functional requirements. It is measured using two terms
---------------------- - coupling and cohesion.
---------------------- •  he different types of cohesion are logical cohesion, temporal
T
cohesion, procedural cohesion and communication cohesion.
---------------------- Logical cohesion means the modules perform their task logically.
Temporal cohesion is related to performing the task within a time
----------------------
limit. Procedural cohesion is related to performing task in an order
---------------------- and communication cohesion focuses on data structure which is
accessed by processing elements within the modules.
----------------------
•  he strength of connection between modules is called coupling.
T
---------------------- There are different types of coupling - data coupling, stamp coupling,
control coupling, external coupling, common coupling and content
---------------------- coupling. Data coupling is when a module or component uses
---------------------- another module by argument passing. Stamp coupling is when a
module or component uses another module through data structure.
---------------------- Control coupling is when the control is passed between the modules
or components using a control variable. External coupling is when
---------------------- a module is connected to the external environment. Common
---------------------- coupling is when all the modules share some global variable. When
one module uses the data or control information of another module,
---------------------- it is called content coupling.

---------------------- • A good modular design must have a high cohesion and low coupling.
8. Designing classes
----------------------
•  efining classes is an important method for designing object-
D
---------------------- oriented systems. A designer designs different types of classes.
Some of these classes are system classes, process classes, user
----------------------
interface classes, business classes and persistent classes.

140 Software Engineering with UML


•  ystem classes are used to implement control and management
S Notes
functions to communicate with the outside environment. Process
classes are used to manage the business domain classes. Business ----------------------
domain classes are related to the business domain areas. User
interface classes are related to Human Computer Interaction (HCI). ----------------------
It is used to design the interfaces that describe all the elements of ----------------------
the system.
----------------------
•  designer must develop complete set of attributes and operations
A
for these classes. ----------------------

Check your Progress 3 ----------------------

----------------------
State True or False.
----------------------
1. A software consists of integration of different components and these
are separately called modules. ----------------------
2. Refinement helps designers to expose high-level details. ----------------------
3. Refactoring is used to simplify the design or code of a module without
----------------------
changing function or behaviour.
----------------------
6.5 DESIGN HEURISTICS FOR EFFECTIVE ----------------------
MODULARITY
----------------------
An effective modularity can be achieved by applying design concepts ----------------------
like abstraction, architecture, refinement, information hiding, refactoring,
functional dependency and designing classes after creating the program ----------------------
structure. This structure can be reorganised as per guidelines (heuristics) for
effective modularity. Some of the guidelines are as follows: ----------------------
• Evaluate the first iteration of program structure to reduce coupling and ----------------------
improve cohesion. Program architecture consists of organisation of
modules. Attempt should be made to reduce the coupling and improve ----------------------
the cohesion. It increases the modularity in the program units. ----------------------
• Attempt to minimise structures with high fan-out; strive for fan-in as
depth increases. ----------------------

• Keep scope of effect of a module within the scope of control of that ----------------------
module.
----------------------
• Evaluate module interfaces to reduce complexity and redundancy and
improve consistency. ----------------------
• Define modules whose functions are predictable, but avoid modules that ----------------------
are overly restrictive.
----------------------
• Strive for controlled entry, no switch or jump.
• Packaging of software based on design and requirements. ----------------------

Design Concepts and Principles 141


Notes
Check your Progress 4
----------------------

---------------------- State True or False.


1. An effective modularity can be achieved by applying design concepts.
----------------------
2. The functions defined in modules should be predictable.
----------------------
3. Depending on requirement specification packaging of module should
---------------------- be done.

----------------------
6.6 DESIGN MODEL
----------------------
The design model includes representation of data, architecture, interfaces
---------------------- and procedures. Figure 6.2 shows a design model that contains the elements -
data design, architecture design, interface design and procedural design.
----------------------
There are two dimensions that exist for design model - one is abstract
---------------------- dimension and the other is process dimension. The abstract dimension is a
---------------------- representation of transformation of analysis model to design model. Analysis
model is at high level of abstraction and design model is at low level of
---------------------- abstraction. A decision boundary will be decided by the designer in between
high level of abstraction and transformation and low level of abstraction.
----------------------
The process dimensions contain elements, such as architecture elements,
---------------------- interface elements, component-level elements and deployment-level elements.
---------------------- Software requirements are analysed using class diagrams, packages, CRC
models, collaboration diagrams, data flow diagrams, control flow diagrams and
---------------------- processing narratives. These are transformed into designing classes, realisations
between classes, subsystem and collaboration diagram which are related to
----------------------
design model architecture elements.
---------------------- Interface elements on process dimension are technical interface designing
GUI and navigation designs are the transformation of use cases, activity
----------------------
diagrams, state diagrams, collaboration diagrams, sequence diagrams which are
---------------------- created at analysis model.
Component-level elements on the process dimension are component
----------------------
diagrams, class designs, activity diagrams and sequence diagrams which are
---------------------- the transformation from class diagrams, packages, CRC models, collaboration
diagrams, data flow diagrams, control flow diagrams and sequence diagrams
---------------------- from the analysis models.
----------------------

----------------------

----------------------

----------------------

142 Software Engineering with UML


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 6.2: Dimensions of Design Model
----------------------

Check your Progress 5 ----------------------

----------------------
Fill in the blanks.
----------------------
1. _________ includes representation of data, architecture, interfaces
and procedures. ----------------------
2. ________ and navigation design are the transformation of use cases.
----------------------

----------------------
6.7 DESIGN DOCUMENTATION
----------------------
Design documentation helps in navigating the design elements. Some of the
following points can be incorporated when designing the document: ----------------------
•  irst, scope needs to be defined which contains system objectives, major
F ----------------------
software requirements, design constraints and limitations.
•  econd, data design which contains details about data objects and data
S ----------------------
structures, file and database structures which are logical structure, logical ----------------------
record descriptions, access methods, global data, file and data cross-
reference. ----------------------
•  hird is architectural design details. These are review of data and control
T ----------------------
flow, derived program structure.
----------------------
•  ourth, interface design details are human-machine interface specification,
F
human-machine interface design rules, external interface design which ----------------------
consists of interfaces to external data, interfaces to external systems or
devices, interface design rules . ----------------------
•  ifth, procedural design details for each module, a processing narrative,
F ----------------------
interface description, design language description, details of modules
----------------------

Design Concepts and Principles 143


Notes used, internal data structures, any comments, restrictions or limitations
are detailed.
----------------------
• Requirements cross-reference.
---------------------- • Test provisions and testing guidelines, strategies and special considerations.
---------------------- • Special notes.

---------------------- • Appendix.
The above sequence can be used as a template for documentation.
----------------------

---------------------- Check your Progress 6


----------------------
Fill in the blanks.
---------------------- 1. In ________ of design, interface design details are human-machine
interface specification.
----------------------
2. In documentation of design, scope needs to be defined which should
---------------------- contain _____, _________, ________ and ________ .
---------------------- 3. In documentation of design, _________ design details are review of
data and control flow, derived program structure.
----------------------

----------------------
Activity 1
----------------------
Find out the importance of design documentation for a specific project.
----------------------

----------------------
Summary
----------------------
•  esign is the core of software engineering. Design consists of refinement
D
---------------------- of data structure, program architecture and interfaces. It also consists
of development of procedural details, reviewing and documentation of
----------------------
procedural details.
---------------------- •  esearchers have proposed a number of software fundamental principles
R
and concepts. Design model helps in improving the quality of the software.
----------------------
• Design concepts are the basic criteria for design quality.
----------------------
•  fter gathering the requirements at the software analysis phase, the
A
---------------------- software design is the final engineering action within the modelling
activity. It helps in construction of code for the software.
----------------------
•  design model is a pyramid-like structure consisting of data design,
A
---------------------- architecture design, interface design and component-level design.
----------------------

----------------------

144 Software Engineering with UML


Keywords Notes

----------------------
•  esign principles: Describe fundamental ideas about the practice of a
D
good visual design. ----------------------
•  odularity: The degree to which a system’s components may be
M
----------------------
separated and recombined.
•  esign documentation: A written description of a software product that
D ----------------------
a software designer writes in order to give a software development team
----------------------
overall guidance to the architecture of the software project.
----------------------
Self-Assessment Questions ----------------------
1. Explain the software design process in detail. ----------------------
2. Explain the design principles and design concepts in detail.
----------------------
3. Explain design model and design documentation.
----------------------
Answers to Check your Progress ----------------------
Check your Progress 1 ----------------------
State True or False.
----------------------
1. True
----------------------
2. True
3. False ----------------------

4. True ----------------------
5. True ----------------------
Check your Progress 2
----------------------
State True or False.
----------------------
1. False
----------------------
2. False
3. True ----------------------
Check your Progress 3 ----------------------
State True or False. ----------------------
1. True
----------------------
2. False
----------------------
3. True
----------------------

----------------------

Design Concepts and Principles 145


Notes Check your Progress 4
State True or False.
----------------------
1. True
----------------------
2. True
---------------------- 3. True
---------------------- Check your Progress 5

---------------------- Fill in the blanks.


1. 
Design model includes representation of data, architecture, interfaces and
----------------------
procedures.
---------------------- 2. GUI and navigation design are the transformation of use cases.
---------------------- Check your Progress 6

---------------------- Fill in the blanks.


1. In documentation of design, interface design details are human-machine
---------------------- interface specification.
---------------------- 2. In documentation of design, scope needs to be defined which should contain
system objectives, major software requirements, design constraints and
----------------------
limitations.
---------------------- 3. In documentation of design, architectural design details are review of data
and control flow, derived program structure.
----------------------

---------------------- Suggested Reading


---------------------- 1. Pressman, Roger and Bruce Maxim. 2014. Software Engineering: A
---------------------- Practitioner’s Approach. McGraw-Hill.
2. Sommerville, Ian. Software Engineering. Addison-Wesley.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

146 Software Engineering with UML


Architectural Design
UNIT

7
Structure:

7.1 Introduction
7.2 Software Architecture
7.3 Data Design
7.4 Architectural Styles
7.5 Mapping Requirements in Software Architecture
7.5.1 Transform Mapping
7.5.2 Transaction Mapping
7.6 Refining Architectural Design
7.7 User Interface Design (UID)
7.7.1 The Golden Rules of User Interface Design
7.7.2 Task Analysis and Modelling
7.7.3 Interface Design Activities
7.7.4 Design Evaluation
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

Architectural Design 147


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Explain the concept of software architecture and data design
----------------------
• Analyse software architecture styles
---------------------- • Discuss the concept of user interface design
----------------------
7.1 INTRODUCTION
----------------------
Architectural design begins with data design and then proceeds to the
---------------------- derivation of one or more representations of the architectural structure of the
system.
----------------------
Architectural design is similar to making a plan on paper. It contains design
---------------------- of the software. A software consists of programs, data structure and interfaces;
---------------------- an architecture gives the idea of data flow within the system. An architecture
model encompassing data architecture and program structure is created during
---------------------- architectural design. In addition, component properties and relationships
(interactions) are described. For example, if you want to construct your house,
---------------------- you take a sketch from the architect who describes every aspects, specification
---------------------- and layout of your house. After watching the architecture of your house, you
finalise and start building it. That sketch provides you an architectural view of
---------------------- your house.

---------------------- In this unit, we will discuss the various aspects of software architecture
and designing of user interfaces.
----------------------
7.2 SOFTWARE ARCHITECTURE
----------------------
The software architecture of a program or computing system is the
---------------------- structure or structures of the system, which comprise software components, the
externally visible properties of those components, and the relationships among
---------------------- them
---------------------- A software architecture provides the overall view of the software product.
It represents the structure of data and program components to build a system.
----------------------
After gathering the system requirements and specification the structure or
---------------------- framework is developed which describes the modules and relationship between
these modules.
----------------------
An architectural view is an actual design and layout of your requirement
---------------------- specification (SRS) gathered in the analysis phase. An architectural design is
the process of defining a collection of hardware and software components and
---------------------- their interfaces to establish the framework for the development of a computer
system. It represents the structure of data in the system as well as structure of
----------------------
the components which are to be built in the system. Once an architecture of one
---------------------- system is created, it can be applied to another system.

148 Software Engineering with UML


A software engineer can design both data and architecture. A database or Notes
data warehouse designer creates the data architecture for the system. The system
architect selects appropriate architectural style for the requirements gathered ----------------------
during software requirement analysis. Architecture helps the software engineer
to analyse the effectiveness of the system and it can reduce the potential risks. ----------------------
Architecture of a system can be a communication medium between the software ----------------------
development teams which shows the directions and details of the development.
Architecture depicts all the components of the system and how the system ----------------------
works. In Software Architecture in Practice by Len Bass, there are three key
reasons as to why software architecture is important. ----------------------

• It enables communication between all the stakeholders. ----------------------


•  he architecture highlights early design decisions that will have an impact
T ----------------------
on all software engineering work that follows.
----------------------
•  rchitecture contains relatively small, intellectually graspable model of
A
how the system is structured and how it’s all components work together. ----------------------
An architectural design process has some basic steps as follows: ----------------------
• Design data structure.
----------------------
• Derive possible architectural structures from SRS for the system.
----------------------
•  nalyse and select architecture from available alternatives which can be
A
best suited to customer requirements. ----------------------
• Make the architecture specification in detail.
----------------------

Check your Progress 1 ----------------------

----------------------
State True or False.
----------------------
1. Software architecture represents the overall view of the product.
2. Software architecture is the implementation of system requirement ----------------------
specification gathered in the analysis phase.
----------------------
3. Software architecture model of one software can be applied to other
software. ----------------------
4. Software architecture depicts all the components of the software ----------------------
system and tells how it works.
----------------------

----------------------
Activity 1
----------------------
Suppose an apartment security software is to be developed to provide
----------------------
security to apartments. It should consist of several types of sensors and
cameras. Analyse it and draw its overall software architecture using ----------------------
UML component diagram.
----------------------

Architectural Design 149


Notes 7.3 DATA DESIGN
---------------------- Data design transforms the data objects defined in the analysis model into
data structures. These data structures are directly accessible by the software
---------------------- components. So the data design concentrates on the aspect of accessibility
of the data structures to the software components. In a software system data
----------------------
quality has an importance. The main challenge is to store and retrieve data
---------------------- successfully without redundancy. It enables the organisation of the database
into the data warehouse which can be helpful for data mining. In the analysis
---------------------- phase, for example, ER diagrams depict the analysing view of data which can be
transformed into data structures which are required to implement the software.
----------------------
Data design is used at the architectural level and component level.
---------------------- Data Design at Architectural Level
---------------------- Data warehouse and data mining are examples of data design at the
architectural level. Data mining techniques are also called knowledge discovery
---------------------- in databases. At the business level there is existence of multiple databases, their
---------------------- different structures makes data mining difficult within an existing database
environment. So the solution for this is data warehouse which is an additional
---------------------- layer to the data architecture.
---------------------- Data Design at Component Level
It focuses on the representation of data structures. These data structures are
----------------------
directly accessed by one or more software components. The design principles
---------------------- of analysis model can be used to specify and design these data structures. Some
of the design principles for data specification are as follows:
----------------------
•  he systematic analysis principles applied to function and behaviour
T
---------------------- should be applied to data.
•  ll data structures and the operations to be performed on each should be
A
----------------------
identified.
---------------------- •  mechanism for defining the content of each data object should be
A
established and used to define both data and operations applied to it.
----------------------
•  he data structure may be known to only those modules that make direct
T
---------------------- use of the data contained within the structure.
---------------------- •  library of useful data structures and operations that may be applied to
A
them should be developed, for example, a class library.
---------------------- •  software design and programming language should support the
A
---------------------- specification of abstract data types.
These principles are the basis for component-level data design. It can be applied
---------------------- to both analysis and design-level activities.
----------------------

----------------------

----------------------

150 Software Engineering with UML


Notes
Check your Progress 2
----------------------
State True or False. ----------------------
1. A data design transforms object design into data structure.
----------------------
2. ER diagrams can be transformed into data structure.
----------------------
3. Design of data structure is a part of the analysis phase.
----------------------

Activity 2 ----------------------

----------------------
Draw the ER diagram for Activity 1 and study the overall data structure for
the different entities used in it. ----------------------

----------------------
7.4 ARCHITECTURAL STYLES
----------------------
Architectural styles are the set of rules that comprises components
----------------------
and connectors that interface between components and properties of object.
Architectural style is a family of the architectures constrained by components, ----------------------
connectors and their topology.
----------------------
An architectural style is a transformation that is imposed on the design of
an entire system. The intent is to establish a structure for all components of the ----------------------
system.
----------------------
An architectural style categorised by set of components that performs
functions, constraints on integration and semantic models are useful to ----------------------
understand overall system properties.
----------------------
Some of the architectural styles are:
----------------------
1. Data flow style
• Batch sequential ----------------------
• Pipes and filters ----------------------
2. Data centred ----------------------
• Blackboard
----------------------
• Repository.
----------------------
3. Call and return
• Main program and subroutines ----------------------
• Remote Procedure calls. ----------------------
4. Layered ----------------------
5. Object Oriented
----------------------

Architectural Design 151


Notes 1. Data flow style: It depicts the flow of the data throughout the components
of the system at a time until it produces the output or is stored into the
---------------------- database. It gives the picture of orderly motion of the data from process to
process. In this, the input is transformed into the output through a series of
---------------------- components which may do computations of manipulations on the input.
---------------------- These are two types of data flow style: batch sequential and pipes and filters.
---------------------- •  atch sequential: In batch sequential, the processing steps are
B
independent components. Each step in this gets completed before the next
---------------------- step begins. Data flows between different steps. A program development
is an example. The different steps in a program carries the data input
----------------------
and produces output. Example of batch sequential style is a transaction
---------------------- processing system which gets input from the user, validates the input,
updates and reports to user. All these functionalities are carried in a
---------------------- sequential order.
---------------------- Input Validate Update Report
----------------------
Fig. 7.1: Batch Sequential Style
---------------------- •  ipes and filters: In pipes and filters, each component has a set of input
P
---------------------- data and set of output data through pipes. Filters incrementally transform
set of input data to data at output. The transformation through these filters
---------------------- is called stream-to-stream filter and another type of filter is called local
transformation. Pipes transfer data from filter of output of the component
---------------------- to the filter of input. It is similar to the pipes and filter concept used in
---------------------- UNIX system.
pipes filter filter
----------------------

---------------------- filter filter filter filter

----------------------
filter filter filter
----------------------

---------------------- filter

---------------------- pipes and filters

----------------------
filter filter filter filter
----------------------
batch sequential
----------------------
Fig. 7.2: Pipes and Filters and Batch Sequential
----------------------
2. Data centred: In this type, the file or data store is at the centre of the
---------------------- architecture and the client software components access it frequently to
view or modify. Data store is a repository of the data.
----------------------

152 Software Engineering with UML


The data store can be accessed by client software. These data stores Notes
are passive, which means that the client software can access the data
independent of any changes to the data or the actions of other client ----------------------
software. A variation to this is “blackboard” that sends notifications to
client software when data of interest to the client changes. ----------------------

client client ----------------------


software software
client client ----------------------
software software
----------------------

----------------------
Data store

client
(repositor or
black board)
client ----------------------
software software
----------------------

client ----------------------
client
software software
----------------------
Fig. 7.3: Data Centre ----------------------
3. Call and return: The call and return architectural style is different from ----------------------
filters and pipes, which transform control from one component to another
component and return. It comprises the main program and subroutines, and ----------------------
hierarchical layers. In the main program and subroutine call and return,
transformation is between the main program and their subprograms called ----------------------
subroutines. The following figure shows call and return architecture style ----------------------
elements.
Main Program ----------------------

----------------------

controller controller controller ----------------------


subprogram subprogram subprogram
----------------------

----------------------
Application Application Application
Program Program Program ----------------------
Fig: 7.4: Call and Return: Main Program, Subprogram and Application
----------------------
Program
4. Object orientation: Object orientation comprises object, class, subclass, ----------------------
instance, method, encapsulation, inheritance, dynamic binding, reuse and
----------------------
maintenance and message passing concepts. Modularity and reuse are the
main advantages of object orientation. ----------------------
In an object, data and functions encapsulated in an object is called abstract ----------------------
data type. These objects communicate with each other through functions.
This is called message passing. It is essential in the system that these ----------------------

Architectural Design 153


Notes objects may communicate with each other to run the system and perform
the user operations. In UML, class diagrams and object diagrams give a
---------------------- picture of object orientation style.
---------------------- 5. Layered architecture: Layered architecture depicts hidden layer,
middle layers and view layers. The view layer hides lower-level layers.
---------------------- It maintains the abstraction in the different layers so modularity between
the systems can be maintained. These different layers communicate with
----------------------
each other through interfaces.
----------------------
Outer Layer
---------------------- e.g. Application Level

---------------------- Middle Layer


e.g. Basic Utilities
----------------------
Core Layer
----------------------

----------------------

----------------------
Fig. 7.5: Layered Architecture
----------------------
In Figure 7.5 there are three layers - core layer, middle layer and application
---------------------- layer. Each layer is serving to other layers, which means the core layer is serving
the middle layer and the middle layer is serving the outer layer.
----------------------

---------------------- Check your Progress 3


----------------------
State True or False.
---------------------- 1. An architectural style is a family of architectures that defines the
---------------------- organisation of the components, their interfaces and properties.
2. A data flow style contains different layers.
----------------------
3. In object orientation style, the functions and operations are
---------------------- encapsulated in an object.
---------------------- 4. In layered architecture, the different components are organised into
different layers and these layers communicate through interfaces.
----------------------
5. 
In call and return architecture style, hierarchical structuring of
---------------------- modules are used.

----------------------

---------------------- Activity 3

---------------------- Sketch the different architectural styles for Activity 1.


----------------------

154 Software Engineering with UML


7.5 MAPPING REQUIREMENTS IN SOFTWARE Notes
ARCHITECTURE
----------------------
Mapping requirements is the mapping between the requirements gathered
in the analysis phase with the design of the software architecture. It establishes ----------------------
type of information flow. The information flow is of two types - transform flow ----------------------
and transaction flow.
----------------------
Data Flow Diagram (DFD) is an architectural model which facilitates
the transformation from analysis model to design description of the program ----------------------
structure.
----------------------
The DFD shows the information flow. Transformation of information flow to
program structure can be achieved using the following steps: ----------------------
i. Information flow type is established. ----------------------
ii. Indication of flow boundaries.
----------------------
iii. Control hierarchy is defined by factoring.
----------------------
iv. The resultant program structure is refined using design measures and
heuristics. ----------------------
7.5.1 Transform Mapping
----------------------
In transform flow, overall data flow is sequential and flows along a small
number of straight line paths called pipes. The data flows between the different ----------------------
components of the system. In Data Flow Diagram (level 0), for example, data
----------------------
enters into the system from external entities and it gets transformed into the
internal processes. It transforms from internal processes and outputs from the ----------------------
software as output. The transformation occurs in a sequential order from one
component to another component in the system. ----------------------
The sequence of steps followed in transform mapping is as follows: ----------------------
i. Analysing the fundamental system model ----------------------
ii. Defining the correctness of the data flow diagram by analysing it and
refining the data flow diagram ----------------------

iii. Analysing DFDs for transformation and transaction flow characteristics ----------------------
iv. Specifying incoming and outgoing flow boundaries for transform centre ----------------------
v. Performing first-level factoring ----------------------
vi. Performing second-level factoring
----------------------
vii. Refining the first iteration architecture using design heuristics for
improved software quality ----------------------
7.5.2 Transaction Mapping ----------------------
A system consists of many data items. When an event comes to data item,
----------------------
it has many information flow paths. So occurrence of an event triggers one of
the information flow paths from the available paths. This is called transaction. ----------------------

Architectural Design 155


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 7.6: Transaction Flow and Transformation Flow

---------------------- In this, a data flow diagram which carries the requirement analysis can
be mapped into the program structure. The program structure obtained by DFD
---------------------- can be later refined using design measures and heuristics. After refinement the
architecture description is refined and elaborated.
----------------------
A transaction centre is a centre from where an information flow has many
---------------------- outgoing paths. Information flows within the processes and transaction centres
within a system and goes outside of the system which is called transaction. The
----------------------
evaluation of the transaction is done based on the flow path and its value.
----------------------
Check your Progress 4
----------------------

---------------------- Fill in the blanks.

---------------------- 1. 
_________ is an architectural model which facilitates the
transformation from analysis model to design.
---------------------- 2. __________ is defined by factoring.
---------------------- 3. The transformation occurs into the processes is in ____________
order.
----------------------
4. A _________ is a center from where an information flow has many
---------------------- outgoing paths.
----------------------

---------------------- Activity 4

---------------------- Consider the example in Activity 1. Draw transaction flow and transform
---------------------- flow diagrams. Refer to the books named in Suggested Reading for drawing.

----------------------
7.6 REFINING ARCHITECTURAL DESIGN
----------------------
Refinement of software architecture during early stages of design is to
---------------------- be encouraged. Refining architectural design contains the processing of the

156 Software Engineering with UML


narrative developed for each model. A narrative gives the description of the Notes
information flow in the system. It gives the description of the data item or data
centre, where the data is stored and processed in the software system. It gives ----------------------
the description about major decision points and procedures, tasks. It briefs about
the constraints, restriction and special features like file input, output operations, ----------------------
hardware dependencies, data stores, special events based on timings. A narrative ----------------------
is useful for first level generation of the design specification and it can be later
incremented based on requirement. ----------------------
The system comprises several modules, which communicate with each ----------------------
other. These modules communicate through the interfaces. So in refinement
of architectures, the interfaces are described in detail for each module. In the ----------------------
analysis model, the ER diagrams describe the view of data organisation which
----------------------
are implemented in data design. The data design is used to implement the data
structures. Data structures are of two types - local data structures and global ----------------------
data structures. It is necessary to correctly define the local and global data
structures. When refining the software architecture it is important to refine the ----------------------
local and global data structures. At the last phase of refining architectures, the
----------------------
design reviews are conducted and noted.
----------------------
Check your Progress 5
----------------------
State True or False. ----------------------
1. Refinement of architecture design contains the processing of the ----------------------
narrative developed for each model.
2. A narrative gives description of the information flow in the system. ----------------------

3. When refining the software architecture it is important to refine the ----------------------


local and global data structures.
----------------------

----------------------
Activity 5
----------------------
Consider the different functions with its scenarios of the example in Activity
----------------------
1 and write the narrative for the information flows.
----------------------
7.7 USER INTERFACE DESIGN (UID) ----------------------
User interface design begins with the identification of user, task, and ----------------------
environmental requirements. User interface is a module or component within
software system which gives interface to the user to interact with the system ----------------------
components. It can be visualised and through this the user can interact with the
system. The users who interact with the user interface component can be an internal ----------------------
user and external user. ----------------------
Following a set of interface design principles, design identifies interface
objects and actions and then creates a screen layout that forms the basis for a user ----------------------

Architectural Design 157


Notes interface prototype User interface has two main modules or subcomponents.
These are input and output. In the input, user can provide information to the
---------------------- system through the input devices. Output is the processed information which
the user gets from the system. The output information produced can be in the
---------------------- form of reports.
---------------------- The user interface design process consists of generating and then testing
a user interface design. User interface design is a field of Human Computer
----------------------
Interaction (HCI). Human computer interaction is a method or technique
---------------------- that deals with analysing and designing how users and computer software
communicates with each other. It deals with the designing of Graphical User
---------------------- Interface (GUI). Users perform their tasks using user interfaces, so it is important
to include the relationship between the different task stages. It means there
----------------------
should be a relationship between the different tasks which the user performs
---------------------- with their system. In the user interface, the conceptual model of the system
should be consistent. It should contain the description of state and alternatives
---------------------- in the interface. Users should receive feedback continuously.
---------------------- 7.7.1 The Golden Rules of User Interface Design

----------------------

----------------------

----------------------

----------------------

----------------------
The golden rules of user interface design are:
----------------------
1. Place users in control interface
---------------------- •  ser performs specific tasks using the interface. When user performs
U
---------------------- some task with the system the interface should not preempt the user
to do some unnecessary task or action.
---------------------- • Maintain abstraction from unauthorised users.
---------------------- • Provide different preferences to the users.
---------------------- •  llow user to interrupt the interaction and undo the operation
A
performed by him.
----------------------
• Streamline and customise interaction with the interface.
---------------------- 2. Reduce user’s memory load
---------------------- •  good computer interface should help user to remember information
A
while using the interface.
----------------------
• I t should not force users to remember and repeat what the computer
---------------------- should do for them.
---------------------- • Interface should provide the undo, redo and default fields.

158 Software Engineering with UML


• Interface should provide the visual clues to facilitate users. Notes
• I nterface should provide defaults, shortcuts to the user to do his task
----------------------
speedily and there should be no need to remember the procedures
for performing the task. ----------------------
• I nterface should contain the consistent object syntax. It makes easy
----------------------
for the user to understand the object relationships and their actions.
• I nterface can be promoted to use the real-world metaphors to transfer ----------------------
knowledge about how things look and work. So it is important to
----------------------
use the consistent metaphors as user can easily recognise it.
• I nterface should always provide easy access to the common features ----------------------
and actions used by the user. ----------------------
• I n an interface the grouping of menus, items, information should be
proper so that the user can visualise their task clearly. It is the skill ----------------------
of the graphic artist to categorise these menus, options and items ----------------------
clearly.
3. Make the interface consistent ----------------------

• I t is important to make consistency in the interface. But sometimes ----------------------


due to change in the environment it becomes necessary to change
----------------------
the interface consistency. So it should be prioritised depending on
the environment. ----------------------
•  he interface should sustain the continuity of the user’s task and
T
----------------------
maintain consistency across all the screens and outputs that the
system produces. ----------------------
7.7.2 Task Analysis and Modelling ----------------------
In task analysis and modelling, a software engineer plays an important
role. A software engineer studies the tasks of the user who wants to complete ----------------------
his tasks to accomplish the goal. He maps the analysed requirements of the user ----------------------
to the system implemented. A good definition of the tasks should accommodate
the user’s model, design of the system and the system’s perception. A software ----------------------
engineer can use an object-oriented approach by realising the real-world objects
and user actions or functions. A software engineer should model the interface ----------------------
objects and visualise their real-world implementations. ----------------------
7.7.3 Interface Design Activities
----------------------
While designing an interface it is important to establish the goal for each
task to be performed with its intention. A task is a sequence of actions that the ----------------------
user performs with the system. The result of completion of all the sequence
----------------------
of actions within the task is a goal which the user wants to achieve. So it is
necessary to map the goal to the sequence of the actions that the user performs ----------------------
while performing the task.
----------------------
The state of the system should be indicated while the user performs his
task. For example, when the user is performing a task the system should be ----------------------

Architectural Design 159


Notes in active state or inactive state or in waiting state to reduce the load on the
interface by multiple users.
----------------------
As user’s control is one of the golden rules while designing an interface,
---------------------- these controls should be well defined. User control can affect the state of the
system. In this, proper definitions should be given to the affecting states of the
---------------------- system while placing the user control. The interpretation of each state within
the system from the user’s point of view should be described in detail.
----------------------
The following issues should be considered while designing the interface:
----------------------
• Errors occurred during the information handling.
---------------------- • Help facilities to the user, for example, online helps and offline helps.
---------------------- • Response time of the system to the events triggered by the user.
---------------------- For getting users attention to the interface data, the following data display
qualities can be implied:
---------------------- • Intensity
---------------------- • Marking

---------------------- • Fonts
• Inverse video
----------------------
• Blinking
---------------------- • Colour standard and colour blinking
---------------------- • Audio
7.7.4 Design Evaluation
----------------------
The following steps are followed while evaluating an interface:
----------------------
i. Evaluation of preliminary design.
---------------------- ii. Construction of first interface prototype.
---------------------- iii. User evaluates interface and gives feedback.
---------------------- iv. Evaluation results and feedback studied by designer.
v. Modifications in the design are made as per inputs from the user.
----------------------
vi. Construction of next prototype.
----------------------
vii. If interface is not complete then go to step iii. and repeat.
---------------------- The evaluation criteria are as follows:
---------------------- i. The length and complexity of the interface specification and level of
learning required by user.
----------------------
ii. Definition of interaction time of the user. The number of user’s task and
---------------------- average number of the tasks performed by the user. Evaluation of the
system’s efficiency for these tasks.
----------------------
iii. Indication of memory load to the total number of tasks performed by
---------------------- users.

160 Software Engineering with UML


iv. Interface style, help facilities and error handling functions. Notes

Check your Progress 6 ----------------------

----------------------
State True or False.
----------------------
1. A user interface gives an interface to the internal users of the system.
2. Task analysis on the interface is done by a software engineer. ----------------------

3. Undo, redo and auto fill reduce user’s memory load. ----------------------
4. Abstraction from unauthorised users is nothing but an activity of ----------------------
placing control on user interface.
----------------------

----------------------
Activity 6
----------------------
Create a sample user interface with different menu options and descriptions
----------------------
for the scenario mentioned in Activity 1.
----------------------
Summary ----------------------

•  oftware architecture represents the overall view of a software product.


S ----------------------
It depicts the organisation of software components, its structure and
connection between them. ----------------------

•  ata design translates data objects into data structures within the software.
D ----------------------
A data design is useful at the component level and the architecture level.
----------------------
•  rchitectural styles are the set of rules that comprises components,
A
connectors that interface between components and properties of object. ----------------------
•  esign refinement is required to analyse and review the design of smaller
D ----------------------
units within the software system. A data flow diagram is mapped into the
program structure using one of the two mapping approaches - transaction ----------------------
flow and transform flow.
----------------------

Keywords ----------------------

•  FD: Graphical representation of the “flow” of data through an


D ----------------------
information system. ----------------------
•  rchitecture style: Particular pattern that focusses on the large scale of a
A
----------------------
system.
• Architectural design: Represents the structure of the data and program. ----------------------

----------------------

----------------------

Architectural Design 161


Notes
Self-Assessment Questions
----------------------
1. What is architectural design? Explain in detail.
---------------------- 2. Explain the different architectural styles.
---------------------- 3. Explain transaction mapping and transform mapping.

---------------------- 4. What are the different golden rules for user interface design?

---------------------- Answers to Check your Progress


---------------------- Check your Progress 1
---------------------- State True or False.
---------------------- 1. True
2. True
----------------------
3. True
----------------------
4. True
---------------------- Check your Progress 2
---------------------- State True or False.
---------------------- 1. True
2. True
----------------------
3. True
----------------------
Check your Progress 3
---------------------- State True or False.
---------------------- 1. True
---------------------- 2. False
3. True
----------------------
4. True
----------------------
5. True
---------------------- Check your Progress 4
---------------------- Fill in the blanks.
---------------------- 1. 
DFD is an architectural model which facilitates the transformation from
analysis model to design.
----------------------
2. Control hierarchy is defined by factoring.
---------------------- 3. The transformation occurs into the processes in sequential order.
---------------------- 4. A transaction centre is a centre from where an information flow has many
outgoing paths.
----------------------

162 Software Engineering with UML


Check your Progress 5 Notes
State True or False.
----------------------
1. True
----------------------
2. True
3. True ----------------------
Check your Progress 6 ----------------------
State True or False. ----------------------
1. True
----------------------
2. True
----------------------
3. True
4. True ----------------------

----------------------
Suggested Reading
----------------------
1. Bass, Len, Paul Clements and Rick Kazman. Software Architecture in
----------------------
Practice. Addison Wesley.
2. Clements, Paul, Felix Bachmann, Len Bass, David Garlen, James Ivers, ----------------------
Reed Little, Robert Nord and Judith Stafford. Documenting Software
----------------------
Architectures: Views and Beyond. Addison Wesley.
3. 
Pressman, Roger and Bruce Maxim. Software Engineering: A ----------------------
Practitioner’s Approach. McGraw-Hill. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Architectural Design 163


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

164 Software Engineering with UML


Software Testing Techniques
UNIT

8
Structure:

8.1 Introduction
8.2 Software Testing Fundamentals
8.3 Test Case Design
8.4 Testing Principles
8.5 White-Box Testing
8.5.1 Basis Path Testing
8.5.2 Control Structure Testing
8.6 Black-Box Testing
8.7 Software Testing Strategies
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

Software Testing Techniques 165


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Discuss the fundamentals of software testing
----------------------
• Compare different testing strategies
---------------------- • Explain white-box testing and black-box testing
----------------------
8.1 INTRODUCTION
----------------------
The technique of detecting faults in the system is called software testing.
---------------------- Testing is the process of exercising and evaluating a system or system component
by manual or automated means to verify that it satisfies specified requirements.
----------------------
Software testing is very useful to improve the confidence level of a
---------------------- software developer and a user in the system. A software tester is a professional
in the software development team who is responsible for testing the software. It
----------------------
assesses different factors in the software, such as performance, memory usage,
---------------------- reliability, security and usability. Testing often accounts for more project effort
than any other software engineering action. If it is conducted haphazardly, time
---------------------- is wasted, unnecessary effort is expended, and even worse, errors sneak through
undetected. It would therefore seem reasonable to establish a systematic strategy
----------------------
for testing software. In this unit, we will be discussing about the various points
---------------------- related to software testing techniques.

---------------------- 8.2 SOFTWARE TESTING FUNDAMENTALS


----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
If a software which is going to be tested have a better quality in terms of
---------------------- its working it become easy to test. The input and output to the software should
be easily observable, so wrong input and output can be identified correctly. This
---------------------- wrong input and output are because of internal errors in the information flow,
computations within the modules, so it should be detected automatically.
----------------------
Software consists of different objects that have different states. Objects
---------------------- have their attributes (variables) and operations (functions). It is necessary to

166 Software Engineering with UML


keep control on variables. These variables should be controllable by the software Notes
tester. It is easy to test the software which is decomposable into different
modules. Independent modules can be tested separately and then integrated into ----------------------
the system. It makes detection of faults in the code and information flow easy.
The code in the software should be simple and understandable. These are some ----------------------
of the characteristics of software to be tested. ----------------------
A software tester must understand the functioning of each module in
----------------------
the software and find the probabilities of how the software might fail. During
software testing, a software tester conducts various types of tests on the software ----------------------
to detect the errors. The number of tests conducted should have different
parameters for evaluation so that they reduce the redundancy or repetition in ----------------------
the test and testing the software becomes completely easy. A good test should
----------------------
uncover all the errors in the software. Different tests should be conducted
separately. If there is a series of tests conducted, it may hide some errors and ----------------------
have some side effects.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Types of Testing
Static Testing: “Dry Run Testing” Requires only the source code of the ----------------------
product, not binaries or executables. It does not involve executing the programs, ----------------------
but involves people going through the code.
----------------------
Also examines specification, design and user documents.
Syntax checking and manually reading the code to find errors is the ----------------------
method of static testing. This type of testing is mostly done by the developer
----------------------
himself. Static testing is usually the first type of testing done on any system.
Dynamic testing: Here codes are executed, testers generally do dynamic ----------------------
testing, all testing tools come under this category. Programs are checked with
----------------------
input and behavior is observed. Certain no of inputs and outputs values are
checked. ----------------------
This also includes feeding the program with input and observe behavior, ----------------------
checking a certain number of input and output values
----------------------

----------------------

Software Testing Techniques 167


Notes
Check your Progress 1
----------------------

---------------------- State True or False.


1. Software testing is used to test performance, memory usage, reliability,
----------------------
security and usability of software.
---------------------- 2. Software testing is used for detecting errors in the software.
---------------------- 3. Software testing is used to test the information flow.

---------------------- 4. A software testing activity contains a series of tests.

----------------------
Activity 1
----------------------

---------------------- Consider any software you use. Try to find the defects at the operational
level. If defects are found, document it.
----------------------

---------------------- 8.3 TEST CASE DESIGN


Test case design assists the software team in developing a complete set of
----------------------
test cases for black-box and white-box testing. The number of tools falls into
---------------------- two categories - static testing and dynamic testing. In the industry, code-based
testing tools, specialised testing languages and requirement- based testing tools
---------------------- are used. In code-based testing tools, code is an input and performs number of
analyses to generate the test cases. Specialised testing languages help software
----------------------
engineers to write detailed test specification that describes test cases and
---------------------- logistics for its execution. Requirement-based testing tools isolate specific user
requirements and suggests test cases that will exercise requirements. Dynamic
---------------------- testing tools interact with an executing program, check path coverage and test
value of a variable and execution flow.
----------------------

---------------------- Check your Progress 2


----------------------
State True or False.
----------------------
1. Test cases are designed by software tester.
---------------------- 2. Test cases are developed for the errors which occur during the
execution of program, path coverage.
----------------------

----------------------
Activity 2
----------------------
For the documented errors in Activity 1, try to create the test case design
----------------------
which contains the way of correcting errors. View sample test case designs
---------------------- on the Web.

168 Software Engineering with UML


8.4 TESTING PRINCIPLES Notes
1. Tests should be planned long before testing begins ----------------------
2. All tests should be traceable to customer requirements
----------------------
3. The Pareto principle applies to software testing
----------------------
4. Exhaustive testing is not possible.
5. Testing should begin “in the small” and progress toward testing “in the ----------------------
large.”
----------------------
1. All tests should be traceable to customer requirements :- The objective of
software testing is to uncover errors. It follows that the most severe defects ----------------------
(from the customer’s point of view) are those that cause the program to
----------------------
fail to meet its requirements.
2. Tests should be planned long before testing begins. Test planning can ----------------------
begin as soon as the requirements model is complete. Detailed definition
----------------------
of test cases can begin as soon as the design model has been solidified.
Therefore, all tests can be planned and designed before any code has been ----------------------
generated.
----------------------
3. The Pareto principle : In this context the Pareto principle implies that 80
percent of all errors uncovered during testing will likely be traceable to 20 ----------------------
percent of all program components. The problem, of course, is to isolate
these suspect components and to thoroughly test them. ----------------------
4. Testing should begin “in the small” and progress toward testing “in the ----------------------
large.” The first tests planned and executed generally focus on individual
components. As testing progresses, focus shifts in an attempt to find errors ----------------------
in integrated clusters of components and ultimately in the entire system. ----------------------
5. Exhaustive testing is not possible. The number of path permutations for
even a moderately sized program is exceptionally large. For this reason, ----------------------
it is impossible to execute every combination of paths during testing. It is ----------------------
possible, however, to adequately cover program logic and to ensure that
all conditions in the component-level design have been exercised. ----------------------

8.5 WHITE-BOX TESTING ----------------------

A white-box test is conducted to know the internal working of the ----------------------


component or module in software. It tests whether all the internal operations are ----------------------
executed according to the specification. It tests all the components according to
their operations closely. ----------------------
A system composed of several modules interact with each other through ----------------------
a logical path. A logical path describes a flow of statements, functions in a
module as well as between the modules. In white-box testing these logical paths ----------------------
are tested.
----------------------
Control structures loops and conditions are tested and test cases are
generated. These tests cases give guarantee that all the independent paths within ----------------------

Software Testing Techniques 169


Notes a module are exercised at least once and all logical decisions are exercised on
their true and false side. All loops and data structures are executed to test their
---------------------- boundaries and outputs.
---------------------- White-box testing methods are based on the internal structure of the code.
A method based on statement coverage, branch coverage, path coverage and
---------------------- data flow coverage is sometimes called structural testing or glass-box testing. It
concentrates more on examination of the code rather than specification.
----------------------
8.4.1 Basis Path Testing
----------------------
It enables a test case designer to derive a logical complexity measure of
---------------------- a procedural design and this measure is used as a guideline for defining a basis
set for execution path.
----------------------
A flow graph notations are used in basis path testing. A flow graph contains
---------------------- the nodes which specify a statement or group of statements. A node can contain
a conditional expression and may be used for branching and predictions. These
---------------------- nodes are connected by using edges or links. In graphical notation, these nodes
---------------------- and edges bound an area in the flow graph. This area is called a region.

----------------------
Region3
----------------------
Region2
----------------------
Region1
----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 8.1: Flow graph and Regions
----------------------
In Figure 8.1, the start node is 0 and the end nodes are 7 and 8. The link
---------------------- between two nodes is called an edge. Each node indicates a set of statements
or a statement or a condition. The output of the nodes which contain conditions
---------------------- produces a Boolean value true or false. The basis set for the figure above are as
---------------------- follows:
Path 1:0-1-8
----------------------
Path 2:0-1-2-3-6-7
----------------------
Path 3:0-1-4-5-6-7
---------------------- Path 4: 0-1-4-5-6-7-1-8
---------------------- Path 5: 0-1-2-3-6-7-1-8

----------------------

170 Software Engineering with UML


The number of paths in the basis set is determined by cyclomatic Notes
complexity. Cyclomatic complexity can be computed in three ways as follows:
----------------------
• Number of regions = 3
• V(G) = 10 edges – 9 nodes + 2 =3 ----------------------
• V(G) = 2 predicate nodes + 1 = 3 ----------------------
A cyclomatic complexity is a quantitative measure of logical complexity ----------------------
of the program. It gives upper bound for the number of tests to be conducted to
ensure all the statements in the program are executed at least once. ----------------------
8.4.2 Control Structure Testing ----------------------
A white-box testing tests the validity of the loops in the program. In a
program there are different types of loops. These are nested loops, simple loops, ----------------------
concentrated loops and structured loops. ----------------------
In simple loops, the evaluation can be done by using different stages
----------------------
like skipping the loop entirely, one pass and two passes through the loops and
checking the upper and lower boundaries. In nested loops the testing starts from ----------------------
the inner loop to outer loop. Concentrated loops are independent loops and
testing is done like in simple loop or nested loop approach. ----------------------

----------------------
Check your Progress 3
----------------------
State True or False. ----------------------
1. Flow graph notations are used in control structure testing.
----------------------
2. Different types of loops are tested in control structure testing.
----------------------
3. Nodes and edges bound an area called region.
4. White-box testing tests code segment of only one component. ----------------------

----------------------
Activity 3 ----------------------

Consider the different functionalities of the software identified in Activity ----------------------


1 and draw the flow graph for any one functionality. Identify possible paths ----------------------
for getting the output from it.
----------------------
8.6 BLACK-BOX TESTING ----------------------
Black-box testing focusses on the functional requirement and information ----------------------
domain of the software. So it is also called functional testing. It has a data-driven
approach. Code is ignored and it concentrates on specification. It complements ----------------------
the white-box testing by identifying different classes of errors. Usually it can
be conducted after the white-box testing. A tester identifies the set of input ----------------------
conditions and tests all the functional requirements. ----------------------

Software Testing Techniques 171


Notes Black-box testing is used to identify the missing functions or incorrect
functions within the software. The different modules in the software interact
---------------------- through the interfaces. These are to be tested. The different errors in the data
structure and database access are tested in black-box testing. The behaviour,
---------------------- performance, initialisation and termination errors are detected in this type of
---------------------- testing. In this testing a program is treated as a black box. The input to the
program and output from the program is verified as per the specification. It
---------------------- is a complement to the white-box testing, which does not include the internal
working of the modules in terms of coding and control structure errors. If the
---------------------- output is not correct as per the specification, the control will be given to the
---------------------- white-box tester who is a programmer who knows about the code. There are
two methods used in black-box testing - equivalence partitioning and boundary
---------------------- value analysis.
---------------------- Equivalence Partitioning
Equivalence partitioning divides input domain of the program into the
----------------------
classes. These classes are useful for deriving the test cases. An ideal test case
---------------------- is derived which can uncover all types of errors related to a particular class. In
this way the different ideal test cases are derived to uncover errors in different
---------------------- classes.
---------------------- An equivalence class describes all valid and invalid states of input
classes and exercises all the attributes of that class. Some guidelines are used
---------------------- to define the input classes. For example, input condition specifies a range
that equivalence classes are one for valid and two for invalid. If input range
----------------------
is 1-10, then equivalence classes are {1….10}, {x<1},{x>10}. If the input
---------------------- condition specifies a specific value, say 29, then its equivalence classes are
{29},{x<29},{x>29}. If the input condition specifies a member set or Boolean
---------------------- value, then one valid and one invalid equivalence classes are formed.
---------------------- Boundary Value Analysis

---------------------- Boundary value analysis is a test case design method that complements
equivalence partitioning. It selects test cases for the edges of the classes as
---------------------- boundary values. It derives the test cases from both input and output domain.
For example, if an input condition specifies a range bounded by values a and b,
---------------------- test cases should be designed with values a and b as well as values just above
---------------------- and just below a and b. If an input condition specifies a number of values, a test
case should be developed that exercises the minimum and maximum numbers.
---------------------- Values just above and just below the minimum and maximum are also tested.
----------------------

----------------------

----------------------

----------------------

----------------------

172 Software Engineering with UML


Notes
Check your Progress 4
----------------------
State True or False. ----------------------
1. Equivalence partitioning is used for dividing the input into classes.
----------------------
2. In boundary value analysis, the values just below the maximum and
minimum range value are analysed. ----------------------
3. A tester requires the knowledge of the code when performing black- ----------------------
box testing.
----------------------
4. Black-box testing is called functional testing.
5. Cyclomatic complexity measures the amount of decision logic in the ----------------------
program module. ----------------------

----------------------
Activity 4
----------------------

Consider the example in Activity 1 and perform the black-box testing. ----------------------
Design test cases for it.
----------------------

8.7 SOFTWARE TESTING STRATEGIES ----------------------

----------------------
Software testing consists of a set of activities which are to be planned in advance
and systematically. A template for software testing contains a set of steps into ----------------------
which we can place test case design techniques and testing methods.
----------------------
There are different types of software testing strategies. Some of the characteristics
are as follows: ----------------------
•  o conduct effective testing, a software development team should conduct
T
----------------------
formal technical reviews. As a result of this many errors are eliminated.
• Testing begins from the component level to the system level. ----------------------

• Different testing techniques are appropriate at different points in time. ----------------------


•  esting can be done by a software developer and an independent test
T ----------------------
group if the project is large.
----------------------
•  esting and debugging are different activities. Debugging must be
T
accommodated in any testing strategy. ----------------------
•  testing strategy must provide guidance to the practitioner and set of
A
----------------------
milestones to the manager. So testing is done from the low-level code
segment to the high level which validates major system functions. ----------------------

----------------------

----------------------

Software Testing Techniques 173


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 8.2: Software Testing Strategies


---------------------- Strategic Issues
---------------------- Tom Gilb addressed some issues for successful software strategy implementation.
•  pecify product requirements in a quantifiable manner long before testing
S
----------------------
commences.
---------------------- • State testing objectives explicitly
---------------------- •  nderstand the users of the software and develop a profile for each user
U
category.
----------------------
• Develop a testing plan that emphasises “rapid cycle testing”.
----------------------
• Build “robust” software that is designed to test itself.
---------------------- • Use effective formal technical reviews as a filter prior to testing.
---------------------- •  onduct formal technical reviews to assess the test strategy and test cases
C
themselves.
----------------------
• Develop a continuous improvement approach for the testing process.
---------------------- There are some strategies that can be used to test software. These are unit
---------------------- testing, integration testing, validation testing and system testing.
1. Unit Testing: A system is a collection of modules that is integrated
---------------------- together to perform a system task to achieve users’ goal. When software
---------------------- is to be tested, it requires testing the units of the software independently
and then placing into the integration with the other modules. It is majorly
---------------------- used in white-box testing. It tests small units of code. It is performed by a
programmer who writes the code. The different tools used for this are test
---------------------- driver or harness, code coverage analyser, automatic test case generator.
---------------------- It exercises internal paths and its aim is to exercise and examine every

174 Software Engineering with UML


statement of code at least once. A major criterion for this is that it requires Notes
coverage of every path within the program.
----------------------
The disadvantage of unit testing (white box) is that the programmer who
writes the code, if he tests the code then he may be biased by his previous ----------------------
experiences and he is the only one who understands the code. It means
that he has created error while writing the code and is responsible for ----------------------
detecting it. Unit testing has the highest percentage of occurrence of
----------------------
errors.
A unit testing has algorithmic and logical approach to test the code and ----------------------
internal paths. It is used to test local and global data structures. The
----------------------
control structures and boundary conditions are tested. A unit test is
considered adjunct to coding step. This can be done when coding starts ----------------------
or after generating complete source code. In a software, components are
connected to each other. It means these are not stand- alone. So drivers ----------------------
and/or stub software must be developed for each unit test. A driver is
----------------------
nothing but the main program and stubs subordinate it. Stubs are called
dummy subprograms, which use subordinate module interface. ----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Fig. 8.3: Driver and Stubs
----------------------
2. Integration Testing: In unit testing, the individual units called modules
are tested with its code and internal paths. After unit testing these units are ----------------------
integrated with the other units to make the system functioning. Integration
testing tests the communication between of two or more units. This test ----------------------
is performed by programmers and it focusses on interfaces between these ----------------------
integrated units.
----------------------
There are several issues in performing this testing. One of the issues
focusses on order of integration of these units. The order of integration ----------------------
should be decided. Another issue is regarding the correctness and
compatibility of the external components. ----------------------
Integration testing is necessary because one module can have effects ----------------------
on another module. When several units are combined together it may
function differently and produce wrong output. Interfacing errors are not ----------------------
detected in unit tests. In this case integration testing is useful.
----------------------
In this type of testing two approaches are used - top-down approach and
bottom-up approach. A supplementary approach that can be applied with ----------------------
these two approaches is called critical unit first.
----------------------

Software Testing Techniques 175


Notes Figure 8.4 shows an approach to top-down integration testing and bottom-up
integration testing.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Fig. 8.4: Approach to Top-Down and Bottom-Up Integration Testing

---------------------- Top-down integration testing starts with high-level system at the top level
and integrates from top-down by replacing individual components by stubs.
---------------------- The main control module which integrates is called driver and the individual
components that are replaced are called stubs. Depth-first and breadth-first
---------------------- approach can be used to integrate these modules. The main control module
---------------------- called driver subordinates stubs. Depending on the approach, breadth-first or
depth-first stubs are replaced by modules at a time. Tests run on individual
---------------------- modules that are integrated. Once the tests are conducted the stubs are replaced
by individual modules. Top-down integration is used for verifying major
---------------------- decision points early in the test process. Top-down approach is not as complex
---------------------- as bottom-up approach.
I n bottom-up integration testing, low-level components are combined into
---------------------- clusters or builds. Driver which is a control program is written to coordinate
---------------------- these sub- functions input and output. These individual clusters are tested. At
last drivers are removed and clusters are combined moving upwards in the
---------------------- program structure, which is a hierarchical structure.
---------------------- 3. Validation Testing: The goal of validation testing is to make sure software
functions as per the requirement of the customer. The result of integration
---------------------- testing is validation testing. In integration testing, all the individual
modules are exercised and integrated with testing of interfaces which
---------------------- uncover and correct all the errors. If the result of the integration testing
---------------------- is as per the customer’s requirements, the software can be validated. It
involves regression testing, alpha testing and beta testing.
----------------------
Validation testing tests if the software meets all the requirements defined
---------------------- in the System Requirement Specification (SRS). So it is important to
have proper system requirement specification documentation. If it is not
---------------------- available, regression testing is performed to determine the modifications
required in the software. Regressing testing involves repeating existing
----------------------

176 Software Engineering with UML


validation tests for light changes or modifications. Notes
It is important that the developer knows the users’ acceptance of the system.
----------------------
The developer should provide an outline of the software functions needed
to be focused by customers as to involve customers into the software ----------------------
testing process to get the formal acceptance from each user. Most of the
software developers use a process to do this task, which include alpha and ----------------------
beta testing to uncover errors that only the customers can see. Alpha tests
----------------------
are conducted at the developer’s site by end-users. At the developer’s
site the software is in controlled environment, that is, as per developer’s ----------------------
setting. The beta testing is conducted at the end-user’s site. In this case
the developers are generally not present. So it is the user’s responsibility ----------------------
to record errors and report to the developer at regular intervals. As per
----------------------
the errors reported by the customer, the developer does modifications or
changes and prepares the software for release at customer’s base. ----------------------
4. System Testing: In system testing complete software is exercised. It
----------------------
contains a series of tests. It verifies whether all the components of the
system are properly integrated and function properly. It is usually done ----------------------
by professional testers. Some of the tests conducted are recovery testing,
security testing and stress testing. ----------------------
In most of the software systems a recovery strategy is defined to protect ----------------------
the system from faults. The software system should be fault tolerant, it
means that occurrences of fault should not affect the complete software ----------------------
components and halt everything. Recovery testing is a system test that
----------------------
forces the software to fail in a variety of ways and verifies that recovery
is properly performed. ----------------------
Software system should protect its data and manage the sensitive ----------------------
information or actions that can harm the software. Security system verifies
the protection of the software. ----------------------
Stress testing tests the probability of the failure of the software during ----------------------
high load on its resources and program modules. It tests the manner in which the
system responds to the high load on its resources. It is conducted by demanding ----------------------
resources in abnormal quantity and volume.
----------------------
Performance testing is designed to test the run-time performance of
software within the context of an integrated system. It includes all the steps ----------------------
of testing process. These are often conducted with stress testing and on both
hardware and software. ----------------------

The Debugging Process ----------------------


Debugging is not testing but often occurs as a consequence of testing. The ----------------------
debugging process begins with the execution of a test case. Results are assessed
and a lack of correspondence between expected and actual performance is ----------------------
encountered. In many cases, the non-corresponding data are a symptom of
----------------------
an underlying cause as yet hidden. The debugging process attempts to match
symptom with cause, thereby leading to error correction. ----------------------

Software Testing Techniques 177


Notes The debugging process will usually have one of two outcomes:
(1) the cause will be found and corrected or
----------------------
(2) the cause will not be found.
----------------------
In the latter case, the person performing debugging may suspect a
---------------------- cause, design a test case to help validate that suspicion, and work toward error
correction in an iterative fashion.
----------------------
Testing Cycle
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

---------------------- Testing and debugging are different processes. The detected errors are
located and corrected in the debugging process. The debugging process starts
---------------------- with the output of the testing result. These errors are located and a repairing
plan is prepared. The repairing plan helps in correcting these errors and the
----------------------
software is re-tested. It helps in test case creation. Locating and repairing the
---------------------- errors are difficult. The following figure shows the debugging process.
Test case result
----------------------

---------------------- Debugging process

---------------------- Locating Error

---------------------- Error Correction

---------------------- Regression Testing

----------------------
Test case creation
----------------------
Fig. 8.5: Flow of Debugging Process
----------------------

----------------------

178 Software Engineering with UML


Notes
Check your Progress 5
----------------------
State True or False. ----------------------
1. Alpha and beta testing are performed in system testing.
----------------------
2. Alpha testing is performed at the customer’s end.
----------------------
3. Unit test tests the path between the modules.
4. Testing and debugging are the same process. ----------------------

5. In validation testing, the SRS documentation is compared with the ----------------------
system functions.
----------------------

----------------------
Activity 5
----------------------
Consider to develop a software for automatic tea/coffee vending machine.
----------------------
Identify its various components and draw the hierarchical structure for its
components and document its unit testing, integration testing and system ----------------------
testing process.
----------------------

Summary ----------------------

•  he main objective of software testing is to detect errors. A software


T ----------------------
testing process contains a series of tests. These are unit testing, integration ----------------------
testing, validation testing and system testing.
----------------------
•  nit and integration tests verify the functional components and their
U
integration into the software system. Validation testing validates the ----------------------
system requirement documentation to the actual results of the software.
These tests help software developer to develop test cases. ----------------------
•  wo techniques are used for test case design; one is white-box testing and
T ----------------------
another is black-box testing.
----------------------
• White box focusses on basis path (flow graph notation) and the control
structures used in the program. In black-box testing, equivalence ----------------------
partitioning and boundary value analysis are conducted. These are used
to check the set of input classes to the software. ----------------------

----------------------
Keywords
----------------------
•  esting strategies: An outline that describes the testing approach of the
T
software development cycle and is created to inform project managers, ----------------------
testers, and developers about some key issues of the testing process. ----------------------

----------------------

Software Testing Techniques 179


Notes •  nit test: A software testing method by which individual units of source
U
code, sets of one or more computer program modules together with
---------------------- associated control data, usage procedures and operating procedures are
tested to determine if they are fit for use.
----------------------
• I ntegration test: The phase in software testing in which individual
---------------------- software modules are combined and tested as a group.
---------------------- •  ystem test: Testing conducted on a complete, integrated system to
S
evaluate the system’s compliance with its specified requirements.
----------------------
•  hite-box testing: A method of testing software that tests internal
W
---------------------- structures or workings of an application, as opposed to its functionality.

---------------------- •  lack-box testing: A method of software testing that examines the


B
functionality of an application without peering into its internal structures
---------------------- or workings.

----------------------
Self-Assessment Questions
----------------------
1. What is software testing? Explain the strategy used for software testing.
----------------------
2. Explain unit testing, integration testing and system testing.
---------------------- 3. Explain the debugging process. Also explain how it differs from testing.
----------------------
Answers to Check your Progress
----------------------
Check your Progress 1
----------------------
State True or False.
---------------------- 1. True
---------------------- 2. True
---------------------- 3. True
4. True
----------------------
Check your Progress 2
----------------------
State True or False.
---------------------- 1. False
---------------------- 2. True
---------------------- Check your Progress 3
State True or False.
----------------------
1. False
----------------------
2. True
---------------------- 3. True
---------------------- 4. False

180 Software Engineering with UML


Check your Progress 4 Notes
State True or False.
----------------------
1. True
----------------------
2. False
3. False ----------------------
4. True ----------------------
5. True ----------------------
Check your Progress 5
----------------------
State True or False.
----------------------
1. True
2. True ----------------------

3. False ----------------------
4. False ----------------------
5. True
----------------------

Suggested Reading ----------------------

1. 
Pressman, Roger and Bruce Maxim. Software Engineering: A ----------------------
Practitioner’s Approach. McGraw-Hill. ----------------------
2. Shooman, M.L. Software Testing. New York: McGraw-Hill.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Software Testing Techniques 181


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

182 Software Engineering with UML


Software Configuration Management
UNIT

9
Structure:

9.1 Introduction
9.2 Software Configuration Management: Concept
9.3 Elements of Configuration Management System
9.4 The SCM Repository
9.5 SCM Process and Tasks
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading

Software Configuration Management 183


Notes
Objectives
----------------------
After going through this unit, you will be able to:
----------------------
• Describe the concept of software configuration management
----------------------
• Discuss the elements of SCM
---------------------- • Explain the concept of SCM repository and SCM process
---------------------- 9.1 INTRODUCTION
----------------------
Change is inevitable when computer software is built. And change
---------------------- increases the level of confusion when several members of a software team are
working on a project. Confusion arises when changes are not analyzed before
---------------------- they are made, recorded before they are implemented, reported to those with a
need to know, or controlled in a manner that will improve quality and reduce
----------------------
error.
---------------------- A software development process includes different phases, so change
can occur any time during these phases. Software Configuration Management
----------------------
(SCM) is an umbrella activity which is similar to software project management
---------------------- and software quality assurance. It can be applied throughout the software
development process. SCM is an essential part of project management and
---------------------- software engineering practices. It includes different activities, such as:
---------------------- • Identifying change

---------------------- • Controlling change


• Ensuring proper implementation of change.
----------------------
• Reporting changes
----------------------

---------------------- 9.2 SOFTWARE CONFIGURATION MANAGEMENT: CONCEPT

---------------------- A formal definition of software configuration management is as follows:


“Software configuration management is a set of engineering procedures
----------------------
for tracking and documenting the software throughout its life cycle, to ensure
---------------------- that all changes are recorded and current state of the software is known and
reproducible.”
----------------------
Software configuration management is different from software
---------------------- maintenance. Software maintenance is a collection of software engineering
activities that occur after delivering the software to customer and when the
---------------------- software is operational. SCM tracks and controls the activities like identifying
change, controlling change, ensuring proper implementation and reporting
----------------------
changes from beginning to the end of software project.
---------------------- The output of the software process is information that may be divided into
three broad categories:
----------------------

184 Software Engineering with UML


1. computer programs (both source level and executable forms), Notes
2. work products that describe the computer programs (targeted at various
----------------------
stakeholders), and
3. data or content (contained within the program or external to it). ----------------------
The items that comprise all information produced as part of the software ----------------------
process are collectively called a software configuration.
----------------------
The goal of SCM is to maximise productivity by minimising mistakes
caused by confusion when coordinating software development. SCM identifies, ----------------------
organises and controls modification to software build by a software development
team. ----------------------

What is the origin of these changes? The answer to this question is as ----------------------
varied as the changes themselves. However, there are four fundamental sources
of change: ----------------------

●● New business or market conditions dictate changes in product requirements ----------------------


or business rules.
----------------------
●● New stakeholder needs demand modification of data produced by
information systems, functionality delivered by products, or services ----------------------
delivered by a computer-based system.
----------------------
●● Reorganization or business growth/downsizing causes changes in project
priorities or software engineering team structure. ----------------------
●● Budgetary or scheduling constraints cause a redefinition of the system or ----------------------
product
A view of SCM from the point of view of different roles within an ----------------------
organisation is as follows: ----------------------
• Project manager: An auditing system.
----------------------
• SCM manager: A controlling, tracking and policy making mechanism.
----------------------
• Software engineer: Changing, building and access control mechanism.
• Customer: Quality assurance and product identification mechanism. ----------------------
A software process produces information which comprises computer ----------------------
programs (source code and executable files), documentation that describes
computer programs and data. These items are collectively called software ----------------------
configuration process.
----------------------
During the software development phases, the major task is to control the
change during the various phases of software development life cycle. Some of ----------------------
the reasons to do the software changes are: ----------------------
• Errors detected in software need to be collected.
----------------------
•  ew business or market conditions making it necessary to do changes in
N
product requirement and business rules. ----------------------

----------------------

Software Configuration Management 185


Notes •  ustomers can demand modifications in the information system and
C
functionality of a product.
----------------------
•  ustomers can also demand for changes in services delivered by a
C
---------------------- computer- based system.
• I n certain conditions, organisation may require to reorganise the system
----------------------
as well as the changes caused by growing or downsizing the project
---------------------- priorities or software engineering team structure.
•  udgetary or scheduling constraints management is a set of activities
B
----------------------
that has been developed to manage changes throughout the software
---------------------- development life cycle.

---------------------- SCM can be viewed as a software quality assurance activity that is


applied throughout the software development process. So without SCM we can
---------------------- face problems like simultaneous update of data, i.e., multiple users are trying
to update the information, redundancy in maintenance, redundancy in code or
---------------------- common code and no control over software versions.
----------------------
Check your Progress 1
----------------------

---------------------- State True or False.


1. Software configuration management is also referred to as change
----------------------
management.
---------------------- 2. An SCM activity starts at the beginning of a project and ends at the
end of the project.
----------------------
3. The outcome of software process is the information that contains
---------------------- computer programs, documents and data.
---------------------- 4. SCM is similar to the software maintenance phase in the software
development life cycle.
----------------------

---------------------- Match the following.


---------------------- i. Project manager a. A controlling, tracking, and policy making
mechanism
---------------------- ii. SCM manager b. Changing, building and access control
mechanism
----------------------
iii. Software engineer c. Quality assurance and product identification
---------------------- mechanism
iv. Customer d. An auditing system
----------------------

----------------------

----------------------

----------------------

186 Software Engineering with UML


Notes
Activity 1
----------------------
Try to find out the various roles and tasks allocated to a software development ----------------------
team for development of software.
----------------------

9.3 ELEMENTS OF CONFIGURATION MANAGEMENT SYSTEM ----------------------

----------------------
A configuration management system has the following elements:
1. Configuration elements: These are a set of tools coupled with a file ----------------------
management or database management system that enables access to and
----------------------
management of each Software Configuration Item (SCI).
2. Process elements: These are collection of procedures and tasks that ----------------------
define an effective approach to change management for all stakeholders
----------------------
of that process.
3. Construction elements: These are the elements required to construct the ----------------------
software. It is a set of tools that automate the construction of software by ----------------------
ensuring that proper set of valid components (i.e., the correct version) is
assembled. ----------------------
4. Human elements: Software team uses a set of tools and process features ----------------------
to implement software configuration management system effectively.
Baselines ----------------------

There are several reasons to make changes during the software development ----------------------
process. Some of changes are due to changing customer requirements, software
----------------------
development team wants to change their technical approach, and managers
want to change or modify the project development approach. So the concept of ----------------------
baseline is used to control these changes.
----------------------
As per the definition of IEEE, a baseline is defined as “a specification or
product that has been formally reviewed and agreed upon that thereafter serves ----------------------
as the basis for further development and that can be changed only through
formal change control procedure.” ----------------------
In a software development process, a baseline is the outcome of each ----------------------
phase which can be serves as a basis for further phases. A software development
process, for example, contains requirement analysis which has a basis of system ----------------------
specification and the outcome is software requirement specification which can ----------------------
be used as a basis for the software design phase. The outcome of the software
is data specification which is a basis of the coding phase. The outcome of ----------------------
coding phase is source code file which can be a basis for the testing phase. The
outcome of testing phase is operational system which can be used as a basis for ----------------------
implementation or product release. So during each of these phases a baseline is ----------------------
used which is formerly agreed upon by the software development team.
----------------------

Software Configuration Management 187


Notes So a baseline is a specification that can be considered as a basis for further
development and that can be changed after formal change procedures. It is a
---------------------- milestone in the development of software and is marked by delivery of one or
more Computer Software Configuration Items (CSCI) that have been approved
---------------------- as a consequence of a formal technical review. So a CSCI is a work product (as
---------------------- listed in MIL-STD-498), a test suit or a software component.
Version
----------------------
Versions are created after an item in SCI is baselined and freezed. The
---------------------- term freezing means changes in that item can be done only after creating a
new version. So a version control system ensures the versioning of a software
----------------------
system in a given time. A version control automation system can be developed
---------------------- to do the functionalities of the versioning like labelling the product, developing
the hierarchical structure for the system, creating versions and documentation.
----------------------

---------------------- Check your Progress 2

---------------------- Fill in the blanks.


---------------------- 1. ___________________ elements are a collection of procedures and
tasks that define an effective approach to change management for all
---------------------- stakeholders of that process.
---------------------- 2. _________________ elements are required to construct the software.
---------------------- 3. _______________ elements are coupled with a file management or
database management system.
----------------------
4. The changes made after freezing the baseline for software creates
---------------------- new __________.

----------------------

---------------------- Activity 2

---------------------- Consider a library automation system. Identify the different phases of


---------------------- software development life cycle and the different baselines for these phases.

----------------------
9.4 THE SCM REPOSITORY
----------------------
A paper-based repository (e.g., file cabinet) has several issues. Some of
---------------------- the issues are listed below:
---------------------- • Finding SCIs in less time is difficult.
---------------------- • No control over changes in items.
• Creating or constructing new versions is time-consuming
----------------------
• Determining the relationships between configuration items is difficult.
----------------------

188 Software Engineering with UML


So today’s automated SCM repository has solutions to the problems Notes
related to paper-based repository. An automated SCM repository is a set of
mechanisms and data structures that allow a software team to manage change ----------------------
in an effective manner. It works as a medium for accumulation and storage of
software engineering information. There are several tools which are integrated ----------------------
with the repository to interact with it. ----------------------
An SCM repository has different functions as follows:
----------------------
• Data integrity
----------------------
• Information sharing
• Tool integration ----------------------

• Data integration ----------------------


• Methodology enforcement ----------------------
• Document standardisation
----------------------
Data integrity validates the entries within databases, ensures consistency
and cascading of modification within database. Information sharing functionality ----------------------
shares the information among developers and tools, manages and controls the
----------------------
multiuser access. The tool integration function within an SCM repository is used
to establish a data model that can be accessed by many software engineering ----------------------
tools and it also helps to control access to the data within the system. The data
integration functionality allows various SCM tasks to be performed on one or ----------------------
more CSCIs. Methodology enforcement defines an ER model for the repository
----------------------
that implies a specific process model for software engineering. And finally a
standard approach is used to create the software engineering documents. ----------------------
To work with the above functionalities, different tools are to be integrated ----------------------
with the SCM repository. Some of them are as follows:
• Versioning ----------------------

• Dependency tracking ----------------------


• Change management ----------------------
• Requirement tracing
----------------------
• Configuration management
----------------------
• Audit trails
Versioning tools are used to save and retrieve all repository objects based ----------------------
on their version numbers. Dependency tracking and change management tools ----------------------
are used to track and respond to the changes in an object state and relationships
of all objects in the repository. Requirement tracing can be done in two ways. ----------------------
One is forward tracing, which is used to track the design and construction
components and deliverables that result from a specific requirement specification. ----------------------
The second is backward requirement tracking which is used to identify which ----------------------
requirement generated any given work product.
----------------------

Software Configuration Management 189


Notes A configuration management tool is used to track a series of configurations
representing specific project milestones or production release. Audit trail tools
---------------------- are used to establish information about when, why and by whom changes are
made in the repository.
----------------------

---------------------- Check your Progress 3


----------------------
Fill in the blanks.
---------------------- 1. ___________ and _____________ tools are used to track and respond
---------------------- to the changes in an object state and relationships of all objects in the
repository.
---------------------- 2. _____________________ tools are used to establish information
---------------------- about when, why and by whom changes are made in the repository.
3. The ____________ function validates the entries within databases,
---------------------- ensures consistency and cascading of modification within database.
---------------------- 4. The ______________ function within an SCM repository is used
to establish a data model that can be accessed by many software
----------------------
engineering tools.
----------------------

---------------------- Activity 3
----------------------
Consider the example of Activity 2. Construct a conceptual SCM repository.
----------------------

---------------------- 9.5 SCM PROCESS AND TASKS


Some of the objectives of software configuration management process are:
----------------------
• Identification (tracking multiple versions to enable efficient changes)
---------------------- • Change control (authority to approve and prioritise changes)
---------------------- • Version control (control changes before and after release to customer)
• Configuration auditing (ensuring changes are made properly)
----------------------
• Reporting (telling others about changes made)
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------
Layers of SCM Process

190 Software Engineering with UML


To discuss the SCM process, the following questions can be raised: Notes
•  ow does a software development team identify the elements of a
H
----------------------
software configuration?
•  ow do organisations manage the versions of an existing program (and its
H ----------------------
documentation) in a manner that will enable changes to be accommodated
----------------------
effectively?
•  ow does an organisation control these changes before and after the
H ----------------------
software is released to the customer?
----------------------
• Who has the repository for approving and ranking changes?
----------------------
• How can we ensure that changes have been made properly?
• What mechanism is used to apprise others of changes that are made? ----------------------

As per discussion in the SCM process, the SCM tasks are as follows: ----------------------
1. Identification ----------------------
• I dentification task names each SCI separately and organises it into ----------------------
SCM repository using object-oriented approach.
• I t identifies each object with its name, description and behaviour. ----------------------
The name of an object is unique and unambiguous to all other ----------------------
objects. Description contains the software configuration item type,
an identifier, change and version information. ----------------------
• List of resources needed by object. ----------------------
• The object realisation in terms of the document, file and the model.
----------------------
2. Change control
----------------------
• I t is an activity that ensures quality and consistency during the
changes that are made during the software development process. ----------------------
• I f there are changes to be done, a request is sent to the configuration ----------------------
control authority, which is called the Change Control Board (CCB).
• Engineering Change Order (ECO) is generated for each change. ----------------------

•  ew modified objects are added to the repository and old objects


N ----------------------
are removed.
----------------------
• The new objects are tested for appropriate SQA standards.
----------------------
•  arallel changes are to be controlled to synchronise and avoid
P
overwriting. ----------------------
3. Version control
----------------------
•  anagement of different versions of configuration objects created
M
during the software development process. ----------------------

• It can have the following capabilities: ----------------------


n Project repository: It stores all the configuration objects. ----------------------

Software Configuration Management 191


Notes n Version management: It stores all versions of object.
n Make facility: Construct a specific software version.
----------------------
n I ssue tracking capability: It enables to track status of
---------------------- outstanding issues of each object.
---------------------- n System modeling approach: Templates, component
hierarchy, construction rules and verification rules.
----------------------
4. Configuration auditing
---------------------- •  erification of formal technical review conducted for evaluating
V
---------------------- technical correctness of the system.
• I t verifies whether the software process and software engineering
---------------------- standards were applied properly or not.
---------------------- • It verifies the reflection of changes within the attributes of object.
---------------------- •  erification of SCM standards for recording and reporting the
V
changes.
----------------------
• Verification of all related SCIs updation.
---------------------- 5. Configuration Status Reporting (CSR)
---------------------- • It is nothing but the accounting of configuration status.
---------------------- • It reports to the personnel regarding change of information.
• I t also answers the questions related to what happened, when, who
----------------------
did and the effects.
---------------------- •  CSR can be placed in the database which can be accessible to the
A
software development team members as well as the service team.
----------------------

---------------------- Check your Progress 4


----------------------
Fill in the blanks.
----------------------
1. Tracking multiple versions to enable efficient changes is called
---------------------- __________________.
2. 
Control changes before and after release to customer is called
----------------------
____________________.
---------------------- 3. _____________ ensures changes are made properly.
---------------------- _____________________ is an activity that ensures quality and
4. 
consistency of the changes that are made during the software
---------------------- development process.
---------------------- 5. _______________ is generated for each change.
---------------------- 6. ______________ is nothing but the accounting of configuration
status.
----------------------

192 Software Engineering with UML


Summary Notes

•  oftware Configuration Management (SCM) is an umbrella activity which


S ----------------------
is similar to software project management and software quality assurance.
----------------------
It can be applied throughout the software development process.
•  he goal of SCM is to maximise productivity by minimising mistakes
T ----------------------
caused by confusion when coordinating software development. SCM ----------------------
identifies, organises and controls modification to software build by a
software development team. ----------------------
•  here are four elements of software configuration management. These
T ----------------------
are configuration elements, process elements, construction and human
elements. ----------------------
•  baseline is a specification that can be considered as a basis for further
A ----------------------
development and can be changed after formal change procedures.
----------------------
•  he term freezing means changes in an item can be done only after
T
creating a new version. ----------------------
•  n automated SCM repository is a set of mechanisms and data structures
A
----------------------
that allows a software team to manage change in an effective manner.
•  n SCM repository has data integrity, information sharing, tool
A ----------------------
integration, data integration, methodology enforcement functions.
----------------------
•  o work with SCM functionalities, an SCM have versioning, dependency
T
tracking, change management, requirement tracing, configuration ----------------------
management and audit trails tools. ----------------------
•  ome of the objectives of software configuration management process
S
are: identification change control version control configuration auditing ----------------------
reporting. ----------------------

Keywords ----------------------

----------------------
•  oftware configuration management: Task of tracking and controlling
S
changes in the software. ----------------------
•  onfiguration items: The term configuration item or CI refers to the
C
----------------------
fundamental structural unit of a configuration management system.
Examples of CIs include individual requirements documents, software, ----------------------
models, and plans.
----------------------
•  oftware quality assurance: Monitoring the software engineering
S
processes and methods used to ensure quality. ----------------------

----------------------

----------------------

----------------------

Software Configuration Management 193


Notes
Self-Assessment Questions
----------------------
1. What is software configuration management? Explain the different
---------------------- functionalities of software configuration management.
2. What is an SCM repository? Explain the different functions and tools of
----------------------
SCM repository.
----------------------
Answers to Check your Progress
----------------------
Check your Progress 1
----------------------
State True or False.
----------------------
1. True
---------------------- 2. True
---------------------- 3. True
---------------------- 4. False
Match the following.
----------------------
i. – d.
----------------------
ii. – a.
---------------------- iii. – b.
---------------------- iv. – c.
---------------------- Check your Progress 2
---------------------- Fill in the blanks.

---------------------- 1. 
Process elements are a collection of procedures and tasks that define an
effective approach to change management for all stakeholders of that
---------------------- process.
---------------------- 2. Construction elements are required to construct the software.
3. 
Configuration elements are coupled with a file management or database
----------------------
management system
---------------------- 4. The changes made after freezing the baseline for software creates new
baseline.
----------------------

---------------------- Check your Progress 3


Fill in the blanks.
----------------------
1. 
Dependency tracking and change management tools are used to track and
---------------------- respond to the changes in an object state and relationships of all objects
in the repository.
----------------------
2. 
Audit trail tools are used to establish information about when, why and by
---------------------- whom changes are made in the repository.

194 Software Engineering with UML


3. The data integrity function validates the entries within databases, ensures Notes
consistency and cascading of modification within database.
----------------------
4. The tool integration function within an SCM repository is used to establish
a data model that can be accessed by many software engineering tools. ----------------------
Check your Progress 4
----------------------
Fill in the blanks.
----------------------
1. Tracking multiple versions to enable efficient changes is called
identification. ----------------------
2. Control changes before and after release to customer is called version ----------------------
control.
3. Change control ensures changes are made properly. ----------------------

4. 
Configuration auditing is an activity that ensures quality and consistency ----------------------
of the changes that are made during the software development process.
----------------------
5. Engineering change order (ECO) is generated for each change.
----------------------
6. Configuration status reporting is nothing but the accounting of
configuration status. ----------------------

----------------------
Suggested Reading
----------------------
1. Mette, Anne and Jonassen Hass. Configuration Management Principles
and Practice. Addison-Wesley. ----------------------
2. 
Pressman, Roger and Bruce Maxim. Software Engineering: A ----------------------
Practitioner’s Approach. McGraw-Hill.
----------------------
3. Sommerville, Ian. Software Engineering. Addison-Wesley.
----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

Software Configuration Management 195


Notes

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

----------------------

196 Software Engineering with UML

You might also like