<<

2017 Spring CS350 Introduction to Software Engineering UML Overview [1/2]

Young-Min Baek1 and Doo-Hwan Bae2 1,2Korea Advanced Institute of Science and Technology (KAIST) Daejeon, Republic of Korea

1 [email protected] 2 [email protected]

Software Engineering Lab (SELab), KAIST Outline 1. Modeling a Software System A. What is Modeling? B. Modeling Languages 2. Unified Modeling Language (UML) A. What is UML? B. UML Taxonomy C. Software Modeling with UML 3. Design Activities with UML A. Development Process B. Types of UML • Structural Diagrams • Behavioral Diagrams

2017 Spring. [CS350] Introduction to Software Engineering – UML Overview [1/2] 2/53 Notice

TA Office Hour

TUE/THU 14:30~17:30 Young-Min Baek, Mingyu Jin

Software Engineering Lab, N1 #524

[email protected] [email protected]

3/53 We Want

Better Software More reliable, less defects, better performance, higher quality, more familiar/comfortable interface, and so on

THEN HOW? Software Engineering

4/53 How to Develop a System?

Systematically Thorough analysis of stakeholders & requirements, better process, unambiguous understandings However, High complexity of a large project (A large number of components & a large amount of team work) Linguistic communication between teams or between team members is neither accurate nor reliable

5/53 How to Develop a System?

THEN HOW? Model-based/driven Engineering

Models are the standard representations and they are accurate and reliable.

https://www2.warwick.ac.uk/fac/sci/physics/research/condensedmatt/imr_cdt/studen 6/53 ts/david_goodwin/teaching/modelling/l1_introuml.pdf Modeling a Software System

2017 Spring. [CS350] Introduction to Software Engineering – UML Overview [1/2] 7/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Software Development Process

 Process-People-Technology triad

“While process is often described as a leg of the process-people-technology triad, it may also be considered the “glue” that unifies the other Software aspects.” Programmer Architecture/ Design Technique Tau Logiscope, Programming Design Implementation Doxygen, etc. Telelogic Tau SDL Suite, Technique Designer IBM Rational Rose RT

Process Telelogic Tau Project goal Analysis Test Testing TTCN Suite Requirement Business goal Technique Analysis Process Technique

Tester Telelogic Tau Maintenance IBM Rational Analyst Rose Process People Maintenance Technology related Technology Technique People

8/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Here, We Focus on...

We need Analyst Telelogic Tau G2 Designer We need analysis capabilities design skills Requirement Software Analysis Architecture/ Technique Design Technique

Analyst Programmer Analysis Design Telelogic DOORS Software Configuration Eclipse, Jbuilder etc. Requirement Management Elicitation Programming Technique Technique

SW Development Process Conceptualization Code

Software Requirement Management Process Technology People

Maintenance Test 9/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

For Analysis and Design of Software,

We use a ‘MODEL’

to analyze requirements, to design/illustrate software architectures, to represent software behaviors, and so on.

10/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Model

 What is a model?  A model is a simplification of reality

Reality Modeling Model Requirements models Software system Analysis/design Implementation models

11/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Model

 What is a model?  A model is an intended simplification of reality Models (i.e. specifications) describe structures and behaviors of a system they intend to model.

Reality Modeling Model Requirements models Software system Analysis/design Implementation models

Modeling is a proven and well-accepted engineering technique (e.g., Architectural model of houses and buildings, Mathematical models)

12/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Model (in Detail)

 What is a model?  A model is a simplification of reality  A model is the abstracted representation of requirements

Requirements We have to start here.

Reality Modeling Model Requirements models Software system Analysis/design Implementation models

If the software system is not yet developed...

13/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Example Models in Real World

 Examples*

*http://www.ursalhomes.com/briana-single-house-and-lot-for-sale-cavite/ 14/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Example Models in Real World

 Examples*

*http://www.godesignsolutions.com.au/services/architectural_design_drawings 15/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Example Models in Real World

 Examples: Maps as abstractions

http://www.cs.toronto.edu/~sme/CSC302/notes/02-03-IntroModeling.pdf 16/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Why Do We Use a Model?

 We model something  To easily communicate information between different stakeholders in an unambiguous way

17/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Why Do We Use a Model?

 We model something  To deal with problem complexity ABSTRACTION: Ignore detail to see the big picture **Every abstraction involves choice over what is important DECOMPOSITION: Partition a problem into independent pieces PROJECTION: Separate different concerns (views) and describe them separately MODULARIZATION: Choose structures that are stable over time, to localize change

18/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Why Do We Use a Model?

 Waterfall Model for software development*

Requirement Design system/software models • To adequately represent/specify stakeholders’ and Specifications system requirements • To systematically implement a software based on the developed models System and Software Design

Implementation and Unit Testing

Integration and System Testing

Operation and Maintenance

