Software Engineering With UML
Software Engineering With UML
WITH UML
COURSE WRITERS
Mr. Sachin Naik Prof. Nidhi Khare
Prof. Sonali Karale
EDITOR
Mr. Yogesh Bhosle
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 - 102
4.1 Introduction
4.2 System Modelling and Analysis
4.3 UML and UML Use Case-Driven Object-Oriented Analysis
4.3.1 Unified Modelling Language (UML)
4.3.2 UML Use Case-Driven Object-Oriented Analysis
4.3.3 Use-Case Diagram Components
4.3.4 Use Cases for Testing and Validation
4.4 Static Modelling using Class Diagram
4.4.1 Class Diagram
4.4.2 Relationships
4.5 Activity Diagram
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
5 System Modelling and UML - II 103 - 132
5.1 Introduction
5.2 Sequence Diagram
5.3 Collaboration Diagram or Communication Diagram
5.4 State Chart Diagram
5.5 Component Diagram
5.6 Deployment Diagram
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
vi
Unit No. TITLE Page No.
6 Design Concepts and Principles 133 - 146
6.1 Introduction
6.2 Design Process
6.3 Design Principles
6.4 Design Concepts
6.5 Design Heuristics for Effective Modularity
6.6 Design Model
6.7 Design Documentation
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
7 Architectural Design 147 – 164
7.1 Introduction
7.2 Software Architecture
7.3 Data Design
7.4 Architectural Styles
7.5 Mapping Requirements in Software Architecture
7.5.1 Transform Mapping
7.5.2 Transaction Mapping
7.6 Refining Architectural Design
7.7 User Interface Design (UID)
7.7.1 The Golden Rules of User Interface Design
7.7.2 Task Analysis and Modelling
7.7.3 Interface Design Activities
7.7.4 Design Evaluation
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
vii
Unit No. TITLE Page No.
8 Software Testing Techniques 165 – 182
8.1 Introduction
8.2 Software Testing Fundamentals
8.3 Test Case Design
8.4 Testing Principles
8.5 White-Box Testing
8.5.1 Basis Path Testing
8.5.2 Control Structure Testing
8.6 Black-Box Testing
8.7 Software Testing Strategies
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
9 Software Configuration Management 183 – 196
9.1 Introduction
9.2 Software Configuration Management: Concept
9.3 Elements of Configuration Management System
9.4 The SCM Repository
9.5 SCM Process and Tasks
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
viii
Introduction to Software Process Models
UNIT
1
Structure:
1.1 Introduction
1.2 The Evolving Role of Software
1.3 Software Myths
1.4 Software Engineering – Layered Technology
1.4.1 Generic View of Software Engineering
1.5 Software Process Models
1.5.1 Waterfall Model
1.5.2 Incremental Process Model
1.5.3 Evolutionary Software Process Model
1.5.4 Rapid Application Development (RAD) Model
1.6 Agile Computing
1.6.1 Extreme Programming
1.7 Component-Based Development
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
----------------------
1.2 THE EVOLVING ROLE OF SOFTWARE
----------------------
1.3 SOFTWARE MYTHS
----------------------
Myth is defined as “widely held but false notation” by the Oxford
Dictionary. So as in other fields, the software arena also has some myths to ----------------------
demystify. Roger Pressman insists “Software myths - beliefs about software
----------------------
and the process used to build it - can be traced to earliest days of computing.
Myths have a number of attributes that have made them insidious.” ----------------------
So, software myths prevail. But though they do, they are not clearly ----------------------
visible and have the potential to harm all the parties involved in the software
development process, mainly the developer team. Tom DeMarco says, “in the ----------------------
absence of meaningful standards, a new industry like software comes to depend
instead on folklore.” The given statement points out that the software industry ----------------------
caught pace just some decades back, so it has not matured to a formidable ----------------------
level and there are no strict standards in software development. There does not
exist one best method of software development that ultimately equates to the ----------------------
ubiquitous software myths.
----------------------
Primarily, there are three types of software myths, all the three are stated
below: ----------------------
1. Management myth ----------------------
2. Customer myth
----------------------
3. Practitioner/Developer myth. Before defining the above three myths one
by one, let’s scrutinise why these myths occur on the first place. ----------------------
So the problem understanding, i.e., requirement analysis must be done properly ----------------------
to avoid any problems in later stages as it will have devastating effects.
Management Myths ----------------------
----------------------
1.4 SOFTWARE ENGINEERING – LAYERED TECHNOLOGY ----------------------
----------------------
----------------------
----------------------
Fig 1.1 Software Engineering Layers
----------------------
1.4.1 Generic View of Software Engineering
----------------------
Engineering is the analysis, design, construction, verification and management
---------------------- of technical entities. Regardless of entities to be engineered, the following
questions must be asked and answered:
----------------------
• What is the problem to be solved?
---------------------- • What characteristics of entity are used to solve the problem?
---------------------- • How will the entity (and the solution) be realised?
---------------------- • How will the entity be constructed?
• hat approach will be used to uncover the errors that were made in the
W
----------------------
design and construction of the entity?
---------------------- • ow will the entity be supported over the long term, when the corrections,
H
---------------------- adaptations and enhancements are requested by the user of the entity?
Software is engineered by applying three distinct phases that focus on definition,
---------------------- development, and support.
---------------------- i. The definition phase focuses on what.
---------------------- ii. The development phase focuses on how.
iii. The support phase focuses on change. The changes are due to enhancements
----------------------
by changing customer requirements. The support phase reapplies the
---------------------- steps of definition and development phases. Four types of change are
encountered during the support phase:
----------------------
• Correction
---------------------- • Adaptation
---------------------- • Enhancement
---------------------- • Prevention
----------------------
----------------------
----------------------
----------------------
1.5 SOFTWARE PROCESS MODELS
----------------------
To develop a system, we need to go through a series of steps that is a road
----------------------
map which helps to build a system. The series of steps we follow forms a process.
So, a software process contains a set of activities and associated results which ----------------------
lead to software development. Some of the activities common to all software
are software process specification, which contains initiation and requirements, ----------------------
software design and specification, software testing and quality assurance and
----------------------
software maintenance. A software process model is a representation of software.
A generic process framework of software engineering involves generic ----------------------
major activities. These are: communication, planning, modelling, construction ----------------------
and deployment. In addition to these, project management, risk management,
quality assurance, change management are applied throughout the process. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig 1.2 Major Activities Of A Generic Process Model ----------------------
A linear process flow executes these activities in sequence. It begins with
communication and ends with deployment. An iterative process flow repeats ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.4: The Waterfall Model
----------------------
Modelled after the conventional engineering cycle, the linear sequential model
encompasses the following activities: ----------------------
i. System/Information engineering and analysis: System engineering and
----------------------
analysis includes gathering requirement at the system level with small
amount of top-level analysis and design, as any software is always a part ----------------------
of a large system or business.
----------------------
ii. Software requirements analysis: The requirement gathering process
is intensified and focused specially on software. The requirements are ----------------------
documented and reviewed with the customer.
----------------------
iii. Design: Software design focuses on four distinct attributes of a
program – data structure, software architecture, interface representation ----------------------
and procedural or algorithmic details. The design process translates
requirements into representation of the software that can be assessed for ----------------------
quality before coding. ----------------------
iv. Code generation: The design must be translated into a machine-readable
form by the code generation process. ----------------------
v. Testing: Once the codes are generated, program testing begins and focuses ----------------------
on the logical internals of the software, assuring that all statements have
----------------------
been tested and on the functional externals.
vi. Maintenance: Software will undergo many changes after it is delivered ----------------------
to the customer because of the errors that have been encountered.
----------------------
Some of the limitations of this model are as follows:
----------------------
• s it follows the sequential flow, the real projects rarely follow. It does not
A
directly support iteration. If any changes occur, it can cause confusion. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.5: The Incremental Model
---------------------- The product is decomposed into a number of components, each of which
---------------------- are designed and built separately (called builds). Each component is delivered
to the client when it is complete. This allows partial utilisation of product and
---------------------- avoids a long development time. It also creates a large initial capital outlay with
Disadvantages ----------------------
i. Resulting cost may exceed the cost of the organisation. ----------------------
ii. As additional functionality is added to the product, problems may arise
----------------------
related to system architecture which were not evident in earlier prototypes.
1.5.3 Evolutionary Software Process Model ----------------------
Evolutionary models are iterative. Prototyping model and spiral model are the ----------------------
examples of evolutionary model.
----------------------
i. Prototyping Model
----------------------
This is an evolutionary model. For complex systems, software evolves over
a period of time. Business or product requirement changes over a period ----------------------
of time as the development progress. Prototyping follows an evolutionary
and iterative approach. This is specifically used when requirements are ----------------------
not well understood. It serves as a technique for identifying software
----------------------
requirements. It focuses on those aspects of the software that are visible
to the user. Feedback is used to refine prototype. ----------------------
A prototype is a working model that is functionally equivalent to a
----------------------
component of the product. In many instances, the client only has a
general view of what is expected from the software product. In such a ----------------------
scenario, where there is an absence of detailed information regarding the
input to the system, the processing needs and the output requirements, the ----------------------
prototyping model may be employed.
----------------------
This model reflects an attempt to increase the flexibility of the development
process by allowing the client to interact and experiment with a working ----------------------
representation of the product. The developmental process only continues
----------------------
once the client is satisfied with the functioning of the prototype. At that
stage, the developer determines the specifications of the client’s real ----------------------
needs.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.6: The Prototyping Paradigm
----------------------
The process of prototyping involves the following steps:
---------------------- Table 1.1: Prototyping Steps
---------------------- 1. Identify basic requirements Determine basic requirements including
the input and output information desired.
---------------------- 2. Develop initial prototype The initial prototype is developed that
includes only user interfaces.
---------------------- 3. Review The customers, including end-users, ex-
amine the prototype and provide feed-
---------------------- back on additions or changes.
---------------------- 4. Revise and enhance the Using the feedback, both the specifica-
prototype tions and the prototype can be improved.
---------------------- Negotiation about what is within the
scope of the contract/product may be
---------------------- necessary. If changes are introduced, then
a repeat of step 3 and 4 may be needed.
---------------------- Advantages of prototyping
---------------------- 1.
Reduced time and costs: Prototyping can improve the quality of
requirements and specifications provided to developers, as what the user
---------------------- really wants can result in faster and less expensive software.
---------------------- 2. Improved and increased user involvement: Prototyping requires user
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.7: The Spiral Model
----------------------
The spiral model is used most often in large projects. The US military has
---------------------- adopted the spiral model for its Future Combat System program.
The spiral model is divided into a number of framework activities also called
----------------------
the “task regions”. Typically, there are between three and six task regions.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.8: The Spiral Model with Six Task Regions ----------------------
i.
Customer communication – task required to establish effective ----------------------
communication between developer and customer.
----------------------
ii. Planning – task required to define resources, timelines and other project-
related information. ----------------------
iii. Risk analysis – task required to assess both technical and management ----------------------
risk.
iv. Engineering – task required to build one or more representations of the ----------------------
applications ----------------------
v. Construction and release – task required to construct, test, install and
provide user support (e.g., documentation and training). ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- Using structured techniques, the developer first builds preliminary data
models and business process models of the business requirements. Prototyping
---------------------- then helps the analyst and users to verify those requirements and to formally
refine the data and process models. All flavors of RAD have the potential for
---------------------- providing a good framework for faster product development with improved
ii. Data modelling: It defines the data objects from data modelling. ----------------------
iii. Process modelling: It converts defined data objects to achieve information ----------------------
flow as per specific defined business objective.
iv. Application generation: Automated tools are used to convert process ----------------------
model into code and actual system. ----------------------
v. Testing and turnover: It tests new components or functions with its
interfaces. ----------------------
Advantages of RAD model ----------------------
i. Develops application in very short time. ----------------------
ii. Reusability of components.
----------------------
iii. Encourages customer feedback.
----------------------
Disadvantages of RAD model
iv. Performance depends on teams in the software development. ----------------------
v. High skilled development team required. ----------------------
vi.
Cost of modelling and automated code generation is very high, so ----------------------
inapplicable to cheaper projects.
----------------------
Check your Progress 3 ----------------------
Fill in the blanks. ----------------------
1. System engineering and analysis includes gathering requirement at
----------------------
the_______________ level
2. Software _________ focuses on four distinct attributes of a program. ----------------------
3. The incremental model delivers a series of releases, called __________ ----------------------
4. Evolutionary models are _______________
----------------------
5. Prototyping model and spiral model are examples of ________model.
6. A ___________ is a working model that is functionally equivalent to ----------------------
a component of the product. ----------------------
7. The spiral model is used most often in _____________projects.
----------------------
8. Rapid application development is a software _________methodology.
9. The __________model concentrates on short development cycle of ----------------------
system development.
----------------------
In this, the new versions of the software module may be build several ----------------------
times per day, and the increments are delivered to the customers every two
----------------------
weeks. For every build of the software module, all tests must be run and the
build accepted if the tests are successful. ----------------------
Extreme Programming (XP) is a pragmatic approach to program
----------------------
development that emphasises business results first and takes an incremental,
get-something-started approach to building the product, using continual testing ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 1.10(A) Extreme Programming
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
1.7 COMPONENT-BASED DEVELOPMENT
----------------------
A Component-based Software Development (CBSE) approach is based
---------------------- on software reuse. It emerged from the failure of object-oriented development
to support effective reuse. So, a component-based software engineering is a
---------------------- process that focuses on the design and construction of software using reusable
---------------------- software components. Some of the main objectives of component-based
software engineering are as follows:
----------------------
i. To reduce cost and time
---------------------- ii. To improve quality of software
---------------------- iii. To detect defects within the system
----------------------
Fill in the blanks.
1. A component-based software development (CBSE) approach is based ----------------------
on software __________. ----------------------
2. A component-based development follows software __________
principles. ----------------------
----------------------
----------------------
Summary
----------------------
• oftware myths prevail. Though they do are not clearly visible they have
S
---------------------- the potential to harm all the parties involved in the software development
---------------------- process, mainly the developer team.
• oftware engineering is a layered technology. Most engineering
S
----------------------
approaches (including software engineering) must rest on an organisational
---------------------- commitment to quality.
• software process contains a set of activities and associated results which
A
----------------------
leads to development of software.
---------------------- • linear process flow executes these activities in sequence. It begins with
A
---------------------- communication and ends with deployment. An iterative process flow
repeats one or more activities before going to the next activity. A parallel
---------------------- process flow executes one or more activities in parallel.
----------------------
• rocess: Collection of related, structured activities or tasks that produce
P
a specific service or product (serve a particular goal) for a particular ----------------------
customer or customers.
• Business modelling: It identifies the information flow between various ----------------------
business processes. ----------------------
• Extreme programming: Software development methodology which is
intended to improve software quality and responsiveness to changing ----------------------
customer requirements.
----------------------
Self-Assessment Questions ----------------------
1. What are evolutionary models? Explain different types of evolutionary ----------------------
models.
----------------------
2. What is Extreme Programming? Explain.
3. Software engineering is a layered technology. Discuss. ----------------------
4. Discuss the various software myths. ----------------------
5. True ----------------------
Check your Progress 3 ----------------------
Fill in the blanks.
----------------------
1. System engineering and analysis includes gathering requirement at the
system level. ----------------------
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. The objective of software project planning is to provide a framework
---------------------- that enables the manager to make reasonable estimates of resources, cost, and
---------------------- schedule. Estimation need to be conducted in a well-planned manner. Useful
techniques for time and effort estimation do exist. Estimation lays a foundation
---------------------- for all other project planning activities, and project planning provides the road
map for successful software engineering. Estimation of resources, cost and
---------------------- schedule for a software development effort requires experience, access to good
---------------------- historical information, and the courage to commit to quantitative measures
when qualitative data are all that exists.
---------------------- Estimates should attempt to define best-case and worst-case scenarios so
---------------------- that project outcomes can be bounded. Although there is an inherent degree of
uncertainty, the software team embarks on a plan that has been established as a
---------------------- consequence of these tasks.
----------------------
2.2 SOFTWARE SCOPE
----------------------
Project scope is the part of project planning that involves determining
---------------------- and documenting a list of specific project goals, deliverables, tasks and
deadlines. Size often increases due to “scope creep” that occurs when problem
---------------------- requirements change. Increases in project size can have a geometric impact on
---------------------- project cost and schedule. Scope management process for a project includes the
following activities:
----------------------
1. Collect requirements: It is the process of defining and documenting
---------------------- the needs of the customers to meet the
objectives of the project.
----------------------
2. Defining the scope: This process involves developing a detailed
---------------------- description of the project and product.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- Effective software project estimation is one of the most challenging and
important activities in software development. Proper project planning and
---------------------- control is not possible without a sound and reliable estimate. As a whole, the
software industry does not estimate projects well and does not use estimates
----------------------
appropriately. We suffer far more than we should as a result and we need to
---------------------- focus on improving the situation.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 2.2: Software Project Estimation
----------------------
The four basic steps in software project estimation are:
i. Estimate the size of the development product. This generally ends up in ----------------------
either Lines of Code (LOC) or Function Points (FP), but there are other
----------------------
possible units of measure.
ii. Estimate the effort in person-months or person-hours. ----------------------
iii. Estimate the schedule in calendar months. ----------------------
iv. Estimate the project cost in dollars (or local currency). ----------------------
2.3.1 Metrics for Software Quality
----------------------
The overriding goal of software engineering is to produce a high-quality
system, application, or product within a time frame that satisfies a market need. ----------------------
To achieve this goal, you must apply effective methods coupled with modern
----------------------
tools within the context of a mature software process. A good software engineer
must measure if high quality is to be realized. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Process metrics enable an organization to take a strategic view by
---------------------- providing insight into the effectiveness of a software process. Project metrics
---------------------- are tactical. They enable a project manager to adapt project workflow and
technical approach in a real-time manner.
---------------------- Process metrics are the measure of the software development process, such as:
---------------------- - Overall development time
---------------------- - Type of methodology used
---------------------- Process metrics are collected across all projects and over long periods
of time. Their intent is to provide indicators that lead to long-term software
---------------------- process improvement.
---------------------- Project metrics are the measures of software project and are used to
monitor and control the project. They enable a software project manager to:
---------------------- - Minimise the development time by making the adjustments necessary to
---------------------- avoid delays and potential problems and risks.
- Assess product quality on an ongoing basis and modify the technical
----------------------
approach to improve quality.
---------------------- Project metrics are used in estimation techniques and other technical
work. Metrics collected from past projects are used as a basis from which effort
----------------------
and time estimates are made for current software project. As a project proceeds,
---------------------- actual values of human effort and calendar time expended are compared to the
E= V/L^ ----------------------
Time to implement (T) ----------------------
John Stroud suggested that human mind is capable of making a limited
----------------------
number of elementary discriminations per second. Stroud claims that β
(stroud number) ranges between five and 20. Since Effort uses elementary ----------------------
discriminations as its unit of measure, the programming time would be:
T=E/β ----------------------
β is normally set to 18 since this seemed to give best results in Halstead earliest ----------------------
experiments.
----------------------
Example
Let us consider the following C program: ----------------------
main() ----------------------
{ ----------------------
int a, b, c, avg;
----------------------
scanf(“%d %d %d”, &a, &b, &c);
----------------------
avg = (a + b + c) / 3;
printf(“avg = %d”, avg); ----------------------
} ----------------------
The unique operators are: main, (), {}, int, scanf, &, =, +, /, printf ----------------------
The unique operands are: a, b, c, avg, “%d %d %d”, 3, “avg = %d»
----------------------
• , ,
----------------------
• , ,
----------------------
• Calculated Program Length:
----------------------
----------------------
• Volume: ----------------------
----------------------
---------------------- • Difficulty:
---------------------- • Effort:
----------------------
• Time required to program: seconds
----------------------
----------------------
• Number of delivered bugs:
----------------------
2.3.3 McCabe’s Complexity Metric
----------------------
The cyclomatic (McCabe’s) complexity of a section of source code is the
---------------------- count of the number of linearly independent paths through the source code. For
instance, if the source code contained no decision points such as IF statements or
---------------------- FOR loops, the complexity would be 1, since there is only a single path through
the code. If the code had a single IF statement containing a single condition,
----------------------
there would be two paths through the code: one path where the IF statement is
---------------------- evaluated as TRUE and one path where the IF statement is evaluated as FALSE.
Mathematically, the cyclomatic complexity of a structured program is
----------------------
defined with reference to the control flow graph of the program, a directed
---------------------- graph containing the basic blocks of the program, with an edge between two
basic blocks if control may pass from the first to the second. The complexity M
---------------------- is then defined as,
---------------------- M = E − N + 2P
---------------------- where
E = the number of edges of the graph
----------------------
N = the number of nodes of the graph
----------------------
P = the number of connected components
---------------------- An alternative formulation is to use a graph in which each exit point is
connected back to the entry point. In this case, the graph is strongly connected,
----------------------
and the cyclomatic complexity of the program is equal to the cyclomatic number
---------------------- of its graph (also known as the first Betti number), which is defined as
---------------------- M = E − N + P.
This may be seen as calculating the number of linearly independent cycles
---------------------- that exist in the graph, i.e., those cycles that do not contain other cycles within
---------------------- themselves. Note that because each exit point loops back to the entry point,
there is at least one such cycle for each exit point.
---------------------- For a single program (or subroutine or method), P is always equal to 1. So
---------------------- a simpler formula for a single subroutine is:
M = E − N + 2.
----------------------
----------------------
Multiple Choice Multiple Response.
1. The basic steps in software project estimation are: ----------------------
i. Estimate the number of stakeholders. ----------------------
ii. Estimate the effort in person-months or person-hours.
----------------------
iii. Estimate the schedule in calendar months.
iv. Estimate the project cost in dollars (or local currency). ----------------------
Fill in the blanks. ----------------------
1. __________ are the measures of software project and are used to ----------------------
monitor and control the project.
2. ___________ are measures of the software product at any stage of its ----------------------
development, from requirement to installed system. ----------------------
----------------------
Activity 1
----------------------
Consider the following program and find the program length, volume, ----------------------
difficulty, effort, time required to below program.
int f=1, n=7; ----------------------
---------------------- Using metrics, companies can make much better estimations on the cost,
length, effort, etc. of a project which leads to them giving a more accurate
---------------------- view of the overall project. This better view will allow the company to bid
for projects more successfully, make projects more likely to succeed and will
---------------------- greatly reduce the risk of late delivery, failure, being penalised for late delivery,
---------------------- bankruptcy, etc.
The processes that manage the project and its code can have issues, such
----------------------
as build failures, patches needed, etc. that can affect the software metric’s
---------------------- measures. Using ISO 9000 can help alleviate these issues. For smaller
companies where customer retention is important, using metrics to better the
---------------------- software development process and improve on overall project quality, delivery
time, etc. will make the customers happy which may lead to continued business.
----------------------
2.4.1 Size Projection
----------------------
The different methods of size projection as one of the metrics in project
---------------------- estimation are discussed below.
SLOC gives the size of the project by counting all the lines of source ----------------------
code in a project. It is used to measure effort both before as an estimate
and after as an actual value. It comes from the days of FORTRAN and ----------------------
assembly coding. ----------------------
SLOC gives a much clearer image to developers on the size of the project.
----------------------
When code is written, integration and unit testing can be performed so
measures of programming productivity and quality can be assessed. ----------------------
Source lines of code themselves are not as meaningful as the other
----------------------
metrics. Just because one project has more lines of code than another does
not make it more complex or give it a better quality rating. When using ----------------------
number of lines of code as a metric, other metrics would need to be used
such as product quality. When product quality is looked at with number ----------------------
of lines of code, it gives a much better reflection of the overall project’s
----------------------
quality, radio of good code to buggy code, efficiency of the code, etc.
Source lines of code can be measured from another point of view. This is ----------------------
measuring the actual number of lines of code written in a specific amount ----------------------
of time. When looking at a project level, the number of lines of code that
is measured would typically come from the overall lines of code written ----------------------
throughout the project within a specific amount of time.
----------------------
----------------------
----------------------
----------------------
----------------------
2.5 COST ESTIMATION
----------------------
---------------------- It is estimated that there has been 75 major software cost estimation tools
produced over the last decade.
---------------------- Some software measurement tools are listed below:
---------------------- • T
he COCOMO site provides various tools that support COCOMO based
measurement.
----------------------
• T
he ANGEL project from Bournemouth University. Based on research on
---------------------- Analogy method of estimation. The version of the software currently on
the site required JDK 1.4 to install but will run with Java 1.4 and above.
----------------------
To get around this problem do the following:
---------------------- • Save the angel.jar installation file to a directory.
---------------------- • Extract the contents using the command.
jar xf angel.jar.
----------------------
• Locate the file copy.jar that was extracted using the previous
---------------------- command.
---------------------- • Extract the contents of copy.jar using the command.
jar xf copy.jar.
----------------------
• Locate the bin directory and in there you will find batch files and
---------------------- shell scripts for running ANGEL.
---------------------- • NASA’s NASA Cost Estimation Website provides various cost estimation
models. While heavily focused on aerospace and aeronautics, it is still
---------------------- worth looking over.
----------------------
Check your Progress 4
----------------------
Fill in the blanks.
----------------------
1. Cost estimations in general are based on a form of reference data also
known as ________. ----------------------
2. Structured judgement for cost estimation also relies on _________
----------------------
but validates estimates using historical data and statistical tools.
3. The __________ has a single total value and may have identifiable ----------------------
component values. ----------------------
----------------------
Activity 2
----------------------
Find and list the cost estimation tools used in your organisation. ----------------------
----------------------
Summary
----------------------
• roject scope is the part of project planning that involves determining
P
and documenting a list of specific project goals, deliverables, tasks and ----------------------
deadlines. ----------------------
• Scope management process for a project includes collecting the
----------------------
requirements, defining the scope, creating Work Breakdown Structure
(WBS), verifying the scope, controlling the scope. ----------------------
• To set clear and precise objective, the SMART technique can be used.
----------------------
• ffective software project estimation is one of the most challenging and
E
important activities in software development. Proper project planning and ----------------------
control is not possible without a sound and reliable estimate.
----------------------
• The four basic steps in software project estimation are:
----------------------
Estimate the size of the development product. This generally ends
up in either Lines of Code (LOC) or Function Points (FP), but there ----------------------
are other possible units of measure.
Estimate the effort in person-months or person-hours. ----------------------
Estimate the schedule in calendar months. ----------------------
Estimate the project cost in dollars (or local currency).
----------------------
• oftware quality metrics are a subset of software metrics that focus on the
S
quality aspects of the product, process and project. In general, software ----------------------
quality metrics are more closely associated with process and product
----------------------
metrics than with project metrics.
---------------------- • unction point is a measurement unit or software metric for FPA that is
F
the end-user analysis of the functions needed for the software.
---------------------- • cost estimate is the approximation of the cost of a program, project or
A
---------------------- operation. The cost estimate is the product of the cost estimating process.
The cost estimate has a single total value and may have identifiable
---------------------- component values.
---------------------- • se Estimation by Analogy (EBA) to identify completed projects and
U
features that are similar to a new project and use that historical data to
---------------------- create estimates for the cost and effort of a newer project.
----------------------
Keywords
----------------------
• oftware scope: It describes the data and control to be processed,
S
---------------------- function, performance, constraints, interfaces and reliability.
---------------------- • SMART: Specific, Measurable, Achievable, Realistic and Time bound.
---------------------- • stimation by Analogy: It is used to identify completed projects and
E
features that are similar to a new project and that historical data is used to
---------------------- create estimates for the cost and effort of a newer project.
----------------------
Self-Assessment Questions
----------------------
1. Explain the different metrics in project estimation.
----------------------
2. Discuss McCabe’s complexity metric software project estimation.
---------------------- 3. What are the different cost estimation tools? Explain.
---------------------- 4. What do you understand by software scope? Explain the types of scope.
----------------------
----------------------
iv. Estimate the project cost in dollars (or local currency). ----------------------
Fill in the blanks. ----------------------
1.
Project metrics are the measures of software project and are used to
----------------------
monitor and control the project.
2.
Product metrics are measures of the software product at any stage of its ----------------------
development, from requirement to installed system.
----------------------
Check your Progress 3
----------------------
State True or False.
1. True ----------------------
2. False ----------------------
3. False ----------------------
Check your Progress 4
----------------------
Fill in the blanks.
----------------------
1. Cost estimations in general are based on a form of reference data also
known as analogy data. ----------------------
2. Structured judgement for cost estimation also relies on expert knowledge ----------------------
but validates estimates using historical data and statistical tools.
----------------------
3. The cost estimate has a single total value and may have identifiable
component values. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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 interconnectivity; the parts and processes are connected by
structural and/or behavioral relationships.
---------------------- • A
system’s structure and behaviour may be decomposed via subsystems
---------------------- and sub-processes to elementary parts and process steps.
• A
system has behaviour that, in relativity to its surroundings, may be
----------------------
categorised as both fast and strong.
---------------------- The term system may also refer to a set of rules that governs structure
and/or behaviour. Alternatively, and usually in the context of complex social
----------------------
systems, the term institution is used to describe the set of rules that govern
---------------------- structure and/or behaviour. In this unit, we will discuss the concepts of computer-
based systems and the points related to systems engineering and requirements
---------------------- engineering.
----------------------
3.2 COMPUTER-BASED SYSTEMS
----------------------
A computer-based system is essentially an information system using computer
---------------------- technology to carry out some or all of its planned tasks. The basic components
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 3.1: A Computer-Based System ----------------------
Certain information systems support parts of organisations; others support
----------------------
entire organisations, and still others, support groups of organisations. Recall
that each department or functional area within an organisation has its own ----------------------
----------------------
3.3 THE SYSTEM ENGINEERING HIERARCHY
----------------------
System engineering is an interdisciplinary field of engineering that
focuses on how to design and manage complex engineering systems over their ----------------------
life cycles. Issues such as reliability, logistics and coordination among different
teams (requirements management), evaluation measurements, and other ----------------------
disciplines become more difficult when dealing with large or complex projects. ----------------------
System engineering deals with work processes, optimisation methods and risk
management tools in such projects. It overlaps technical and human-centred ----------------------
disciplines, such as control engineering, industrial engineering, organisational
studies and project management. System engineering ensures that all likely ----------------------
aspects of a project or system are considered and integrated into a whole. ----------------------
Regardless of its domain of focus, system engineering encompasses a
----------------------
collection of top-down and bottom-up methods to navigate the hierarchy. The
system engineering process usually begins with a “world view,” that is, the ----------------------
entire business of product domain is examined to ensure that the proper business
or technology context is established. The world view is refined to focus more ----------------------
fully on specific domain of interest.
----------------------
Within a specific domain, the need for targeted system elements (e.g.,
data, software, hardware, and people) is analysed. Finally, the analysis design ----------------------
and construction of a targeted system element is initiated. At the top of the
----------------------
hierarchy, a very broad context is established and at the bottom, detailed
technical activities performed by the relevant engineering discipline (e.g., ----------------------
hardware or software engineering) are conducted.
----------------------
The system engineering process begins with a world view, the business
or product domain is examined in order to ensure that the proper business ----------------------
or technology context can be established. The world view is mainly refined
to focus on a specific domain of interest, within a specific domain; the need ----------------------
for targeted system elements is analysed. Finally, the analysis, design and
----------------------
construction of targeted system elements are initiated. At the world view level,
a very broad context is established. Moreover, at the bottom level, detailed ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 3.2: System Engineering Hierarchy
----------------------
3.3.1 Business Process Engineering
---------------------- Business process engineering is a way in which organisations study their
current business processes and develop new methods to improve productivity,
----------------------
efficiency and operational costs. The following are its important aspects:
---------------------- • ses an integrated set of procedures, methods and tools to identify how
U
---------------------- information systems can best meet the strategic goals of an enterprise.
• Focusses first on the enterprise and then on the business area.
----------------------
• Creates enterprise models, data models and process models.
----------------------
• reates a framework for better information management distribution and
C
---------------------- control.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 3.3: Business Process Engineering Hierarchy
----------------------
3.4 PRODUCT ENGINEERING
----------------------
Product engineering makes the customer’s desire for the set of defined ----------------------
capabilities into a resulting working product. This goal is achieved by
establishing product architecture and a support infrastructure. The product ----------------------
architecture components mainly consist of people, hardware, software and
data. Also, the support infrastructure includes the technology required to tie the ----------------------
components together and the information to support the components. ----------------------
Requirements engineering elicits the requirements from the customer
and allocates function and behaviour to each of the four components. System ----------------------
component engineering happens next as a set of concurrent activities that ----------------------
address each of the components separately.
– Each component takes a domain-specific view but maintains ----------------------
communication with other domains. ----------------------
– The actual activities of the engineering discipline takes on an element
----------------------
view.
• nalysis modeling allocates requirements into function, data and
A ----------------------
behaviour.
----------------------
• esign modeling maps the analysis model into data/class, architectural,
D
interface and component design. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 3.4: Product Engineering Hierarchy
----------------------
Check your Progress 2
----------------------
----------------------
----------------------
3.5 REQUIREMENTS ENGINEERING
----------------------
The process of requirements engineering is regarded as one of the most
---------------------- important aspects of building a software system. Within a software development
project, across all phases, it specifically deals with all the activities related to
---------------------- requirements. It is an integral part of the Software Development Life Cycle
---------------------- (SDLC) under the software development and software project management
processes and is based on the use of various methodologies, tools and techniques
---------------------- of software engineering.
---------------------- The broad spectrum of tasks and techniques that lead to an understanding
of requirements is called requirements engineering. From a software process
---------------------- perspective, requirements engineering is a major software engineering action
that begins during the communication activity and continues into the modeling
----------------------
activity. It must be adapted to the needs of the process, the project, the product,
---------------------- and the people doing the work. Requirements engineering builds a bridge to
design and construction.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
---------------------- • he term system may refer to a set of rules that governs structure and/
T
or behaviour. Alternatively, and usually in the context of complex social
---------------------- systems, the term institution is used to describe the set of rules that govern
structure and/or behaviour.
----------------------
• computer-based system is essentially an information system using
A
---------------------- computer technology to carry out some or all of its planned tasks.
• ystem engineering deals with work processes, optimisation methods
S
----------------------
and risk management tools in projects. It overlaps technical and human-
---------------------- centred disciplines, such as control engineering, industrial engineering,
organisational studies and project management.
----------------------
• he system engineering process begins with a world view, the business or
T
---------------------- product domain is examined in order to ensure that the proper business or
technology context can be established.
----------------------
• usiness process engineering is a way in which organisations study
B
---------------------- their current business processes and develop new methods to improve
productivity, efficiency and operational costs.
---------------------- • roduct engineering makes the customer’s desire for the set of defined
P
---------------------- capabilities into a resulting working product. This goal is achieved by
establishing product architecture and a support infrastructure. The product
---------------------- architecture components mainly consist of people, hardware, software
and data.
66 Software Engineering with UML
• he process of requirement engineering, which makes use of various
T Notes
tools, techniques and methodologies, must be adapted to the needs of the
specific process model used, project, product or people doing the work. ----------------------
----------------------
Keywords
----------------------
• ystem engineering: It uses a host of tools that include modeling and
S
simulation, requirements analysis and scheduling to manage complexity. ----------------------
• roduct engineering: The process of designing and developing a device,
P ----------------------
assembly or system such that it can be produced.
----------------------
• equirement engineering: It emphasises the use of systematic and
R
repeatable techniques that ensure the completeness, consistency and ----------------------
relevance of the system requirements.
----------------------
----------------------
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
---------------------- Context models: These are used to describe operational context of a system and
they clearly define the system boundaries by classifying external and internal
---------------------- entities. There are several social and organisational aspects which may cause
or affect the decision on where to position the system boundaries. Architectural
---------------------- models show the system and its relationship with other systems.
---------------------- Process models: Process models are useful for identifying different types
of processes within the system. These models are also useful for identifying
---------------------- and showing the different process that are supported by the system. Data flow
---------------------- models may be used to show the process and the flow of the information from
one process to another process.
----------------------
----------------------
4.3 UML AND UML USE CASE-DRIVEN OBJECT-
---------------------- ORIENTED ANALYSIS
---------------------- In this section, we will be discussing about the UML and UML use case-
---------------------- driven object- oriented analysis.
4.3.1 Unified Modelling Language (UML)
----------------------
UML is a standard language for writing software blueprints. UML is a
---------------------- general-purpose notation that is used to visualise, specify, construct, document
the artifacts of software systems. UML is not dependent on any one language
----------------------
or technology. It moves us from fragmentation to standardization. UML is the
---------------------- result of an effort taken by Booch, Rumbaugh and Jacobson to simplify and
consolidate the large number of OO development methods and notations.
---------------------- Building a House Building Software
----------------------
1. Design and Layout 1. OOAD
----------------------
2. Blue Print 2. UML
----------------------
3. Actual construction 3. Coding
---------------------- work
----------------------
Table 4.1
----------------------
Table 4.2 Diagrams in UML
----------------------
Activity Diagram Depicts high level business processes, including data
flow, or to model the logic of complex logic within a ----------------------
system.
Class Diagram Shows a collection of static model elements such ----------------------
as classes and types, their contents, and their ----------------------
relationships.
Package Diagram Collection of classes belonging to one sub system in ----------------------
one bunch.
----------------------
Object Diagram Depicts objects and their relationships at a point in
time, typically a special case of either a class diagram ----------------------
or a communication diagram.
Sequence Diagram Models the sequential logic, in effect the time ordering ----------------------
of messages between classifiers. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Customer
----------------------
Fig. 4.1: Representation of an Actor
There are also non-human actors. Another system or organisation is represented ----------------------
as follows: ----------------------
E.g., an ATM service
----------------------
----------------------
----------------------
----------------------
Fig. 4.2: Non-Human Actor
So, an actor includes all user roles that interact with the system. It also includes ----------------------
system components that are responsible for initiating a use case.
----------------------
There are different types of actors which interact with the system.
----------------------
• rimary actor: A primary actor is a user whose goals are fulfilled by
P
the system. For example, an actor who interacts with the system with a ----------------------
specific goal.
----------------------
• upporting actor: A supporting actor provides a service (e.g.,
S
information) to the system, clarifies the external interfaces and protocols. ----------------------
It can be a human actor or a non-human actor.
----------------------
• ffstage actor: An offstage actor has an interest in the behaviour but is
O
not primary or supporting, e.g., government - ensures all interests (even ----------------------
subtle) are identified and satisfied.
----------------------
Thus, an actor is an external entity that can produce or consume data. An actor
must serve as a source or destination to the system. It must be external to the ----------------------
system. An actor interacts with the system using use cases. Use cases are the
----------------------
functionalities or some behaviour from the system.
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig: 4.3: Use-Case Diagram showing Customer (Actor) interacting with
the System ----------------------
Scenarios: ----------------------
A scenario is a sequence of steps an actor performs with the use case. For ----------------------
example, in the above diagram a customer interacts with the use-case search
Product. He can follow the below sequence of steps: ----------------------
1. Open the category to search on website. ----------------------
2. Customer enters the product details into the search option. ----------------------
3. System looks for the available products in the database.
----------------------
4. Customer can view the different products by specified price and category.
----------------------
5. Customer can view the information related to product.
6. Customer selects the products. ----------------------
3. Association, include, extends and generalisation ----------------------
Symbol Meaning ----------------------
Association is a link between the actor and the use case. ----------------------
It is denoted by a solid line.
<<include>> It means one use case must call another use case. For ----------------------
--------------> example, Login use case must include verifying user-id ----------------------
and password use case.
<<extends>> Extends relationship, it means one use case calls another ----------------------
< -------------- use case under certain conditions.
----------------------
The child use case inherits the behaviour and meaning of
the parent use case. The child may add to or override the ----------------------
behaviour of its parent. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 4.5: Use Case Diagram showing use of Extend Relationship
----------------------
iv. Use case generalisation relationship
----------------------
• new use case is derived from the old use case. The old use case is called
A
base use case whereas new use case is called derived use case. ----------------------
• It is similar to parent-child relationship. ----------------------
• The derived use case is a specialised version of the old use case.
----------------------
Example: Consider a package which is used to draw different shapes like
circle, triangle, etc. ----------------------
So the base use case is “draw shape” and the derived use cases are “draw ----------------------
triangle”, “draw circle”, etc.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 4.6: Use Case Diagram showing use of Generalisation
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
1. Draw a use-case diagram for a library management system. Assume
---------------------- suitable actors and use cases. Try use include, extend and generalisation
---------------------- relationships.
2. Draw a use-case diagram for clinic management system. Assume
----------------------
suitable actors and uses cases.
----------------------
Operations ----------------------
----------------------
Fig. 4.7: Class in UML
----------------------
Example of class
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
The top compartment contains the name of the class. The name should be ----------------------
decided from the problem domain and should be a noun. The second compartment
----------------------
has attributes that describe properties of the objects. The attributes can have
different visibility. Visibility describes the accessibility of the attributes within ----------------------
other members of the class as well as from other class. If an attribute has the
visibility of private, it cannot be accessed from other classes. If an attribute has ----------------------
the visibility of public, it can be used and viewed from outside the class. If an
----------------------
attribute has the visibility protected, it can be accessible to its derived classes,
but not from other classes. ----------------------
UML has formal syntax for the description of an attribute:
----------------------
Visibility/name: type [multiplicity] =default-value {property-string}
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 4.8: A Typical Class with Attributes and Operations
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
S1: Special Order S2: Special Order N1: Normal Order ----------------------
Number = 20 Number = 30 Number = 60 ----------------------
Fig. 4.9: Object diagram
----------------------
Mapping class to java code
----------------------
public class Triangle {
private float base; ----------------------
private float height;
private float area; ----------------------
private static int noOfTriangles;
----------------------
public void setBase(float b){
} ----------------------
public float getBase(){
} ----------------------
public void setHeight(float h){
----------------------
}
public float getHeight(){ ----------------------
}
public void calculateArea(){ ----------------------
}
----------------------
public float getArea(){
} ----------------------
}
----------------------
4.4.2 Relationships in UML
Relationships provides a pathway for communication among objects. it is ----------------------
another connection between things. When we model a system, we are supposed ----------------------
to not only identify the things that form a system, but we should also model how
these things are related to one another. ----------------------
Relationships show how elements are associated with each other and this ----------------------
association (link) describes the functionality of an application.
There are different types of relationships that can be used among classes. ----------------------
A class diagram is constructed using a collection of different classes and ----------------------
----------------------
----------------------
----------------------
----------------------
Association between Person and Company with adornments (tells more about
---------------------- an association)
---------------------- A person uses a computer. The person has an association to the computer class.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Multiplicity
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 4.14: Recursive Association
Aggregation is a stronger version of association. Aggregation is of two ----------------------
types: shared aggregation and composite aggregation. A shared aggregation
----------------------
indicates “whole-part” relationship. For example, a computer consists of
different parts like motherboard, monitor, keyboard, mouse, etc. The keywords ----------------------
used to identify aggregates are “consists of”, “contains”, “is part of”, that is,
words that indicate a whole-part relationship between the classes involved. ----------------------
Shared aggregation is denoted by a hollow diamond at whole-part.
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 4.15: Shared Aggregations
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
More examples on aggregation
----------------------
Composite aggregation a whole-part association between two classes such that
---------------------- the parts reside within the whole. Destruction of the whole results in automatic
destruction of the parts. Multiplicity on the part side can be many but on the
----------------------
whole side it has to be zero or one. The composite aggregation is denoted by
---------------------- filled diamond at whole side.
----------------------
----------------------
----------------------
Fig. 4.16: Composite Aggregation
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Solution – 2a
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Summary
----------------------
• system model is an abstract view of the system. Different types of
A
----------------------
models provide different system information.
• Context models show the position of a system in its environment with the ----------------------
other system and process.
----------------------
• Data flow models may be used to model the data processing in a system.
State machine model the systems behaviour in response to internal or ----------------------
external events.
----------------------
• Semantic data models describe the logical structure of the data which is
imported to or exported by the system. ----------------------
• Object models describe logical system entities, their classification and ----------------------
aggregation. An interaction model shows the interaction between the
system and other side actors (users). ----------------------
----------------------
Keywords
----------------------
----------------------
ii. – e. ----------------------
iii. – a. ----------------------
iv. – g.
----------------------
v. – b.
----------------------
vi. – c.
vii. – d. ----------------------
Multiple Choice Single Response. ----------------------
1. Which of the following notations are used in use-case diagrams? ----------------------
iv. i. and ii.
----------------------
2. Which of the following is used to depict some additional functionality
required of a use case by putting the description of the additional ----------------------
functionality in another use case?
----------------------
iv. Extend
----------------------
3. Use-case model is realised by:
ii. Design model ----------------------
Check your Progress 3 ----------------------
Fill in the blanks. ----------------------
1. A class is a conceptual view of system.
----------------------
2. A class notation in UML contains class name, attributes and operation
compartments. ----------------------
----------------------
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. ----------------------
----------------------
----------------------
----------------------
Steps to draw sequence diagram
----------------------
1. Define who (which object) will initiate the interaction
---------------------- 2. Draw the first message to sub system
---------------------- 3. Draw message to other sub system
---------------------- 4. Draw return message to actor
5. Send / Respond to anonymous actor
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Depiction of Asynchronous Messages ----------------------
Suppose an object of class “P” sends a message msg1 ( ) to object of class ----------------------
“Q”. If the first object does not have to wait for the return then the message is
asynchronous, i.e., the object of class “P” can continue to do its own processing ----------------------
like sending a message msg2 ( ) to object of class “R”. It does not have to wait
for the object of class “B” to finish executing its operation. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig.5.2: Asynchronous Messages
----------------------
Creation of New Objects
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.3: Creation of New Object
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.4: “alt” Combination Fragment specifies Conditional Behaviour
----------------------
• “ alt” combination fragment specifies conditional behaviour. Either one
---------------------- out of the two operations will be invoked.
---------------------- • I n Figure 5.4, if the Video Player is free then message is sent by
VideoServer object to VideoPlayer Object to invoke “play” method. If
---------------------- the Video Player is busy then message is sent to Queue object to execute
---------------------- Enqueue() operation.
• I f there are multiple conditions and if it is necessary to execute a sequence
---------------------- of instruction and if all the conditions fail, then an “else” can be included.
---------------------- The Loop Combination Fragment
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
• uppose it is necessary for the Video Player to play the track “movie1.
S ----------------------
avi” five times. The keyword “loop” with parameters 1 5 is included in
----------------------
the pentagram of the fragment. So play (movie1.avi) operation will be
invoked five times. ----------------------
The Opt Combination Fragment
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.6: “opt” Combination Fragment ----------------------
• I t is used to model an “if-then” statement. If a certain condition occurs then
the execution of the messages takes place. This combination fragment is ----------------------
similar to the “alt” combination fragment with the exception that there ----------------------
is no else part to it. The keyword “opt” is used in the pentagram at the
top left-hand corner of the frame. For example, the computer sends a ----------------------
message play(movie1.avi) to the VideoServer. If the VideoPlayer is free,
the VideoServer sends the play() message to it. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.7: “par” Combination Fragment
----------------------
• I t depicts the concurrent execution of operations. The word “par” is
---------------------- included at the top left-hand corner of the enclosing frame within a
pentagram. A message - message1 ( ) - is sent to object of the class Q by
----------------------
the object of class P.
---------------------- • pon receipt of this message, it sends two messages - message2 ( ) and
U
message3 ( ) - to itself at the same time. Upon execution of these messages,
----------------------
control is transferred back to the object of class P.
---------------------- The Break Combination Fragment
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.9: “ref” Combination Fragment
In the above figure, upon entering the pin by the customer, verifyPin ----------------------
sequence diagram will be called in which detail steps of verifying pin can be ----------------------
modelled. It is used for reducing the complexity of the diagram.
Recursion ----------------------
• recursive operation is one that will continue invoking itself till some
A ----------------------
terminating condition is met. While representing recursive operations
----------------------
in a sequence diagram, the message must always be synchronous. The
FirstFunc() operation will call itself till some terminating condition ----------------------
(which must be compulsorily present) is met.
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.10: Recursion
----------------------
Iteration over a Collection
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.12: Message Sending
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.14: Message to Self ----------------------
This is indicated by drawing a link from the object to itself.
----------------------
Instance Creation:
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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.
----------------------
----------------------
----------------------
Fig. 5.18: Example of invoking Static Messages
----------------------
---------------------- Activity 2
----------------------
Refer to the sequence diagram in Activity 1 and draw the collaboration
---------------------- diagram. Compare the diagrams.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Example of a state diagram
----------------------
----------------------
----------------------
----------------------
A state machine visualises an object of a class as an individual. It depicts
behaviour of object with the rest of the world by detecting events and giving ----------------------
responses. State diagrams model the dynamic aspects of a system as an isolated
entity. It shows all the possible states that an object can have during its life ----------------------
cycle and how it responds to an event when it is in a particular state. So a state ----------------------
machine is a graph of states and transitions. A state is associated with an object
of a class which describes the responses of that object to event that it receives. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.19: States of a DVD/CD Player
---------------------- Types of Events
---------------------- There are five types of events.
---------------------- 1.
Time event: The time is calculated either as absolute time or the passage
of relative amount of time. For example, settings on each machine are
---------------------- such that it will go into locked mode if it is idle for two minutes. So the
passage of time of two minutes in the idle state transforms the machine to
----------------------
the locked state.
---------------------- 2.
A guard condition event: This is shown as a guard condition on a state
transition. When the transition is set to occur, the condition is tested. If it
----------------------
is true then the state changes.
---------------------- 3.
Change event: It is evaluated continuously till it becomes true and finally
when it becomes true, the transition fires.
----------------------
4.
Call event: It is the receipt of an explicit synchronous request among
---------------------- objects that wait for a response.
---------------------- Suppose an object “ob1” sends a message to object “ob2”. “ob2” processes
the call event either by transitioning to a new state or failing to make a
---------------------- transition. Either way, the control returns to calling object.
---------------------- 5.
Signal event: Here, the calling object sends asynchronous messages to
receiving objects. The sender does not wait for the receivers to process
----------------------
the messages and return. It continues its own work independently.
---------------------- It is not necessary for an event to be attached to a state transition. The
state of an object can change when its internal actions are executed. Thus,
----------------------
the performance of all actions in a state transitions the object to a new
---------------------- state.
States and Transitions
----------------------
• state when represented using a rectangular box with rounded edges can
A
---------------------- have three compartments.
---------------------- • he first compartment contains the name of the state, e.g., Stopped,
T
Ready, etc.
----------------------
• he second compartment is optional. It indicates the behaviour in response
T
---------------------- to events. There are three reserved event names in UML. They are:
---------------------- entry: It indicates actions to be done upon entering into a state.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.20: Representation of a State
----------------------
The syntax for the activity compartment is: eventname argument-list ‘/’ action-
expression. ----------------------
• he third compartment is also an optional compartment depicting internal
T ----------------------
transitions. An internal transition is one which has a source state but no
target state. The active state does not change as a result of its firing. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 5.22: Syntax for specifying a State Transition
---------------------- When go() event is triggered the state is changed from A to B. At that time, i
---------------------- gets incremented by 1 and j by 2. i=i+1 and j=j+2 are the action expressions.
• end-Clause: It is a special syntax for sending a message during a
S
---------------------- transition from one state to another.
----------------------
----------------------
----------------------
----------------------
Fig. 5.23: Send-Clause for specifying a State Transition
---------------------- When ‘print’ event occurs, the object sends a message to itself to execute
---------------------- its own print function. Syntax of the send clause is:
‘^‘destination-expression.destinationmessagename’(‘arguments’)’
----------------------
E.g. Nopaper ^ indicator.light(red)
----------------------
A transition may have more than one send-clause each with its own ^
---------------------- delimiter. The sequence of action-expression statements, operations and send-
clauses determines the order of the execution.
----------------------
Substates
---------------------- Internally, a state can have substates. There are two types of substates: and-
---------------------- substate and or-substate.
• R-substate: A state can have multiple substates but only 1 substate may
O
---------------------- be true at a given time.
---------------------- • AND-substate: The current state can have concurrent substates. Several
of them may be true in parallel. And-substates can be used while modelling
----------------------
the states of concurrent threads.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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. ----------------------
----------------------
Check your Progress 3
----------------------
State True or False. ----------------------
1. The entry event in state diagram indicates actions to be while in the ----------------------
state.
2. Idle or Active represents state category. ----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- 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” ----------------------
Work product components assist in the construction of an executable system
but do not participate in it, e.g., “Fibonacci .cpp” ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Check your Progress 4
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
Case Study – Deployment Diagram
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Check your Progress 5
----------------------
Fill in the blanks.
----------------------
1. ___________ shows organisation of nodes carrying components.
----------------------
2. __________ comprises one or more components.
----------------------
3. Deployment node contains _________ components.
---------------------- 4. A node has _______ and _______ capability.
----------------------
----------------------
----------------------
Summary
----------------------
• sequence diagram represents the interaction among different objects
A
of a system in the time order. These are used to document the systems ----------------------
requirements depending on the scenarios of the use-case diagram.
----------------------
• collaboration diagram is a type of interaction diagram. Objects are
A
connected with numbered (sequenced) arrows. The numbered arrows are ----------------------
the links which depict the information flow between the objects.
----------------------
• omponent diagrams are used to visualise the components of the system.
C
A component contains the software modules which can be deployed over ----------------------
a physical node. It constructs executables. It can be used to describe the
----------------------
physical artifact of the system.
• eployment diagrams are used to model the topology of the physical
D ----------------------
nodes. A physical node may be a computer machine or a machine which
----------------------
gives interfaces to the client. A physical node on which the software
components are deployed is represented by a box which contains ----------------------
compartments name, attributes, functionalities and executables.
----------------------
Keywords ----------------------
• equence diagram: An interaction diagram that shows how processes
S
----------------------
operate with one another and in what order.
• ollaboration diagram: It represents a combination of information
C ----------------------
taken from class, sequence and use-case diagrams describing both the
static structure and dynamic behaviour of a system. ----------------------
----------------------
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. ----------------------
---------------------- 1. False
2. True
----------------------
3. False
----------------------
4. True
---------------------- Check your Progress 2
---------------------- State True or False.
---------------------- 1. True
2. False
----------------------
3. True
----------------------
4. True
---------------------- Check your Progress 3
---------------------- State True or False.
---------------------- 1. False
2. True
----------------------
3. True
----------------------
4. True
---------------------- Check your Progress 4
---------------------- State True or False.
---------------------- 1. True
2. True
----------------------
3. True
----------------------
4. True
---------------------- Check your Progress 5
---------------------- Fill in the blanks.
---------------------- 1. Deployment diagram shows organisation of nodes carrying components.
2. Deployment node comprises one or more components.
----------------------
3. Deployment node contains work product components.
----------------------
4. A node has memory and processing capability.
----------------------
----------------------
4.
Rumbaugh, James, Ivar Jacobsobn and Grady Booch. The Unified ----------------------
Modelling Language User Guide. Addison-Wesley.
----------------------
5. Joseph Schmuller. Teach Yourself UML in 24 hours
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
----------------------
----------------------
----------------------
Component ----------------------
Level Design
----------------------
----------------------
Interface
Design ----------------------
----------------------
Architectural Design ----------------------
----------------------
----------------------
Data Design
----------------------
Fig. 6.1: Design Model ----------------------
• he top layer in the design model is the component-level design which
T
----------------------
transforms class based, flow oriented and behavioural information from
the analysis model. ----------------------
• he interface design depicts how the software communicates with the
T
----------------------
users. It uses flow control information from flow-oriented elements like
data flow diagrams from analysis model. It also transforms scenario- ----------------------
based information from the analysis model.
----------------------
• he architectural design transforms flow based and class-based elements.
T
An architecture is a framework for software system under development. ----------------------
• ata design also called class design transforms class-based elements into
D ----------------------
design.
So, all these layers are used to transform the different analysis elements ----------------------
into the design. Collectively, it describes the transformation from analysis ----------------------
model to design model.
----------------------
Software design is a blueprint of the software which depicts the overall
view of the software. It is an iterative process. Iterations will occur until the ----------------------
software goal is reached.
----------------------
McGlaughlin suggests three characteristics for evaluation of a good design.
• The design must implement all of the explicit requirements contained ----------------------
in the analysis model, and it must accommodate all of the implicit
----------------------
requirements desired by the customer.
• The design must be a readable, understandable guide for those who ----------------------
generate code and for those who test and subsequently support the ----------------------
software.
----------------------
----------------------
----------------------
Check your Progress 2
----------------------
State True or False. ----------------------
1. While designing the software, a designer should not consider the
----------------------
alternative solutions.
2. Designing is nothing but code construction for software. ----------------------
3. Software design should be assessed for quality. ----------------------
----------------------
----------------------
----------------------
---------------------- • A good modular design must have a high cohesion and low coupling.
8. Designing classes
----------------------
• efining classes is an important method for designing object-
D
---------------------- oriented systems. A designer designs different types of classes.
Some of these classes are system classes, process classes, user
----------------------
interface classes, business classes and persistent classes.
----------------------
State True or False.
----------------------
1. A software consists of integration of different components and these
are separately called modules. ----------------------
2. Refinement helps designers to expose high-level details. ----------------------
3. Refactoring is used to simplify the design or code of a module without
----------------------
changing function or behaviour.
----------------------
6.5 DESIGN HEURISTICS FOR EFFECTIVE ----------------------
MODULARITY
----------------------
An effective modularity can be achieved by applying design concepts ----------------------
like abstraction, architecture, refinement, information hiding, refactoring,
functional dependency and designing classes after creating the program ----------------------
structure. This structure can be reorganised as per guidelines (heuristics) for
effective modularity. Some of the guidelines are as follows: ----------------------
• Evaluate the first iteration of program structure to reduce coupling and ----------------------
improve cohesion. Program architecture consists of organisation of
modules. Attempt should be made to reduce the coupling and improve ----------------------
the cohesion. It increases the modularity in the program units. ----------------------
• Attempt to minimise structures with high fan-out; strive for fan-in as
depth increases. ----------------------
• Keep scope of effect of a module within the scope of control of that ----------------------
module.
----------------------
• Evaluate module interfaces to reduce complexity and redundancy and
improve consistency. ----------------------
• Define modules whose functions are predictable, but avoid modules that ----------------------
are overly restrictive.
----------------------
• Strive for controlled entry, no switch or jump.
• Packaging of software based on design and requirements. ----------------------
----------------------
6.6 DESIGN MODEL
----------------------
The design model includes representation of data, architecture, interfaces
---------------------- and procedures. Figure 6.2 shows a design model that contains the elements -
data design, architecture design, interface design and procedural design.
----------------------
There are two dimensions that exist for design model - one is abstract
---------------------- dimension and the other is process dimension. The abstract dimension is a
---------------------- representation of transformation of analysis model to design model. Analysis
model is at high level of abstraction and design model is at low level of
---------------------- abstraction. A decision boundary will be decided by the designer in between
high level of abstraction and transformation and low level of abstraction.
----------------------
The process dimensions contain elements, such as architecture elements,
---------------------- interface elements, component-level elements and deployment-level elements.
---------------------- Software requirements are analysed using class diagrams, packages, CRC
models, collaboration diagrams, data flow diagrams, control flow diagrams and
---------------------- processing narratives. These are transformed into designing classes, realisations
between classes, subsystem and collaboration diagram which are related to
----------------------
design model architecture elements.
---------------------- Interface elements on process dimension are technical interface designing
GUI and navigation designs are the transformation of use cases, activity
----------------------
diagrams, state diagrams, collaboration diagrams, sequence diagrams which are
---------------------- created at analysis model.
Component-level elements on the process dimension are component
----------------------
diagrams, class designs, activity diagrams and sequence diagrams which are
---------------------- the transformation from class diagrams, packages, CRC models, collaboration
diagrams, data flow diagrams, control flow diagrams and sequence diagrams
---------------------- from the analysis models.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 6.2: Dimensions of Design Model
----------------------
----------------------
Fill in the blanks.
----------------------
1. _________ includes representation of data, architecture, interfaces
and procedures. ----------------------
2. ________ and navigation design are the transformation of use cases.
----------------------
----------------------
6.7 DESIGN DOCUMENTATION
----------------------
Design documentation helps in navigating the design elements. Some of the
following points can be incorporated when designing the document: ----------------------
• irst, scope needs to be defined which contains system objectives, major
F ----------------------
software requirements, design constraints and limitations.
• econd, data design which contains details about data objects and data
S ----------------------
structures, file and database structures which are logical structure, logical ----------------------
record descriptions, access methods, global data, file and data cross-
reference. ----------------------
• hird is architectural design details. These are review of data and control
T ----------------------
flow, derived program structure.
----------------------
• ourth, interface design details are human-machine interface specification,
F
human-machine interface design rules, external interface design which ----------------------
consists of interfaces to external data, interfaces to external systems or
devices, interface design rules . ----------------------
• ifth, procedural design details for each module, a processing narrative,
F ----------------------
interface description, design language description, details of modules
----------------------
---------------------- • Appendix.
The above sequence can be used as a template for documentation.
----------------------
----------------------
Activity 1
----------------------
Find out the importance of design documentation for a specific project.
----------------------
----------------------
Summary
----------------------
• esign is the core of software engineering. Design consists of refinement
D
---------------------- of data structure, program architecture and interfaces. It also consists
of development of procedural details, reviewing and documentation of
----------------------
procedural details.
---------------------- • esearchers have proposed a number of software fundamental principles
R
and concepts. Design model helps in improving the quality of the software.
----------------------
• Design concepts are the basic criteria for design quality.
----------------------
• fter gathering the requirements at the software analysis phase, the
A
---------------------- software design is the final engineering action within the modelling
activity. It helps in construction of code for the software.
----------------------
• design model is a pyramid-like structure consisting of data design,
A
---------------------- architecture design, interface design and component-level design.
----------------------
----------------------
----------------------
• esign principles: Describe fundamental ideas about the practice of a
D
good visual design. ----------------------
• odularity: The degree to which a system’s components may be
M
----------------------
separated and recombined.
• esign documentation: A written description of a software product that
D ----------------------
a software designer writes in order to give a software development team
----------------------
overall guidance to the architecture of the software project.
----------------------
Self-Assessment Questions ----------------------
1. Explain the software design process in detail. ----------------------
2. Explain the design principles and design concepts in detail.
----------------------
3. Explain design model and design documentation.
----------------------
Answers to Check your Progress ----------------------
Check your Progress 1 ----------------------
State True or False.
----------------------
1. True
----------------------
2. True
3. False ----------------------
4. True ----------------------
5. True ----------------------
Check your Progress 2
----------------------
State True or False.
----------------------
1. False
----------------------
2. False
3. True ----------------------
Check your Progress 3 ----------------------
State True or False. ----------------------
1. True
----------------------
2. False
----------------------
3. True
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
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
---------------------- In this unit, we will discuss the various aspects of software architecture
and designing of user interfaces.
----------------------
7.2 SOFTWARE ARCHITECTURE
----------------------
The software architecture of a program or computing system is the
---------------------- structure or structures of the system, which comprise software components, the
externally visible properties of those components, and the relationships among
---------------------- them
---------------------- A software architecture provides the overall view of the software product.
It represents the structure of data and program components to build a system.
----------------------
After gathering the system requirements and specification the structure or
---------------------- framework is developed which describes the modules and relationship between
these modules.
----------------------
An architectural view is an actual design and layout of your requirement
---------------------- specification (SRS) gathered in the analysis phase. An architectural design is
the process of defining a collection of hardware and software components and
---------------------- their interfaces to establish the framework for the development of a computer
system. It represents the structure of data in the system as well as structure of
----------------------
the components which are to be built in the system. Once an architecture of one
---------------------- system is created, it can be applied to another system.
----------------------
State True or False.
----------------------
1. Software architecture represents the overall view of the product.
2. Software architecture is the implementation of system requirement ----------------------
specification gathered in the analysis phase.
----------------------
3. Software architecture model of one software can be applied to other
software. ----------------------
4. Software architecture depicts all the components of the software ----------------------
system and tells how it works.
----------------------
----------------------
Activity 1
----------------------
Suppose an apartment security software is to be developed to provide
----------------------
security to apartments. It should consist of several types of sensors and
cameras. Analyse it and draw its overall software architecture using ----------------------
UML component diagram.
----------------------
----------------------
----------------------
Activity 2 ----------------------
----------------------
Draw the ER diagram for Activity 1 and study the overall data structure for
the different entities used in it. ----------------------
----------------------
7.4 ARCHITECTURAL STYLES
----------------------
Architectural styles are the set of rules that comprises components
----------------------
and connectors that interface between components and properties of object.
Architectural style is a family of the architectures constrained by components, ----------------------
connectors and their topology.
----------------------
An architectural style is a transformation that is imposed on the design of
an entire system. The intent is to establish a structure for all components of the ----------------------
system.
----------------------
An architectural style categorised by set of components that performs
functions, constraints on integration and semantic models are useful to ----------------------
understand overall system properties.
----------------------
Some of the architectural styles are:
----------------------
1. Data flow style
• Batch sequential ----------------------
• Pipes and filters ----------------------
2. Data centred ----------------------
• Blackboard
----------------------
• Repository.
----------------------
3. Call and return
• Main program and subroutines ----------------------
• Remote Procedure calls. ----------------------
4. Layered ----------------------
5. Object Oriented
----------------------
----------------------
filter filter filter
----------------------
---------------------- filter
----------------------
filter filter filter filter
----------------------
batch sequential
----------------------
Fig. 7.2: Pipes and Filters and Batch Sequential
----------------------
2. Data centred: In this type, the file or data store is at the centre of the
---------------------- architecture and the client software components access it frequently to
view or modify. Data store is a repository of the data.
----------------------
----------------------
Data store
client
(repositor or
black board)
client ----------------------
software software
----------------------
client ----------------------
client
software software
----------------------
Fig. 7.3: Data Centre ----------------------
3. Call and return: The call and return architectural style is different from ----------------------
filters and pipes, which transform control from one component to another
component and return. It comprises the main program and subroutines, and ----------------------
hierarchical layers. In the main program and subroutine call and return,
transformation is between the main program and their subprograms called ----------------------
subroutines. The following figure shows call and return architecture style ----------------------
elements.
Main Program ----------------------
----------------------
----------------------
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 ----------------------
----------------------
----------------------
Fig. 7.5: Layered Architecture
----------------------
In Figure 7.5 there are three layers - core layer, middle layer and application
---------------------- layer. Each layer is serving to other layers, which means the core layer is serving
the middle layer and the middle layer is serving the outer layer.
----------------------
----------------------
---------------------- Activity 3
iii. Analysing DFDs for transformation and transaction flow characteristics ----------------------
iv. Specifying incoming and outgoing flow boundaries for transform centre ----------------------
v. Performing first-level factoring ----------------------
vi. Performing second-level factoring
----------------------
vii. Refining the first iteration architecture using design heuristics for
improved software quality ----------------------
7.5.2 Transaction Mapping ----------------------
A system consists of many data items. When an event comes to data item,
----------------------
it has many information flow paths. So occurrence of an event triggers one of
the information flow paths from the available paths. This is called transaction. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- In this, a data flow diagram which carries the requirement analysis can
be mapped into the program structure. The program structure obtained by DFD
---------------------- can be later refined using design measures and heuristics. After refinement the
architecture description is refined and elaborated.
----------------------
A transaction centre is a centre from where an information flow has many
---------------------- outgoing paths. Information flows within the processes and transaction centres
within a system and goes outside of the system which is called transaction. The
----------------------
evaluation of the transaction is done based on the flow path and its value.
----------------------
Check your Progress 4
----------------------
---------------------- 1.
_________ is an architectural model which facilitates the
transformation from analysis model to design.
---------------------- 2. __________ is defined by factoring.
---------------------- 3. The transformation occurs into the processes is in ____________
order.
----------------------
4. A _________ is a center from where an information flow has many
---------------------- outgoing paths.
----------------------
---------------------- Activity 4
---------------------- Consider the example in Activity 1. Draw transaction flow and transform
---------------------- flow diagrams. Refer to the books named in Suggested Reading for drawing.
----------------------
7.6 REFINING ARCHITECTURAL DESIGN
----------------------
Refinement of software architecture during early stages of design is to
---------------------- be encouraged. Refining architectural design contains the processing of the
----------------------
Activity 5
----------------------
Consider the different functions with its scenarios of the example in Activity
----------------------
1 and write the narrative for the information flows.
----------------------
7.7 USER INTERFACE DESIGN (UID) ----------------------
User interface design begins with the identification of user, task, and ----------------------
environmental requirements. User interface is a module or component within
software system which gives interface to the user to interact with the system ----------------------
components. It can be visualised and through this the user can interact with the
system. The users who interact with the user interface component can be an internal ----------------------
user and external user. ----------------------
Following a set of interface design principles, design identifies interface
objects and actions and then creates a screen layout that forms the basis for a user ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
The golden rules of user interface design are:
----------------------
1. Place users in control interface
---------------------- • ser performs specific tasks using the interface. When user performs
U
---------------------- some task with the system the interface should not preempt the user
to do some unnecessary task or action.
---------------------- • Maintain abstraction from unauthorised users.
---------------------- • Provide different preferences to the users.
---------------------- • llow user to interrupt the interaction and undo the operation
A
performed by him.
----------------------
• Streamline and customise interaction with the interface.
---------------------- 2. Reduce user’s memory load
---------------------- • good computer interface should help user to remember information
A
while using the interface.
----------------------
• I t should not force users to remember and repeat what the computer
---------------------- should do for them.
---------------------- • Interface should provide the undo, redo and default fields.
---------------------- • Fonts
• Inverse video
----------------------
• Blinking
---------------------- • Colour standard and colour blinking
---------------------- • Audio
7.7.4 Design Evaluation
----------------------
The following steps are followed while evaluating an interface:
----------------------
i. Evaluation of preliminary design.
---------------------- ii. Construction of first interface prototype.
---------------------- iii. User evaluates interface and gives feedback.
---------------------- iv. Evaluation results and feedback studied by designer.
v. Modifications in the design are made as per inputs from the user.
----------------------
vi. Construction of next prototype.
----------------------
vii. If interface is not complete then go to step iii. and repeat.
---------------------- The evaluation criteria are as follows:
---------------------- i. The length and complexity of the interface specification and level of
learning required by user.
----------------------
ii. Definition of interaction time of the user. The number of user’s task and
---------------------- average number of the tasks performed by the user. Evaluation of the
system’s efficiency for these tasks.
----------------------
iii. Indication of memory load to the total number of tasks performed by
---------------------- users.
----------------------
State True or False.
----------------------
1. A user interface gives an interface to the internal users of the system.
2. Task analysis on the interface is done by a software engineer. ----------------------
3. Undo, redo and auto fill reduce user’s memory load. ----------------------
4. Abstraction from unauthorised users is nothing but an activity of ----------------------
placing control on user interface.
----------------------
----------------------
Activity 6
----------------------
Create a sample user interface with different menu options and descriptions
----------------------
for the scenario mentioned in Activity 1.
----------------------
Summary ----------------------
• ata design translates data objects into data structures within the software.
D ----------------------
A data design is useful at the component level and the architecture level.
----------------------
• rchitectural styles are the set of rules that comprises components,
A
connectors that interface between components and properties of object. ----------------------
• esign refinement is required to analyse and review the design of smaller
D ----------------------
units within the software system. A data flow diagram is mapped into the
program structure using one of the two mapping approaches - transaction ----------------------
flow and transform flow.
----------------------
Keywords ----------------------
----------------------
----------------------
---------------------- 4. What are the different golden rules for user interface design?
----------------------
Suggested Reading
----------------------
1. Bass, Len, Paul Clements and Rick Kazman. Software Architecture in
----------------------
Practice. Addison Wesley.
2. Clements, Paul, Felix Bachmann, Len Bass, David Garlen, James Ivers, ----------------------
Reed Little, Robert Nord and Judith Stafford. Documenting Software
----------------------
Architectures: Views and Beyond. Addison Wesley.
3.
Pressman, Roger and Bruce Maxim. Software Engineering: A ----------------------
Practitioner’s Approach. McGraw-Hill. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
8
Structure:
8.1 Introduction
8.2 Software Testing Fundamentals
8.3 Test Case Design
8.4 Testing Principles
8.5 White-Box Testing
8.5.1 Basis Path Testing
8.5.2 Control Structure Testing
8.6 Black-Box Testing
8.7 Software Testing Strategies
Summary
Key Words
Self-Assessment Questions
Answers to Check your Progress
Suggested Reading
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
If a software which is going to be tested have a better quality in terms of
---------------------- its working it become easy to test. The input and output to the software should
be easily observable, so wrong input and output can be identified correctly. This
---------------------- wrong input and output are because of internal errors in the information flow,
computations within the modules, so it should be detected automatically.
----------------------
Software consists of different objects that have different states. Objects
---------------------- have their attributes (variables) and operations (functions). It is necessary to
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Types of Testing
Static Testing: “Dry Run Testing” Requires only the source code of the ----------------------
product, not binaries or executables. It does not involve executing the programs, ----------------------
but involves people going through the code.
----------------------
Also examines specification, design and user documents.
Syntax checking and manually reading the code to find errors is the ----------------------
method of static testing. This type of testing is mostly done by the developer
----------------------
himself. Static testing is usually the first type of testing done on any system.
Dynamic testing: Here codes are executed, testers generally do dynamic ----------------------
testing, all testing tools come under this category. Programs are checked with
----------------------
input and behavior is observed. Certain no of inputs and outputs values are
checked. ----------------------
This also includes feeding the program with input and observe behavior, ----------------------
checking a certain number of input and output values
----------------------
----------------------
----------------------
Activity 1
----------------------
---------------------- Consider any software you use. Try to find the defects at the operational
level. If defects are found, document it.
----------------------
----------------------
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
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 8.1: Flow graph and Regions
----------------------
In Figure 8.1, the start node is 0 and the end nodes are 7 and 8. The link
---------------------- between two nodes is called an edge. Each node indicates a set of statements
or a statement or a condition. The output of the nodes which contain conditions
---------------------- produces a Boolean value true or false. The basis set for the figure above are as
---------------------- follows:
Path 1:0-1-8
----------------------
Path 2:0-1-2-3-6-7
----------------------
Path 3:0-1-4-5-6-7
---------------------- Path 4: 0-1-4-5-6-7-1-8
---------------------- Path 5: 0-1-2-3-6-7-1-8
----------------------
----------------------
Check your Progress 3
----------------------
State True or False. ----------------------
1. Flow graph notations are used in control structure testing.
----------------------
2. Different types of loops are tested in control structure testing.
----------------------
3. Nodes and edges bound an area called region.
4. White-box testing tests code segment of only one component. ----------------------
----------------------
Activity 3 ----------------------
---------------------- Boundary value analysis is a test case design method that complements
equivalence partitioning. It selects test cases for the edges of the classes as
---------------------- boundary values. It derives the test cases from both input and output domain.
For example, if an input condition specifies a range bounded by values a and b,
---------------------- test cases should be designed with values a and b as well as values just above
---------------------- and just below a and b. If an input condition specifies a number of values, a test
case should be developed that exercises the minimum and maximum numbers.
---------------------- Values just above and just below the minimum and maximum are also tested.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Activity 4
----------------------
Consider the example in Activity 1 and perform the black-box testing. ----------------------
Design test cases for it.
----------------------
----------------------
Software testing consists of a set of activities which are to be planned in advance
and systematically. A template for software testing contains a set of steps into ----------------------
which we can place test case design techniques and testing methods.
----------------------
There are different types of software testing strategies. Some of the characteristics
are as follows: ----------------------
• o conduct effective testing, a software development team should conduct
T
----------------------
formal technical reviews. As a result of this many errors are eliminated.
• Testing begins from the component level to the system level. ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Fig. 8.3: Driver and Stubs
----------------------
2. Integration Testing: In unit testing, the individual units called modules
are tested with its code and internal paths. After unit testing these units are ----------------------
integrated with the other units to make the system functioning. Integration
testing tests the communication between of two or more units. This test ----------------------
is performed by programmers and it focusses on interfaces between these ----------------------
integrated units.
----------------------
There are several issues in performing this testing. One of the issues
focusses on order of integration of these units. The order of integration ----------------------
should be decided. Another issue is regarding the correctness and
compatibility of the external components. ----------------------
Integration testing is necessary because one module can have effects ----------------------
on another module. When several units are combined together it may
function differently and produce wrong output. Interfacing errors are not ----------------------
detected in unit tests. In this case integration testing is useful.
----------------------
In this type of testing two approaches are used - top-down approach and
bottom-up approach. A supplementary approach that can be applied with ----------------------
these two approaches is called critical unit first.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- Top-down integration testing starts with high-level system at the top level
and integrates from top-down by replacing individual components by stubs.
---------------------- The main control module which integrates is called driver and the individual
components that are replaced are called stubs. Depth-first and breadth-first
---------------------- approach can be used to integrate these modules. The main control module
---------------------- called driver subordinates stubs. Depending on the approach, breadth-first or
depth-first stubs are replaced by modules at a time. Tests run on individual
---------------------- modules that are integrated. Once the tests are conducted the stubs are replaced
by individual modules. Top-down integration is used for verifying major
---------------------- decision points early in the test process. Top-down approach is not as complex
---------------------- as bottom-up approach.
I n bottom-up integration testing, low-level components are combined into
---------------------- clusters or builds. Driver which is a control program is written to coordinate
---------------------- these sub- functions input and output. These individual clusters are tested. At
last drivers are removed and clusters are combined moving upwards in the
---------------------- program structure, which is a hierarchical structure.
---------------------- 3. Validation Testing: The goal of validation testing is to make sure software
functions as per the requirement of the customer. The result of integration
---------------------- testing is validation testing. In integration testing, all the individual
modules are exercised and integrated with testing of interfaces which
---------------------- uncover and correct all the errors. If the result of the integration testing
---------------------- is as per the customer’s requirements, the software can be validated. It
involves regression testing, alpha testing and beta testing.
----------------------
Validation testing tests if the software meets all the requirements defined
---------------------- in the System Requirement Specification (SRS). So it is important to
have proper system requirement specification documentation. If it is not
---------------------- available, regression testing is performed to determine the modifications
required in the software. Regressing testing involves repeating existing
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
---------------------- Testing and debugging are different processes. The detected errors are
located and corrected in the debugging process. The debugging process starts
---------------------- with the output of the testing result. These errors are located and a repairing
plan is prepared. The repairing plan helps in correcting these errors and the
----------------------
software is re-tested. It helps in test case creation. Locating and repairing the
---------------------- errors are difficult. The following figure shows the debugging process.
Test case result
----------------------
----------------------
Test case creation
----------------------
Fig. 8.5: Flow of Debugging Process
----------------------
----------------------
5. In validation testing, the SRS documentation is compared with the ----------------------
system functions.
----------------------
----------------------
Activity 5
----------------------
Consider to develop a software for automatic tea/coffee vending machine.
----------------------
Identify its various components and draw the hierarchical structure for its
components and document its unit testing, integration testing and system ----------------------
testing process.
----------------------
Summary ----------------------
----------------------
Keywords
----------------------
• esting strategies: An outline that describes the testing approach of the
T
software development cycle and is created to inform project managers, ----------------------
testers, and developers about some key issues of the testing process. ----------------------
----------------------
----------------------
Self-Assessment Questions
----------------------
1. What is software testing? Explain the strategy used for software testing.
----------------------
2. Explain unit testing, integration testing and system testing.
---------------------- 3. Explain the debugging process. Also explain how it differs from testing.
----------------------
Answers to Check your Progress
----------------------
Check your Progress 1
----------------------
State True or False.
---------------------- 1. True
---------------------- 2. True
---------------------- 3. True
4. True
----------------------
Check your Progress 2
----------------------
State True or False.
---------------------- 1. False
---------------------- 2. True
---------------------- Check your Progress 3
State True or False.
----------------------
1. False
----------------------
2. True
---------------------- 3. True
---------------------- 4. False
3. False ----------------------
4. False ----------------------
5. True
----------------------
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
What is the origin of these changes? The answer to this question is as ----------------------
varied as the changes themselves. However, there are four fundamental sources
of change: ----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
A configuration management system has the following elements:
1. Configuration elements: These are a set of tools coupled with a file ----------------------
management or database management system that enables access to and
----------------------
management of each Software Configuration Item (SCI).
2. Process elements: These are collection of procedures and tasks that ----------------------
define an effective approach to change management for all stakeholders
----------------------
of that process.
3. Construction elements: These are the elements required to construct the ----------------------
software. It is a set of tools that automate the construction of software by ----------------------
ensuring that proper set of valid components (i.e., the correct version) is
assembled. ----------------------
4. Human elements: Software team uses a set of tools and process features ----------------------
to implement software configuration management system effectively.
Baselines ----------------------
There are several reasons to make changes during the software development ----------------------
process. Some of changes are due to changing customer requirements, software
----------------------
development team wants to change their technical approach, and managers
want to change or modify the project development approach. So the concept of ----------------------
baseline is used to control these changes.
----------------------
As per the definition of IEEE, a baseline is defined as “a specification or
product that has been formally reviewed and agreed upon that thereafter serves ----------------------
as the basis for further development and that can be changed only through
formal change control procedure.” ----------------------
In a software development process, a baseline is the outcome of each ----------------------
phase which can be serves as a basis for further phases. A software development
process, for example, contains requirement analysis which has a basis of system ----------------------
specification and the outcome is software requirement specification which can ----------------------
be used as a basis for the software design phase. The outcome of the software
is data specification which is a basis of the coding phase. The outcome of ----------------------
coding phase is source code file which can be a basis for the testing phase. The
outcome of testing phase is operational system which can be used as a basis for ----------------------
implementation or product release. So during each of these phases a baseline is ----------------------
used which is formerly agreed upon by the software development team.
----------------------
----------------------
---------------------- Activity 2
----------------------
9.4 THE SCM REPOSITORY
----------------------
A paper-based repository (e.g., file cabinet) has several issues. Some of
---------------------- the issues are listed below:
---------------------- • Finding SCIs in less time is difficult.
---------------------- • No control over changes in items.
• Creating or constructing new versions is time-consuming
----------------------
• Determining the relationships between configuration items is difficult.
----------------------
---------------------- Activity 3
----------------------
Consider the example of Activity 2. Construct a conceptual SCM repository.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
Layers of SCM Process
As per discussion in the SCM process, the SCM tasks are as follows: ----------------------
1. Identification ----------------------
• I dentification task names each SCI separately and organises it into ----------------------
SCM repository using object-oriented approach.
• I t identifies each object with its name, description and behaviour. ----------------------
The name of an object is unique and unambiguous to all other ----------------------
objects. Description contains the software configuration item type,
an identifier, change and version information. ----------------------
• List of resources needed by object. ----------------------
• The object realisation in terms of the document, file and the model.
----------------------
2. Change control
----------------------
• I t is an activity that ensures quality and consistency during the
changes that are made during the software development process. ----------------------
• I f there are changes to be done, a request is sent to the configuration ----------------------
control authority, which is called the Change Control Board (CCB).
• Engineering Change Order (ECO) is generated for each change. ----------------------
Keywords ----------------------
----------------------
• oftware configuration management: Task of tracking and controlling
S
changes in the software. ----------------------
• onfiguration items: The term configuration item or CI refers to the
C
----------------------
fundamental structural unit of a configuration management system.
Examples of CIs include individual requirements documents, software, ----------------------
models, and plans.
----------------------
• oftware quality assurance: Monitoring the software engineering
S
processes and methods used to ensure quality. ----------------------
----------------------
----------------------
----------------------
---------------------- 1.
Process elements are a collection of procedures and tasks that define an
effective approach to change management for all stakeholders of that
---------------------- process.
---------------------- 2. Construction elements are required to construct the software.
3.
Configuration elements are coupled with a file management or database
----------------------
management system
---------------------- 4. The changes made after freezing the baseline for software creates new
baseline.
----------------------
4.
Configuration auditing is an activity that ensures quality and consistency ----------------------
of the changes that are made during the software development process.
----------------------
5. Engineering change order (ECO) is generated for each change.
----------------------
6. Configuration status reporting is nothing but the accounting of
configuration status. ----------------------
----------------------
Suggested Reading
----------------------
1. Mette, Anne and Jonassen Hass. Configuration Management Principles
and Practice. Addison-Wesley. ----------------------
2.
Pressman, Roger and Bruce Maxim. Software Engineering: A ----------------------
Practitioner’s Approach. McGraw-Hill.
----------------------
3. Sommerville, Ian. Software Engineering. Addison-Wesley.
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------