Introduction to UML
Venkat Srinivasan
Dept. of CSE
MS-DOS–4000 lines of code
Windows NT–2 million lines of code
Windows 3.1–2 million lines of code
Windows 7–40 million lines of code
Windows XP–45 million lines of code
Windows Vista-50 million lines of code
Windows 10–80 million lines of code
Ubuntu–50 million lines of code
MacOS X–84 million lines of code
Android–12 million lines of code
iOS–12 million lines of code
Web browsers
Google Chrome-6.7 million lines of
code
Mozilla Firefox–21 million lines of
code
Office suites
Microsoft Office 2013–45 million
lines of code
Apache OpenOffice–19 million lines
of code
LibreOffice–10 million lines of code
Social networks
Facebook–62 million lines of code
TikTok–80,000 lines of code
SnapChat–60,000 lines of code
Instagram–1 million lines of code
LinkedIn–8 million lines of code
Twitter–10 million lines of code
Messaging apps
WhatsApp–30,000 lines of code
Telegram–50,000 lines of code
Zoom–60,000 lines of code
Media players and audio and video editors
Blender–1.1 lines of code
Audacity–161,007 lines of code
VLC Media Player–599,658 lines of code
Media Player Classic–168,007 lines of code
Image editors
GIMP–726,863 lines of code
Adobe Photoshop–10 million lines of code
Krita–1 million lines of code
P2P programs
Ares Galaxy–1,176,679 lines of code
eMule-2,437,791 lines of code
BitTorrent–its protocol has only 8,633 lines of code
Vuze–967,990 lines of code
Web applications
WordPress–160,636 lines of code
Google Suite(Gmail,Drive, Search, etc.): 2 billion
lines of code
Reddit-139,659 lines of code
Menéame–23,190 lines of code
Video game
Grand Theft Auto V (GTA 5)–36 million lines of code
Red Dead Redemption II (RDR2)–60 million lines of
code
World of Warcraft (WoW)–5.5 million lines of code
Minecraft–500,000 lines of code
Age of Empires Online-1 million lines of code
•Model is an abstract representation of
a system, constructed to understand
the system prior to building or
modifying it.
•It is a simplified representation of
reality
•Modeling is used during many phases
of the software life cycles.
Triangle for success
Tools
cannot exist
alone
Language (Notation)
Process Tools
Computer System
Business Process
Order
Item
Ship via
“Modeling captures essential
parts of the system.”
Dr. James Rumbaugh
Visual Modeling is
modeling
using standard graphical
notations
What is Visual Modeling?
Use Case Analysis is a technique to capture
business process from user’s perspective
Visual Modeling Captures
Business Process
Visual Modeling is a
Communication Tool
Use visual modeling to capture business objects and logic
Use visual modeling to analyze and design
your application
Visual Modeling
Manages Complexity
User Interface
(Visual Basic,
Java)
Business Logic
(C++, Java)
Database Server
(C++ & SQL)
Model your system
independent of
implementation language
Visual Modeling Defines Software
Architecture
Multiple Systems
Visual Modeling
Promotes Reuse
Reusable
Components
Three Important Features of the
Iterative Approach
•Continuous integration
–Not done in one lump near the delivery
date
•Frequent, executable releases
–Some internal; some delivered
•Attack risks through demonstrable progress
–Progress measured in products, not
documentation or engineering estimates
Risk
Transition
Inception
Elaboration
Construction
Preliminary
Iteration
Architect.
Iteration
Architect.
Iteration
Devel.
Iteration
Devel.
Iteration
Devel.
Iteration
Transition
Iteration
Transition
Iteration
Post-
deployment
Waterfall
Time
Risk Profile of an Iterative
Development
Risk Management
Phase-by-Phase
•Inception
–Bracket the project’s risks by building a proof of
concept
•Elaboration
–Develop a common understanding of the system’s
scope and desired behavior by exploring scenarios
with end users and domain experts
–Establish the system’s architecture
–Design common mechanisms to address system-
wide issues
Risk Management
Phase-by-Phase (cont.)
•Construction
–Refine the architecture
–Risk-driven iterations
–Continuous integration
•Transition
–Facilitate user acceptance
–Measure user satisfaction
•Post-deployment cycles
–Continue evolutionary approach
–Preserve architectural integrity
Initial Project Risks
Initial Project Scope
Revise Overall
Project Plan
•Cost
•Schedule
•Scope/Content
Plan Iteration N
•Cost
•Schedule
Assess Iteration N
Risks Eliminated
Revise Project Risks
•Reprioritize
Develop Iteration N
•Collect cost and
quality metrics
Define scenarios to
address highest risks
Iteration N
Risk Reduction Drives
Iterations
Inception ElaborationConstruction Transition
Iteration 1Iteration 2Iteration 3
Iteration Planning
Rqmts Capture
Analysis & Design
Implementation
Test
Prepare Release
“Mini-Waterfall” Process
Use Cases Drive the
Iteration Process
The Iteration Life Cycle: A
Mini-Waterfall
•Results of previous iterations
•Up-to-date risk assessment
•Controlled libraries of models,
code, and tests
Release description
Updated risk assessment
Controlled libraries
Iteration Planning
Requirements Capture
Analysis & Design
Implementation
Test
Prepare Release
Selected scenarios
Detailed Iteration Life
Cycle Activities
•Iteration planning
–Before the iteration begins, the general objectives of
the iteration should be established based on
•Results of previous iterations ( if any)
•Up-to-date risk assessment for the project
–Determine the evaluation criteria for this iteration
–Prepare detailed iteration plan for inclusion in the
development plan
•Include intermediate milestones to monitor
progress
•Include walkthroughs and reviews
Detailed Iteration Life
Cycle Activities (cont.)
•Requirements Capture
–Select/define the use cases to be
implemented in this iteration
–Update the object model to reflect additional
domain classes and associations discovered
–Develop a test plan for the iteration
Detailed Iteration Life
Cycle Activities (cont.)
•Test
–Integrate and test the developed code with the rest of
the system (previous releases)
–Capture and review test results
–Evaluate test results relative to the evaluation criteria
–Conduct an iteration assessment
•Prepare the release description
–Synchronize code and design models
–Place products of the iteration in controlled libraries
Work Allocation Within an Iteration
•Work to be accomplished within an iteration is
determined by
–The (new) use cases to be implemented
–The rework to be done
•Packages make convenient work packages for
developers
–High-level packages can be assigned to teams
–Lower-level packages can be assigned to individual
developers
•Use Cases make convenient work packages for test and
assessment teams
•Packages are also useful in determining the granularity
at which configuration management will be applied
–For example, check-in and check-out of individual
packages
Iteration Assessment
•Assess iteration results relative to the evaluation criteria
established during iteration planning:
–Functionality
–Performance
–Capacity
–Quality measures
•Consider external changes that have occurred during
this iteration
–For example, changes to requirements, user needs,
competitor’s plans
•Determine what rework, if any, is required and assign it
to the remaining iterations
Selecting Iterations
•How many iterations do I need?
–On projects taking 18 months or less, 3 to 6
iterations are typical
•Are all iterations on a project the same
length?
–Usually
–Iteration length may vary by phase. For
example, elaboration iterations may be
shorter than construction iterations
There Is No Silver Bullet
•Remember the main reason for using the iterative life
cycle:
–You do not have all the information you need up front
–Things will change during the development period
•You must expect that
–Some risks will not be eliminated as planned
–You will discover new risks along the way
–Some rework will be required; some lines of code
developed for an iteration will be thrown away
–Requirements will change along the way
Development Cycle
•The development cycle is split into phases.
•Phases are split into iterations.
•Activities are grouped by disciplines.
Why Model
•Blueprint for large developments
•Solve problems before building systems
•Construct parts that fit together
•Plan
•Manage resource
•Adapt to change
Models help
•“Visualize” the system
•Agreement with customers
•Agreement with sponsors
•Estimation
•Costing
•Scalability and reliability planning
Can be built by one person
Requires
Minimal modeling
Simple process
Simple tools
Architecting a dog house
Architecting a house
Built most efficiently and timely by a team
Requires
Modeling
Well-defined process
Power tools
Modeling a house
When not to model?
•Trivial systems
•Over-modelling of modest systems
•Over-modelling of large systems
–diagrams for diagrams sake
–excessive detail
Types of models
•Static model –snapshot of a system’s
parameters at rest or at specific point in
time (e.g) class diagram
•A dynamic model can be viewed as
collection of procedures or behavior of a
system over time. It shows how business
objects interact to perform tasks.
Defining UML
Modeling with UML
Analyzing UML’s Strengths and
Weaknesses
•Describing the Modeling Process
•Defining the Syntax of UML
•Clarifying with an Example
OUTLINE
Unified Modeling Language is a
standard language for writing
software blueprints
WHAT IS UML?
Defining UMLModeling with UML Analyzing UMLExamples
WHO DEVELOPED IT?
Object
Management
Group
Grady Booch James Rumbaugh
Ivar Jacobson
Defining UMLModeling with UML Analyzing UMLExamples
Booch JacobsonRumbaugh
“The 3 Amigos”
UML TOOLS
Defining UMLModeling with UML Analyzing UMLExamples
Rational Rose -IBM
ArgoUML –Tigris
http://argouml.tigris.org/
Visual paradigm suite
PRESCRIBED PROCESS
Object –Oriented
(although not limited)
Use Case Driven
Architecture-centric
Iterative and Incremental
Defining UMLModeling with UML Analyzing UMLExamples
ARCHITECTURE CENTRIC
Design
View
Deployment
View
Process
View
Implementation
View
Use Case
View
Design
View
Use Case
View
Defining UMLModeling with UML Analyzing UMLExamples
End-user
Functionality
Analysts/
Designers
structures Programmers
Software management
System topology
Delivery, installation
communication
Performance
Scalability
Throughput
System Integrators
SYNTAX AND DIAGRAMS
Things Relationships
Diagrams
•Structural
•Realization•Annotational
•Grouping
•Behavioral
•Generalization
•Association
•Dependency
class
Window
size
open()
waiting
state
Business
rules
package
Return
copies
notes
dependencyassociation
GeneralizationRealization
Defining UMLModeling with UML Analyzing UMLExamples
There are about9 types of diagrams in UML1.5
Sequence
Diagrams
Dynamic views Static views
Collaboration
Diagrams
Activity
Diagrams
Statechart
Diagrams
Class
Diagrams
Object
Diagrams
Component
Diagrams
Deployment
Diagrams
Model
Some part of
the model might
not be visible on
any diagram
Use Case
Diagrams
Workflows and Models
Requirements
Design
Implementation
Test
Analysis
Use Case
Model
Design
Model
Deploym.
Model
Impl.
Model
Analysis
Model
Test
Model
UML diagrams provide
views into each model
Each workflow is
associated with one or
more models.
Use Case Model
Use Case
Diagrams
Collaboration
Diagrams
Component
Diagrams
Deployment
Diagrams
Object
Diagrams
Statechart
Diagrams
Sequence
Diagrams
Class
Diagrams
Activity
Diagrams
Use Case
Model
Design
Model
Depl.
Model
Impl.
Model
Analysis
Model
Test
Model
Analysis & Design Model
Use Case
Diagrams
Collaboration
Diagrams
Component
Diagrams
Deployment
Diagrams
Object
Diagrams
Statechart
Diagrams
Sequence
Diagrams
Class
Diagrams
Activity
Diagrams
Use Case
Model
Design
Model
Depl.
Model
Impl.
Model
Analysis
Model
Test
Model
Incl. subsystems
and packages
Deployment and Implementation Model
Use Case
Diagrams
Collaboration
Diagrams
Component
Diagrams
Deployment
Diagrams
Object
Diagrams
Statechart
Diagrams
Sequence
Diagrams
Class
Diagrams
Activity
Diagrams
Use Case
Model
Design
Model
Depl.
Model
Impl.
Model
Analysis
Model
Test
Model
Incl. active classes
and components
Test Model
Use Case
Diagrams
Collaboration
Diagrams
Component
Diagrams
Deployment
Diagrams
Object
Diagrams
Statechart
Diagrams
Sequence
Diagrams
Class
Diagrams
Activity
Diagrams
Use Case
Model
Design
Model
Depl.
Model
Impl.
Model
Analysis
Model
Test
Model
Test model refers to
all other models and
uses corresponding
diagrams
SYNTAX AND DIAGRAMS
Static Dynamic
Class
Object
Component
Deployment
Use Case
Sequence
Collaboration
Statechart
Activity
Defining UMLModeling with UML Analyzing UMLExamples
SYNTAX AND DIAGRAMS
Defining UMLModeling with UML Analyzing UMLExamples
Use Case
Diagrams
Collaboration
Diagrams
Sequence
Diagrams
Class
Diagrams
State
Diagrams
Activity
Diagrams
Deployment
Diagrams
Component
Diagrams
SYSTEM DESCRIPTION
Defining UMLModeling with UML Analyzing UMLExamples
On-line Grade Record
•Computerized system in which
teachers record and update
grades and students access their
personal grade records
USE CASE DIAGRAM
Defining UMLModeling with UML Analyzing UMLExamples
Student
Teacher
Log in
Save Grades
Load Grades
View Grades
Record Grades
Update Grades
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
STATE DIAGRAM
Defining UMLModeling with UML Analyzing UMLExamples
Ready Saving
Saved Error
Success Failure
SaveGrade
UML first pass: Sequence
diagram
:LCDDisplay
blinkHours()
blinkMinutes()
refresh()
commitNewTime()
:Time
incrementMinutes()
stopBlinking()
:Watch
pressButton1()
pressButton2()
pressButtons1And2()
pressButton1()
:WatchUser
Object
Message
Activation
Sequence diagrams represent the behavior as interactions
Actor
Lifeline
UML first pass: Class diagrams
1
2
push()
release()
1
1
blinkIdx
blinkSeconds()
blinkMinutes()
blinkHours()
stopBlinking()
referesh()
LCDDisplay Battery
load
1
2
1
Time
now
1
Watch
Class
Association
Multiplicity
Attribute
Operations
Class diagrams represent the structure of the system
state
PushButton
UML first pass: Statechart diagrams for
objects with interesting dynamic behaviorBlinkHours
BlinkMinutes
IncrementHrs
IncrementMin.
BlinkSeconds IncrementSec.
StopBlinking
[button1&2Pressed]
[button1Pressed]
[button2Pressed]
[button2Pressed]
[button2Pressed]
[button1Pressed]
[button1&2Pressed]
[button1&2Pressed]
State
Initial state
Final state
Transition
Event
Represent behavior as states and transitions
•Show aspects of model
implementation, including source
code structure and run-time
implementation structure
•Kinds
–component diagram
–deployment diagram
Implementation Diagrams
•Shows the organizations and
dependencies among software
components
•Components include
–source code components
–binary code components
–executable components
Component Diagram
•Shows the configuration of run-time
processing elements and the
software components, processes and
objects that live on them
•Deployment diagrams may be used
to show which components may run
on which nodes
Deployment Diagram
Node1
Node2
«cluster»
x y
«cluster»
x y
«become»
«database»
w z Deployment Diagram (cont’d)
UML’s STRENGTHS
Defining UMLModeling with UML Analyzing UMLExamples
UML is a language which directs us to:
•Visualize
•Specify
•Plan
•Document
Organize,
Structure and
Communicate
UML’s STRENGTHS
Defining UMLModeling with UML Analyzing UMLExamples
Which compels us to be:
•More Precise
•More Complete
•Less Ambiguous
Its easy to read and if accepted would
be a language that everyone understood
UML’s WEAKNESSES
Defining UMLModeling with UML Analyzing UMLExamples
There is a big difference between:
Compelsand Ensures
•There is insufficient means
for test and verification
(For instance: there is no mean to specify relational tables)
Defining UML
Modeling with UML
Analyzing UML’s Strengths and
Weaknesses
•Describing the Modeling Process
•Defining the Syntax of UML
•Clarifying with Examples
SUMMARY
Booch, G. et al., The Unified Modeling
Language User Guide, Addison-Wesley,
Toronto, 1998
Roff, J.T., UML A Beginner’s Guide,
McGraw Hill/Osborn, Toronto, 2003
BIBLIOGRAPHY