*http://pehop.com/waterfall-system-development-life-cycle/ 19/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Why Do We Use a Model?

 We model something  To specify target-language-independent designs  To provide structure for problem solving  To provide mechanisms (abstractions, views, filtering, structure) to manage complexity  To be able to easily experiment to explore multiple solutions To reveal key design decisions To uncover problems and figure out what questions to ask

 The exercise of modeling is more important than the model itself.  Time spent perfecting the models might be time wasted…

20/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Typical Properties of Good Models

 Correct  Every statement is one that the software shall meet  Unambiguous  It has only one interpretation Unambiguity is the fundamental  Complete property of models  It includes all the requirements  Consistent  No subset has conflict

21/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Modeling Language (ML)

 Definition  A modeling language is any language with which a model can be described. An ML can be anything that helps you describe your system (e.g., pseudo-code, actual code, pictures, diagrams, or description) An ML contains two elements: Notation is the elements that make up a modeling language Semantics are the descriptions of what the notation means

22/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

What Can Be an Effective ML?

 Visual notation like UML can be a solution!

23/53 UML Unified Modeling Language

2017 Spring. [CS350] Introduction to Software Engineering – UML Overview [1/2] 24/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

History of UML

 “Method Wars” of object-oriented paradigm in 1990s  OOAD, OMT, OOSE, Fusion, OOA/OOD  Each of the methods had its own notation, process, and tools

They needed to be unified in a refined & easy-to-understand modeling method

25/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Unified Modeling Language (UML)

Unified Modeling Language

 Unified  End to many similar approaches  Standardized by OMG

26/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Unified Modeling Language (UML)

Unified Modeling Language

 Unified  End to many similar approaches  Standardized by OMG  Modeling  Main (creative) process of software development

27/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Unified Modeling Language (UML)

Unified Modeling Language

 Unified  End to many similar approaches  Standardized by OMG  Modeling  Main (creative) process of software development  Language  Provides notation, no method, no process  Graphical, collection of different diagram types

28/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Unified Modeling Language (UML)

 Visual modeling language for specifying, constructing and documenting  Object-oriented modeling  Model/view paradigm  Target language independent

http://www.uml.org 29/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML 2.0

 UML 2.0 leverages the industry’s investment in UML 1.x and makes UML comprehensive, scalable and mature  UML 2.0 designed to solve the key UML 1.x issues  Major improvements in UML 2.0 include: New internal structure diagrams support precise definition of architecture, interfaces and components Improved scalability in state machine and sequence diagrams Better semantic foundation enables advanced model verification and full code generation

30/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Use of UML

 UML is used to describe software-intensive system in terms of object-oriented paradigm

Types of Systems Common characteristics Information store, retrieve, transform, and present information to user systems

Technical handle and control technical equipment such as systems telecommunications, military systems, or industrial process often real-time system

Embedded execute on simple hardware embedded in some other systems equipment such as mobile phone, car, household appliance

Distributed distributed on a number of machines systems often built on object mechanism such as CORBA, DCOM, Java Beans/RMI

31/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Diagram/View Paradigm

 Each diagram is just a view of part of the system  Together, all diagrams provides a complete picture

Underlying System Model

32/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Describe a Software System with UML

 (Recap) The UML is a visual modeling language used to describe the model of software system  Structure: What are software’s features?  Behavior: What constitutes the software and how do they interact?

33/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML Diagrams

Package Class Composite Diagram Diagram Activity Structure Diagram Diagram State Machine Object Behavioral Diagram Diagram Diagram Structural Diagram Deployment Interaction Diagram Diagram Diagram

Component Timing Diagram Diagram

Communication Interaction Overview Diagram Diagram Each diagram is just a view of part of the system

34/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML Diagrams

Package Class Composite Diagram Diagram Activity Structure Diagram Diagram State Machine Object Behavioral Diagram Diagram Diagram Structural Diagram Use Case Deployment Interaction Diagram Diagram Diagram

Component Timing Diagram Diagram

Communication Interaction Sequence Diagram Overview Diagram Diagram

35/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML 2.x Diagrams

http://stackoverflow.com/questions/7779614/how-to-represent-a-loop-in-a-class-diagram 36/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML 2.x Diagrams (Extended)

http://www.uml-diagrams.org/uml-25-diagrams.html 37/53 Design Activities with UML

2017 Spring. [CS350] Introduction to Software Engineering – UML Overview [1/2] 38/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Software Modeling

Software Development

Modeling Implementation

Requirement Analysis Design Implementation specification

Requirements Analysis Design System model(s) model(s) model(s)

39/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Software Modeling with UML (1/2)

Software Software Development Maintenance

Verification & Modeling Implementation Validation

Requirement Analysis Design Implementation Testing specification

UML

40/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Software Modeling with UML (2/2)

 Diagrams used for each development phase

Requirement Implemen- Analysis Design Testing definition tation

