Professional Documents
Culture Documents
Software Engineering
Software Engineering
1 Introduction 1 Introduction
Small reminder Small reminder
What is the purpose? What is the purpose?
Unified Modeling Language Unified Modeling Language
1
http://www.paragoninnovations.com/guide.shtml
Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 7 / 66 Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 8 / 66
Examples of failure When software fails. . .
Mariner spacecraft to Venus (in the sixties): error that can be
detected at compile time in a Fortran program (comma where a
point was needed).
In 1971, in France: 72 weather balloon were destroyed because Numerous problem can be cited
of a software bug
More important to understand why?:
In 1981, American space shuttle: 2 days late on launching,
Software are complex manufactured products
launch was done without resolving the problem. Errors can be easily introduced
In 1990, AT& T subscribers on the East coast (USA) could not It is hard to obtain precise specifications
phone outside this area: chain reaction due to a version change It is hard to test the software against specifications
of the software
In 1990, train ticket system fails down in France: the national
company has reused a software from an airline company.
In 2000, Ariane 5 rocket destroyed: reuses software from Ariane
4, type verification problem.
Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 9 / 66 Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 10 / 66
Development:
The software is designed more precisely at each step
Iteration: after validation and verification the design may be
re-evaluated
Invisibility: documentation is crucial
Several different models:
Waterfall, spiral, V
corresponds to several development types
Goal: obtain a controllable development process and
reproducible.
But. . . it definitively depends on the team willingness
1 Introduction
Small reminder
Arrows semantic: What is the purpose?
The arrow (ց or ր) indicates that we go from one step to the Unified Modeling Language
other step
2 Modeling design aspect
The sub-arrow −→ (from left to right) indicates that when the Object diagram
design is done the corresponding tests can be designed Class diagram
The sub-arrow ←− (from right to left) indicates that tests are
passed to check against the design. 3 Modeling dynamic aspect
Use case diagram
Sequence diagram
Communication diagram
Definition
It is a abstract graphic language dedicated to the specification,
construction and documentation of object-oriented software-intensive
systems.
Requirements analysis:
Use case diagram Design (architectural and detailed):
Specification: Class diagram
Sequence diagram Statechart diagram
Communication diagram
Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 21 / 66 Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 22 / 66
1 Introduction
Small reminder
What is the purpose?
We consider here the technical structure of the program. Then, we Unified Modeling Language
do not take into consideration the time or any functional aspcect.
(usually students prefer this ones) 2 Modeling design aspect
1 Object diagram Object diagram
Class diagram
2 Class diagram
3 Modeling dynamic aspect
Use case diagram
Sequence diagram
Communication diagram
Definition
Represent objects and their link at a time t. It is useful for
documenting test case and/or use of your architecture. Peter, Alice and Carl are students in UP
Similar to a graph where: John and Cameron are teachers in UP
Node corresponds to an instance of a class John teaches the C++ and CUDA
Edge represents link between nodes (usually corresponds to
Cameron techs the Java and math
attributes)
Peter and Alice follow the C++, Java and math
Carl follow the Java and math.
Not supported by all tools
Often drawn by hand
1 Introduction
Small reminder
What is the purpose? Definition
Unified Modeling Language It is just an abstraction of the previous map:
2 Modeling design aspect Node represents a class
Object diagram Arc/Edge represent relationship between nodes. There is two
Class diagram kinds of relation:
associations lead attributes
3 Modeling dynamic aspect inheritance influence the form of the child
Use case diagram
Sequence diagram
Communication diagram
Vis: (+ : public), (− : private), (# : protected) or ∼: package The link can be read ”has a”. Sometimes another verb is more
Name of the method (lower cases in Java) appropriate, thus we add relation name in the middle.
Dir direction of the attribute: Interpretation:
in read-only
out write only The class A has an attribute called y of type B
inout read and write The class B has an attribute called x which is a collection of
NameArg name of the parameter type A.
TypeArg type of the parameter Multiplicity: 1, *, 1..*,0..1, . . .
Type return type of the method
Example:
Abstracts or virtuals methods write in italic
Statics methods use underline Company employer employee Person
Operations can be overloaded (same name but distinguish 0..1 1..*
parameters)
Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 33 / 66 Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 34 / 66
A b B
More easy to understand and to design.
1 C
+ extra : int
Here:
The class A has one reference on an object B
The class B has NO reference on A. ⇒ We can generalize that for N-ary associations
*
Example:
*
A B
A a 0..1 B Polygon owner pts Point
a 1
* * 0..1
bla bla 1 D 1 * 3..n
Example: Animal
Book owner ch Chapter pr Paragraph
1 1..* 1..*
Mammal Insect
Dependency Remarks
A last kind of arrow of UML for ”others” cases, where you can add
(or not) a stereotype.
Examples:
Use interface as parameter of an Inheritance from a generic class: All classes must be reached with navigable arrow
operation: More NEVER make lonely entity
Don’t forget multiplicity
Avoid create new stereotype, give priority to predefined ones
Avoid redundancy in associations.
1 Introduction
Implements a Car composed of: Small reminder
four wheels What is the purpose?
one engine Unified Modeling Language
one chassis 2 Modeling design aspect
four braking system (brake disc front and brake drum at back) Object diagram
one fuel tank Class diagram
one steering wheel 3 Modeling dynamic aspect
lights Use case diagram
... Sequence diagram
Communication diagram
1 Introduction
Many UML tools offer the possibility to add some documentations. Small reminder
You must adopt intuitively this feature. What is the purpose?
Short description Unified Modeling Language
Indicate direct interacting actors
2 Modeling design aspect
Precondition and postcondition Object diagram
At least one scenario: Class diagram
Precise the trigger event
Main stream 3 Modeling dynamic aspect
Variants workflow Use case diagram
Exceptions Sequence diagram
Communication diagram
Difference
In the system version, we allow some sentence (no formal
version). We see only the system and actors
In the object version, we must be more precise and use only
existent method.
1 Introduction
Small reminder
What is the purpose? It is just an alternative of sequence diagram! It represents
Unified Modeling Language message interaction between object.
It focuses on the localization of object.
2 Modeling design aspect
Object diagram The exchanged message are numbered and then ordered.
Class diagram Sometimes we can make sub-numbering in order to regroup
common feature
3 Modeling dynamic aspect There is no fragment mechanism.
Use case diagram
Sequence diagram
Communication diagram
I am the client:
I want a game based on letter and more precisely on a
real dictionary. I want optimized access to the
dictionary as binary tree search. I want only the
functional part, thus i don’t ask explicitly a GUI
4 Project: LetterGame (console can be enough).
I want necessarily at least the following games2
The hungman
The longest word
The mystery word
The boogle
2
You can add your owns games
Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 61 / 66 Hakim Belhaouari hakim.belhaouari@sic.univ-poitiers.fr
Introduction
(UP-USTH)
with UML November 11, 2013 62 / 66