Software Engineering With UML
Software Engineering With UML
WITH UML
COURSE WRITERS
Mr. Sachin Naik Prof. Nidhi Khare
Prof. Sonali Karale
EDITOR
Ms. Neha Mule
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.
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
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 - 94
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 95 - 120
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 121 - 134
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 135 – 150
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 151 – 164
8.1 Introduction
8.2 Software Testing Fundamentals
8.3 Test Case Design
8.4 White-Box Testing
8.4.1 Basis Path Testing
8.4.2 Control Structure Testing
8.5 Black-Box Testing
8.6 Software Testing Strategies
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
9 Software Configuration Management 165 – 176
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
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.
----------------------
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.
----------------------
---------------------- 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.
----------------------
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: ----------------------
− Some quality requirements are difficult to specify in an unambiguous ----------------------
way.
----------------------
− Software specifications are usually incomplete and often
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
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.
----------------------
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:
----------------------
---------------------- • Correction
• Adaptation
----------------------
• Enhancement
----------------------
• Prevention
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.1: The Waterfall Model
----------------------
---------------------- • All the activities are executed sequentially, so the final version will be
obtained only at the end of deployment activity. The customer must have
---------------------- patience.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.3: The Prototyping Paradigm
The process of prototyping involves the following steps: ----------------------
---------------------- 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.
• It couples the iterative nature of prototyping with the controlled and
---------------------- systematic approach of the waterfall model.
---------------------- • It facilitates the more complete versions of the software with rapid
development.
----------------------
• It 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.
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.4: 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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.5: The Spiral Model with Six Task Regions ----------------------
i.
Customer communication – task required to establish effective ----------------------
communication between developer and customer.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.6: The RAD Model
14 Software Engineering with UML
Using structured techniques, the developer first builds preliminary data Notes
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 ----------------------
code quality, but successful implementation and benefits often hinge on project ----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.7(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.
v. A software development discipline. ----------------------
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 ----------------------
---------------------- 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.
----------------------
---------------------- 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
---------------------- • Software myths prevail. Though they do are not clearly visible they have
the potential to harm all the parties involved in the software development
----------------------
process, mainly the developer team.
---------------------- • Software engineering is a layered technology. Most engineering
approaches (including software engineering) must rest on an organisational
----------------------
commitment to quality.
---------------------- • A software process contains a set of activities and associated results which
leads to development of software.
----------------------
• A linear process flow executes these activities in sequence. It begins with
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
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. 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.
----------------------
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. Scope management process for a project includes the following
----------------------
activities:
---------------------- Collect requirements: It is the process of defining and documenting the
1.
---------------------- 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 Breakdown Structure (WBS): This process involves
subdividing project deliverables and project work into smaller, more
---------------------- manageable components.
---------------------- 4. Verifying the scope: It is the process of formalising acceptance of 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:
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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,
as a Project Manager, to deliver the word-editing software;
---------------------- 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,
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
----------------------
----------------------
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): ----------------------
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) ----------------------
---------------------- 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.
---------------------- 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.
----------------------
----------------------
----------------------
• , , ----------------------
• , , ----------------------
----------------------
• Volume: ----------------------
----------------------
• 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 ----------------------
----------------------
----------------------
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;
----------------------
----------------------
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.
• The estimated values will be relatively unaffected by changes to the ----------------------
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 ----------------------
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. ----------------------
----------------------
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:
----------------------
Internal logical files – logical data that is nurtured inside the
---------------------- 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
• 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. ----------------------
----------------------
---------------------- • NASA’s NASA Cost Estimation Website provides various cost estimation
models. While heavily focused on aerospace and aeronautics, it is still
---------------------- worth looking over.
---------------------- • QSM provides a suite of products for software products called SLIM
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 ________.
----------------------
Activity 2
----------------------
---------------------- Find and list the cost estimation tools used in your organisation.
• Project scope is the part of project planning that involves determining ----------------------
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. ----------------------
• 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. ----------------------
• Types of Metrics are process metrics, product metrics and project metrics. ----------------------
• 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.
----------------------
• 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.
----------------------
• 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. ----------------------
• SLOC gives the size of the project by counting all the lines of source code
in a project. ----------------------
• Function point is a measurement unit or software metric for FPA that is ----------------------
the end-user analysis of the functions needed for the software.
----------------------
• 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. ----------------------
---------------------- Keywords
---------------------- • Software scope: It describes the data and control to be processed,
function, performance, constraints, interfaces and reliability.
----------------------
• SMART: Specific, Measurable, Achievable, Realistic and Time bound.
---------------------- • Estimation by Analogy: It is used to identify completed projects and
---------------------- 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.
----------------------
Answers to Check your Progress
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.
----------------------
1.
Stellman, Andrew and Jennifer Greene. Applied Software Project ----------------------
Management. O’Reilly Media. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
---------------------- • 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.
----------------------
----------------------
----------------------
----------------------
• Software: These are the programs that allow the hardware to process the ----------------------
data.
----------------------
• Databases: These are the gathering of associated files or tables containing
related data. ----------------------
• Network: It is a connecting system that allows diverse computers to ----------------------
distribute resources.
----------------------
• Procedures: These are the commands for combining the components
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 3.2: System Engineering Hierarchy
58 Software Engineering with UML
3.3.1 Business Process Engineering Notes
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: ----------------------
• Uses an integrated set of procedures, methods and tools to identify how
----------------------
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. ----------------------
• Creates a framework for better information management distribution and ----------------------
control.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
System Engineering and Business Process Engineering 59
Notes • Analysis modeling allocates requirements into function, data and
behaviour.
----------------------
• Design modeling maps the analysis model into data/class, architectural,
---------------------- interface and component design.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
---------------------- • The term system may 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.
----------------------
• A computer-based system is essentially an information system using
---------------------- computer technology to carry out some or all of its planned tasks.
• System engineering deals with work processes, optimisation methods
----------------------
and risk management tools in projects. It overlaps technical and
---------------------- human-centred disciplines, such as control engineering, industrial
engineering, organisational studies and project management.
----------------------
• 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.
----------------------
• 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.
---------------------- • 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.
66 Software Engineering with UML
• The process of requirement engineering, which makes use of various 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
----------------------
• System engineering: It uses a host of tools that include modeling and
simulation, requirements analysis and scheduling to manage complexity. ----------------------
• Product engineering: The process of designing and developing a device, ----------------------
assembly or system such that it can be produced.
----------------------
• Requirement engineering: It emphasises the use of systematic and
repeatable techniques that ensure the completeness, consistency and ----------------------
relevance of the system requirements.
----------------------
----------------------
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. ----------------------
---------------------- 3. False
4. False
----------------------
5. True
----------------------
---------------------- 2.
Watson, Gregory H. Business Systems Engineering: Managing
Breakthrough Changes for Productivity and Profit. Wiley.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
4.1 INTRODUCTION
----------------------
----------------------
----------------------
----------------------
----------------------
Customer
----------------------
Fig. 4.1: Representation of an Actor
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
---------------------- • Primary actor: A primary actor is a user whose goals are fulfilled by
the system. For example, an actor who interacts with the system with a
---------------------- specific goal.
---------------------- • Supporting actor: A supporting actor provides a service (e.g.,
information) to the system, clarifies the external interfaces and protocols.
---------------------- It can be a human actor or a non-human actor.
---------------------- • Offstage actor: An offstage actor has an interest in the behaviour but is
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.
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?
----------------------
• Do any entities interacting with the system perform multiple roles as
---------------------- actors?
• Which other entities (human or otherwise) might have an interest in the
----------------------
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.
74 Software Engineering with UML
2. Use case: Represented by ellipse Notes
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 ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
---------------------- • Used to describe similar behaviour across several use cases. The included
use case can be replicated and reused across several use cases.
---------------------- • It is a kind of macros in programming language.
---------------------- • Suppose a use case “P” includes another use case “Q”. At a particular
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.
Example: Consider a manufacturing company paying some part of salary ----------------------
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 ----------------------
• A new use case is derived from the old use case. The old use case is called ----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- 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.
Activity 1 ----------------------
----------------------
Draw a use-case diagram for a library management system. Assume
suitable actors and use cases. Try use include, extend and generalisation ----------------------
relationships. ----------------------
----------------------
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. It
also describes the static view of a system in terms of classes and relationships ----------------------
among them. ----------------------
---------------------- Name
----------------------
Attributes
----------------------
Operations
----------------------
---------------------- Fig. 4.7: Class in UML
---------------------- 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}
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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(){
} ----------------------
}
System Modelling and UML - I 81
Notes 4.4.2 Relationships
There are different types of relationships that can be used among classes.
----------------------
A class diagram is constructed using a collection of different classes and
---------------------- 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
----------------------
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.
----------------------
----------------------
----------------------
----------------------
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,
----------------------
----------------------
----------------------
----------------------
Fig. 4.15: Shared Aggregations
----------------------
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. ----------------------
The general class (parent) is called the base class or superclass and the ----------------------
more specific class is called the derived class or subclass.
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
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.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
----------------------
----------------------
----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
----------------------
Junction
----------------------
---------------------- Fork
----------------------
Join
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 4.26: Activity Diagram showing use of Swimlanes
----------------------
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
• 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).
----------------------
• Use cases are used during analysis of a project to identify and partition
system functionality. They separate the system into actors and use cases. ----------------------
It is a requirement analysis concept.
----------------------
• 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.
----------------------
• An activity diagram is used to model the flow of work. It basically shows
the communication between the systems. When objects interact with each ----------------------
other, the objects also perform work in terms of activities. ----------------------
• A typical work flow contains different states in the system. These are
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. ----------------------
----------------------
----------------------
----------------------
---------------------- 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.
92 Software Engineering with UML
Multiple Choice Single Response. Notes
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. 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 ----------------------
----------------------
----------------------
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
• In 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.
----------------------
• If 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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- Fig. 5.5: “loop” Combination Fragment
---------------------- • Suppose it is necessary for the Video Player to play the track “movie1.
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
----------------------
• It 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
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.7: “par” Combination Fragment
----------------------
• It 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.
• Upon receipt of this message, it sends two messages - message2 ( ) and ----------------------
message3 ( ) - to itself at the same time. Upon execution of these messages, ----------------------
control is transferred back to the object of class P.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- Fig. 5.8: “break” Combination Fragment
---------------------- • The frame has the keyword “break”. It indicates that when a break is
encountered, all statements within the frame are executed but the
---------------------- remainders of statements outside the frame are skipped.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.11: Iteration over a Collection
----------------------
• There is a multiobject which represents multiple objects of the class Y.
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
----------------------
----------------------
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
Activity 2 ----------------------
----------------------
Refer to the sequence diagram in Activity 1 and draw the collaboration
diagram. Compare the diagrams. ----------------------
----------------------
5.4 STATE CHART DIAGRAM ----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.20: Representation of a State
----------------------
The syntax for the activity compartment is: eventname argument-list ‘/’ action-
expression. ----------------------
• The third compartment is also an optional compartment depicting internal ----------------------
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.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.
---------------------- • Send-Clause: It is a special syntax for sending a message during a
transition from one state to another.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.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.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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.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” ----------------------
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig 5.33: Depiction of a Node with Attributes Operations and deployed
Components ----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- Activity 5
----------------------
Draw a deployment diagram for online shopping system.
----------------------
---------------------- Summary
---------------------- • A sequence diagram represents the interaction among different objects
of a system in the time order. These are used to document the systems
---------------------- requirements depending on the scenarios of the use-case diagram.
---------------------- • A collaboration diagram is a type of interaction diagram. Objects are
connected with numbered (sequenced) arrows. The numbered arrows are
---------------------- the links which depict the information flow between the objects.
---------------------- • Component diagrams are used to visualise the components of the system.
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.
• Deployment diagrams are used to model the topology of the physical
----------------------
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
----------------------
• Sequence diagram: An interaction diagram that shows how processes
---------------------- operate with one another and in what order.
---------------------- • Collaboration diagram: It represents a combination of information
taken from class, sequence and use-case diagrams describing both the
---------------------- static structure and dynamic behaviour of a system.
----------------------
----------------------
----------------------
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. ----------------------
----------------------
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
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
6.1 INTRODUCTION
----------------------
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.
----------------------
----------------------
Interface
---------------------- Design
----------------------
----------------------
Data 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.
124 Software Engineering with UML
4.
The design should minimise intellectual distance between the software Notes
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. ----------------------
----------------------
6.4 DESIGN CONCEPTS
----------------------
Some fundamental design concepts are as follows:
----------------------
1. Abstraction
• Abstraction refers to hiding details. In the modular software design ----------------------
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. ----------------------
• A data object is a collection of data that describes the data object. ----------------------
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
----------------------
• A software architecture gives an overall view of the software. It
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- 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:
---------------------- • First, scope needs to be defined which contains system objectives, major
software requirements, design constraints and limitations.
----------------------
• Second, data design which contains details about data objects and data
---------------------- structures, file and database structures which are logical structure, logical
record descriptions, access methods, global data, file and data cross-
---------------------- reference.
----------------------
• Appendix. ----------------------
The above sequence can be used as a template for documentation. ----------------------
----------------------
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
----------------------
• Design is the core of software engineering. Design consists of refinement ----------------------
of data structure, program architecture and interfaces. It also consists
of development of procedural details, reviewing and documentation of ----------------------
procedural details.
----------------------
• Researchers have proposed a number of software fundamental principles
and concepts. Design model helps in improving the quality of the software. ----------------------
• Design concepts are the basic criteria for design quality. ----------------------
---------------------- Keywords
---------------------- • Design principles: Describe fundamental ideas about the practice of a
good visual design.
----------------------
• Modularity: The degree to which a system’s components may be
---------------------- separated and recombined.
---------------------- 4. True
5. True
----------------------
Check your Progress 2
----------------------
State True or False.
---------------------- 1. False
---------------------- 2. False
---------------------- 3. True
----------------------
----------------------
----------------------
Suggested Reading
----------------------
1. Pressman, Roger and Bruce Maxim. 2014. Software Engineering: A
Practitioner’s Approach. McGraw-Hill. ----------------------
2. Sommerville, Ian. Software Engineering. Addison-Wesley. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
• Analyse and select architecture from available alternatives which can be ----------------------
best suited to customer requirements.
----------------------
• Make the architecture specification in detail.
----------------------
Check your Progress 1 ----------------------
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.
----------------------
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 ----------------------
---------------------- 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:
----------------------
• The systematic analysis principles applied to function and behaviour
---------------------- should be applied to data.
---------------------- • All data structures and the operations to be performed on each should be
identified.
---------------------- • A mechanism for defining the content of each data object should be
---------------------- established and used to define both data and operations applied to it.
• The data structure may be known to only those modules that make direct
---------------------- use of the data contained within the structure.
---------------------- • A library of useful data structures and operations that may be applied to
them should be developed, for example, a class library.
----------------------
• A software design and programming language should support the
---------------------- 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.
----------------------
Check your Progress 2
----------------------
----------------------
Activity 2
----------------------
Draw the ER diagram for Activity 1 and study the overall data structure for
---------------------- the different entities used in it.
----------------------
----------------------
Data store
---------------------- (repositor or
client
client black board)
software
---------------------- software
----------------------
client client
---------------------- software software
----------------------
----------------------
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 ----------------------
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. ----------------------
----------------------
Core Layer
----------------------
----------------------
----------------------
Fig. 7.5: Layered Architecture
---------------------- Activity 3
----------------------
Sketch the different architectural styles for Activity 1.
----------------------
----------------------
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. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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 ----------------------
----------------------
Check your Progress 4
----------------------
7.6 REFINING ARCHITECTURAL DESIGN
----------------------
Refining architectural design contains the processing of the narrative
----------------------
developed for each model. A narrative gives the description of the 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.
----------------------
----------------------
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 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. ----------------------
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.
----------------------
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 ----------------------
• User performs specific tasks using the interface. When user performs ----------------------
some task with the system the interface should not preempt the user
to do some unnecessary task or action. ----------------------
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. ----------------------
----------------------
Activity 6
----------------------
Create a sample user interface with different menu options and descriptions
----------------------
for the scenario mentioned in Activity 1.
----------------------
---------------------- Summary
---------------------- • Software architecture represents the overall view of a software product.
It depicts the organisation of software components, its structure and
----------------------
connection between them.
---------------------- • Data design translates data objects into data structures within the software.
---------------------- A data design is useful at the component level and the architecture level.
• Architectural styles are the set of rules that comprises components,
---------------------- connectors that interface between components and properties of object.
---------------------- • Design refinement is required to analyse and review the design of smaller
----------------------
Keywords
----------------------
• DFD: Graphical representation of the “flow” of data through an
information system. ----------------------
• Architecture style: Particular pattern that focusses on the large scale of a ----------------------
system.
----------------------
• Architectural design: Represents the structure of the data and program.
----------------------
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
----------------------
----------------------
----------------------
----------------------
----------------------
8
Structure:
8.1 Introduction
8.2 Software Testing Fundamentals
8.3 Test Case Design
8.4 White-Box Testing
8.4.1 Basis Path Testing
8.4.2 Control Structure Testing
8.5 Black-Box Testing
8.6 Software Testing Strategies
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
----------------------
Activity 1
----------------------
Consider any software you use. Try to find the defects at the operational ----------------------
level. If defects are found, document it.
----------------------
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.
---------------------- Region3
---------------------- Region2
---------------------- Region1
----------------------
----------------------
----------------------
----------------------
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. 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.6 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:
----------------------
• To conduct effective testing, a software development team should conduct
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.
----------------------
• Testing can be done by a software developer and an independent test
group if the project is large. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 8.2: Software Testing Strategies
----------------------
Strategic Issues
---------------------- Tom Gilb addressed some issues for successful software strategy implementation.
---------------------- • Specify product requirements in a quantifiable manner long before testing
commences.
----------------------
• State testing objectives explicitly
----------------------
• Understand the users of the software and develop a profile for each user
---------------------- category.
----------------------
----------------------
----------------------
----------------------
----------------------
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.
Software Testing Techniques 159
Notes 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.
---------------------- Figure 8.4 shows an approach to top-down integration testing 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
160 Software Engineering with UML
available, regression testing is performed to determine the modifications Notes
required in the software. Regressing testing involves repeating existing
validation tests for light changes or modifications. ----------------------
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 Art of Debugging
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 ----------------------
----------------------
Debugging process
----------------------
Locating Error
----------------------
Error Correction
----------------------
Regression Testing
----------------------
---------------------- 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
---------------------- • The main objective of software testing is to detect errors. A software
testing process contains a series of tests. These are unit testing, integration
---------------------- testing, validation testing and system testing.
---------------------- • Unit and integration tests verify the functional components and their
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.
----------------------
Keywords
----------------------
• Testing strategies: An outline that describes the testing approach of the
software development cycle and is created to inform project managers, ----------------------
testers, and developers about some key issues of the testing process.
----------------------
• Unit test: A software testing method by which individual units of source
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.
• Integration test: The phase in software testing in which individual ----------------------
software modules are combined and tested as a group. ----------------------
• System test: Testing conducted on a complete, integrated system to
----------------------
evaluate the system’s compliance with its specified requirements.
• White-box testing: A method of testing software that tests internal ----------------------
structures or workings of an application, as opposed to its functionality.
----------------------
• Black-box testing: A method of software testing that examines the
functionality of an application without peering into its internal structures ----------------------
or workings.
----------------------
----------------------
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. ----------------------
----------------------
Check your Progress 1
State True or False. ----------------------
1. True ----------------------
2. True ----------------------
3. True
----------------------
4. True
----------------------
---------------------- 1. False
2. True
----------------------
3. True
----------------------
4. False
---------------------- Check your Progress 4
---------------------- 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.
----------------------
----------------------
----------------------
----------------------
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
----------------------
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. ----------------------
----------------------
----------------------
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.”
----------------------
----------------------
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. ----------------------
----------------------
----------------------
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.
----------------------
---------------------- • Identification task names each SCI separately and organises it into
SCM repository using object-oriented approach.
---------------------- • It 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.
---------------------- • If 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.
---------------------- • New modified objects are added to the repository and old objects
are removed.
----------------------
• The new objects are tested for appropriate SQA standards.
----------------------
• Parallel changes are to be controlled to synchronise and avoid
---------------------- overwriting.
----------------------
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. ----------------------
4.
_____________________ is an activity that ensures quality and ----------------------
consistency of the changes that are made during the software
development process. ----------------------
---------------------- Keywords
----------------------
• Software configuration management: Task of tracking and controlling
---------------------- changes in the software.
• Configuration items: The term configuration item or CI refers to the
----------------------
fundamental structural unit of a configuration management system.
---------------------- Examples of CIs include individual requirements documents, software,
models, and plans.
----------------------
• Software quality assurance: Monitoring the software engineering
---------------------- processes and methods used to ensure quality.
----------------------
Self-Assessment Questions
----------------------
1. What is software configuration management? Explain the different
---------------------- functionalities of software configuration management.
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.
----------------------
3. The data integrity function validates the entries within databases, ensures
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------