Package diagram

Class diagram State machine diagram Use-case Interaction diagram diagram Composite structure diagram

41/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Software Development Process

Architectural Detailed Implemen- Requirement Analysis Testing Design Design tation

expressed in implemented verified/ structured by realized by Use-case terms of by validated by Spec.

Supplementary class… Spec. class… class… class…

Analysis Subsystem/ Design Source Test Requirement Class Component Class Code Cases

42/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML: Generality

 UML supports various types of systems

Real-time system State-machine, Sequence, Timing diagram(s)

Distributed system Deployment diagram(s)

 UML supports object-oriented (OO) & -based development (CBD) development methodology

OO Use-case, Class, Interaction diagram(s)

CBD Component, Composite structure diagram(s)

43/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML Diagrams – (1) Structural Diagrams

Diagram Description Elements Shows structure of the designed system, subsystem or Class Class, interface, feature, component as related classes and interfaces, with their constraint, relationships diagram features, constraints and relationships Shows instance specifications of classes and interfaces Object Instance specification, (objects), slots with value specifications, and links object, slot, link diagram (i.e., a with objects and no classes) Package Package, element, Shows packages and relationships between the packages , element/ diagram import & merge Shows components and dependencies between them. Component, interface, Component - Used for Component-Based Development (CBD) provided & required diagram - Used to describe systems with Service-Oriented interface, class, port, Architecture (SOA) connector, , etc.

Composite structure Show (a) internal structure of a , (b) a behavior of a diagram collaboration Deployment, artifact, deployment target, , Deployment Show architecture of the system as deployment of device, execution, diagram software artifacts to deployment targets environment, communication path, deployment spec

*http://www.uml-diagrams.org/uml-25-diagrams.html 44/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

UML Diagrams – (2) Behavioral Diagrams

Diagram Description Elements Describe a set of actions (use cases) that some system or systems should or can perform in collaboration with one or Use case, , Use-case diagram more external users of the systems (actors) to provide some subject, extend, observable and valuable results to the actors or other include, association stakeholders of the system

State machine Used for modeling discrete behavior through finite state State, transition, diagram transitions and expressing the behavior of a part of the system pseudostate Shows sequence and conditions for coordinating lower-level Activity, partition, Activity diagram behaviors, rather than which classifiers own those behaviors action, object, control, (e.g., control flow and object flow models) edge Lifeline, execution, specification, message, Most common kind of interaction diagrams which focuses on combined fragment, Sequence diagram the message interchange between lifelines (objects) interaction use, state invariant, destruction occurence

Communication diagram, Interaction overview diagram, *See Note. Timing diagram

*http://www.uml-diagrams.org/uml-25-diagrams.html 45/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Final Products to Be Produced

Refinement Analysis Design

Use-case Class State machine model Sequence diagram diagram model Generated Code

Domain model Composite structure (Signal, Interface etc.)

46/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

In This Lecture,

 We will study three types of UML diagrams:

Package Class Composite Diagram Diagram Activity Structure Diagram Diagram State Machine Object Behavioral Diagram Diagram Diagram Structural Diagram Use Case Deployment Interaction Diagram Diagram Diagram

Component Timing Diagram Diagram

Communication Interaction Sequence Diagram Overview Diagram Diagram

47/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

In This Lecture,

 We will study three types of UML diagrams:  Use-case diagram A high level visualization of how the system works Built on requirement specifications from discussions with developers, customers, and/or end users  Class diagram A collection of static model elements such as classes and types, their contents, and their relationships  Sequence diagram Model of sequential logic, in effect the time ordering of messages between classifiers

48/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

In This Lecture,

 We will study modeling notations of the diagrams:

49/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

In This Lecture,

 We will design a software system  Specify the structure of how a software system will be written and function, without actually writing the complete implementation

 A transition from “what” the system must do, to “how” the system will do it  What classes will we need to implement a system that meets our requirements?  What fields and methods will each class have?  How will the classes interact with each other?

https://courses.cs.washington.edu/courses/cse403/11sp/lectures/lecture08-uml1.pdf 50/53 Modeling a Software System UML: Unified Modeling Language Design Activities with UML

Before Studying Modeling of Diagrams,

 We have to know following concepts (terms):  Stakeholder(s)?  Requirement(s)?  Use case(s)?  Actor(s)?  Class, Object, and Instance? The instances of a class are called objects.  State(s) of Software?  Association(s)?

51/53 Activities (QUIZ)

2017 Spring. [CS350] Introduction to Software Engineering – UML Overview [1/2] 52/53 QUIZ

 Who can be stakeholders of a software system?

 What is a software requirement?

 What are the possible requirements of app?  Functional requirements  Non-functional requirements

53/53 Thank You.

2017-Spring. CS350 Introduction to Software Engineering UML Overview [1/2]

Young-Min Baek