Software Modeling:
An Overview
CS6.401 Software Engineering
Dr. Karthik Vaidhyanthan
[Link]@[Link]
[Link]
Acknowledgements
The materials used in this presentation have been gathered/adapted/generate
from various sources as well as based on my own experiences and knowledge
-- Karthik Vaidhyanathan
Sources:
1. Introduction to MDE, Ludovico Iovino, GSSI, Italy
2. UML@Classroom, An Introduction to Object-Oriented Modeling by Martina
Seidl, Marion Scholz, Christian Huemer and Gerti Kappel
3. UML Modelling lecture, Dr. Raghu, IIIT Hyderabad
2
Source: Googe images
Course Outline
What is a Model?
4
Let us consider a real system
5
Image Source: [Link]
Let us now consider a model of the system
"The brain does much more than recollect. It compares, synthesizes, analyzes,
generates abstractions.”
-- Carl Sagan
Model from the engineers
Model from the designers
Model is a simplification of a reality. In other words, it is a blueprint of the system
6
Image source: Google images, mathworks
Modelling can serve more purpose
Checking collision avoidance
Checking if the traffic signs are followed
In essence models can be simulated with tools
to perform analysis
7
Image source: carsim website
Simulation using SUMO
8
So what is a software model?
A simplified or partial representation of a real system, defined in
order to accomplish a task or to reach an agreement.
System Represents Model
Mapping: A model is always a mapping of some real system
Reduction: A model reflects only relevant set of properties of original system
Pragmatism: A model needs to be usable in place of the actual system with
respect to some purpose
9
Quality of Model
As per Bran Selic, five characteristics determine model’s quality
• Abstraction: A model should be reduced version of system [Omit unwanted]
• Understandability: Should be as intuitive as possible
• Accuracy: Reflect relevant properties as close to reality as possible
• Predictiveness: Enable prediction of interesting properties of system
• Cost-effectiveness: Cheaper to create models than the system
10
Glimpse into world of
Model-driven Engineering
11
Model Driven Software Engineering
Shifting focus from code centric techniques to models
12
What is MDE? – Key Motivation
Models as a sketch
• Communication of ideas
• Objective: Modeling per se
Models as guidelines/blueprint
• Design decisions are documented
Sosym journal
• Objective: instrumentation for implementation
Models as executable programs
• Generate code automatically Models conference
• Objective: models are source code and vice versa
13
Image source: models and sosym website
What to Model?
14
Multiple ways to think about it
Algorithmic Perspective
• Main block of building the software is procedure or function
• Scale and new features affects maintainability and reasoning
Object oriented Perspective
• Main building block of all software system is object or class
• Contemporary view of software development
15
Object Oriented Modeling
• Model system as a collection of objects that interact with each other
• Tries to captures the real-world scenario
• Everything is an object
• Has a state and behavior: (Happy, angry)…(speaking softly, yelling…)
• Can you model a person?
• Software objects are similar to real world objects:
• Store state in fields (variables)
• Behavior through methods (functions)
16
Objects vs Classes
Real world Modeling World
Object Object represents anything An object has identity, state and
that can be distinctly identified behavior
Class Represents set of objects It characterizes
with similar characteristics the structure of states and
and behavior behaviors shared by its
instances.
Object is like a variable of a class 17
Lets take a scenario – E-commerce System, Lets think!
18
Key Characteristics
• Abstraction: Hide irrelevant details (eg: Coffee machine)
• Deals with What!
• Encapsulation: Protection against unauthorized access (eg: Organization)
• Deals with how!
• Relationships
• Inheritance: Derive classes from existing classes (eg: Real life inheritance!!)
• Association: Relation between two classes (Aggregation, composition)
• Dependency: Some form of dependency between two classes
19
How to Model?
20
How do you interpret this?
1 2
• 2 comes after 1
• 2 depends on 1
• 1 specializes/refines 2
• 2 listens to 1
• 1 contains 2
… 21
Modeling Languages
22
Modeling Languages
Largely classified into two types
• Domain-Specific Languages (DSLs)
• Languages designed to model a certain domain
• Examples: HTML, SQL, etc.
• General Purpose Modeling Languages (GPLs)
• Languages can be applied to any domain for modeling
• Examples: UML, XML, etc.
Wait is this similar to low code/no code?
23
Some Examples
Azure Machine Learning Studio
AWS Honeycode
24
Source: AWS, Azure (Microsoft Tech Community)
Some Examples - We can create our own too
ThingML modeling
CAPS modeling for IoT
25
Source: [Link], ThingML presentation@Models2018
In the Context of Our Course
(GPL – UML)
26
Unified Modeling Language (UML): Brief History
• No common language to model until 1996
• GPL developed by industry consortium in 1997
• Introduction of OOP in IT dates back to 1960’s
• Required a standard representation: OMG
• Three Amigos: Grady Booch, Ivar Jacobson and James Rumbaugh
• Based on multiple prior visual modeling languages
• Goal was to have a single language that could cover large number
of SE tasks
• Current version of UML: 2.5.1 (as of Dec 2017)
Image source: Wikimedia commons
[Link] 27
Unified Modeling Language (UML)
• Notation for OO Modeling
• Use object orientation as basis
• Model a system as collection of objects that interact with each
other
• Graphical diagrams as a way to model systems
• More clear (imprecise) than natural language (too detailed)
• Capture an overall view of the system
• Independent of language or technology
28
What UML is not?
• Not an OO Method or Process
• Not a visual programming language
• Not a tool specification
29
UML Diagrams
• 14 different diagrams
• Structure diagrams
for capturing static aspects
of system
• Behavior diagrams
for capturing dynamic
aspect of system
30
Image source: UML@classroom
Can you create a model?
Think of a course management system like moodle. Can you create a model
for the same?
Just use whatever knowledge you have, any type of diagram as per your
knowledge is fine – Give a try!!
31
Thank You
Course website: [Link]/cs6401_se
Email: [Link]@[Link]
Web: [Link]
Twitter: @karthi_ishere