Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations:...

56
Software Engineering 2 A practical course in software engineering Ekkart Kindler

Transcript of Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations:...

Page 1: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Software Engineering 2A practical course in software engineering

Ekkart Kindler

Page 2: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

V. Specifying Software

Page 3: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

3SE 2 (02162 e19), L05

Specifying Software

Goals (of “software documents” ): Defining what the software should do (before it is

really there) Customer and Developer agree on what should be

delivered Effort (resources and time) can be planned based

on that (contract will be based on that).

Page 4: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart KindlerWhy, What and How

HOWWHAT

4SE 2 (02162 e19), L05

Page 5: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

5SE 2 (02162 e19), L05

Specifying Software

Project Definition Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

what

how

Page 6: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

6SE 2 (02162 e19), L05

Specifying Software

Project Definition Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

rough

detailed

Page 7: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

7SE 2 (02162 e19), L05

Specifying Software

Project Definition Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

low cost

high cost

Page 8: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

8SE 2 (02162 e19), L05

Specifying Software

Project Definition Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

informal

formal

Page 9: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

9SE 2 (02162 e19), L05

Specifying Software

Goals: Defining what the software should do before it is

really there Customer and developer agree on what should be

delivered Effort (resources and time) can be planned based

on that (contract will be based on that).

Page 10: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

1. Project Definition

Page 11: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

11SE 2 (02162 e19), L05

Specifying Software

Project Definition Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

Page 12: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

12SE 2 (02162 e19), L05

Project Definition: Contents

Partners Context Objective Scope

(in particular, what is NOT to be done)

Use of product (from the end-user’s point of view) Examples (from this derive) Users Use cases (as text, not necessarily as diagrams) Main data (in our case ”indoor climate domain”)

Platform (HW/SW) Glossary of main terms

Readable without any other documents.

Page 13: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

13SE 2 (02162 e19), L05

Project Definition: Contents

Partners Context Objective Scope

(in particular, what is NOT to be done)

Use of product (from the end-user’s point of view) Examples (from this derive:) Users Use cases (as text, not necessarily as diagrams) Main data

Platform (HW/SW) Glossary of main terms

Page 14: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

14SE 2 (02162 e19), L05

Project Definition: Contents

Partners Context Objective Scope

(in particular, what is NOT to be done)

Use of product (from the end-user’s point of view) Examples (from this derive:) Users Use cases (as text, not necessarily as diagrams) Main data

Platform (HW/SW) Glossary of main terms

Page 15: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

15SE 2 (02162 e19), L05

Project Definition: Contents

Partners Context Objective Scope

(in particular, what is NOT to be done)

Use of product (from the end-user’s point of view) Examples (from this derive:) Users Use cases (as text, not necessarily as diagrams) Main data

Platform (HW/SW) Glossary of main terms

Page 16: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart KindlerProject Definition: Contents

Project definition could contain project plan External milestones (delivered to customer) Final deliverables

16SE 2 (02162 e19), L05

Page 17: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

2. Requirements Specification

Page 18: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

18SE 2 (02162 e19), L05

Specifying Software

Project Definition Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

Page 19: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

19SE 2 (02162 e19), L05

What do we need?

What should be achieved by the product?

How is it used? Which functions does it have? Which data are there? What interfaces should be there?

In which quality?

On which platform or technology?

Page 20: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

20SE 2 (02162 e19), L05

Basic outline

Partners: Customer & Developer1. Objectives2. Product use3. Product functions4. Product characteristics (non-functional req.) Platform Performance Security …

5. Glossary(could be includedsomewhere else)

Page 21: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

21SE 2 (02162 e19), L05

Objective: purpose

Why is the software developed? What should be achieved by using this

software?(requires to set the context)

Page 22: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

22SE 2 (02162 e19), L05

Objective: structure

Purpose of this document Context & main (!) terms Objectives of this product Overview of this document

Page 23: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

23SE 2 (02162 e19), L05

Product use: purpose

Basic understanding of how the product is used!

Page 24: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

24SE 2 (02162 e19), L05

Product use: structure

Main concepts Types of users Usage scenarios Domain model

(no design/implementation details) Main tasks Platform & Interfaces

Page 25: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

25SE 2 (02162 e19), L05

Excursion / Discussion

(OO) Analysis vs. (OO) Design

Page 26: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

26SE 2 (02162 e19), L05

Product functions: purpose

Understanding of all functions of the product (as seen by the end user)

Page 27: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

27SE 2 (02162 e19), L05

Product functions: structure

Use cases + use case diagrams Example dialogs (GUI) Outline of steps for every use case Exceptions Variations

Page 28: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

28SE 2 (02162 e19), L05

Product charact.: purpose

How will the software run? In which environment?

Page 29: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

29SE 2 (02162 e19), L05

Product charact.: structure

Usability Platform Standards Performance Maintenance / portability Security

Page 30: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

30SE 2 (02162 e19), L05

Other information

Used development methods / notations Used tools Used programming language

Page 31: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

31SE 2 (02162 e19), L05

Glossary

List of all important concepts / terms of the problem domain along with a brief explanation

Page 32: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

32SE 2 (02162 e19), L05

Specifying Software

Project Definition Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

Page 33: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

33SE 2 (02162 e19), L05

Differences

Project definition / idea

Requirements specification Rough

detailed

Systems specification

Text (possibly sketch of screen shots); not fully detailed

Use cases (named), glossary, rough domain model

Use cases modelled and explained, complete domain model, GUI design (sketch), acceptance tests

Architecture & design of Software, detailed models, software models

Page 34: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

3. Software Specification

Page 35: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

35SE 2 (02162 e19), L05

Design Phase

Planningphase

Definitionphase

Designphase

Implem.phase

Acceptancephase

Mainten.phase

Page 36: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

36SE 2 (02162 e19), L05

Specifying Software

Goals: Defining what the software should do (before it is

really there) Customer and Developer agree on what should be

delivered Effort (resources and time) can be planned based

on that (contract will be based on that).

C-requirementsD-requirements

Page 37: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

37SE 2 (02162 e19), L05

Specifying Software

Project Idea Requirements Specification rough detailed

Systems specification Complete Models Implementation, Documentation

Handbook

rough

detailed

what

how

Page 38: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

38SE 2 (02162 e19), L05

Now: Software Specification

Goals: Defining how the software should be technically

realized In such detail that the implementation is

“details only”

C-requirementsD-requirements

Page 39: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

39SE 2 (02162 e19), L05

Main issues

Software architecture /implementation architecture auxiliary systems and infrastructure

persistent storage of data (DB) GUI

and the relation between them(and the domain model).

Page 40: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

40SE 2 (02162 e19), L05

Architecture

Software architecture: Main components and sub-components of the

system Interfaces (provided and required) of the

components

Implementation architecture: Software architecture + Platform, technology, and language specific details

Page 41: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

41SE 2 (02162 e19), L05

Architecture

Notations: Component diagrams Class diagrams

(refined domain model + software models) Design patterns & their terminology Sequence diagrams + state machines

Behaviour at interfacesBehaviour at interfaces

Behaviour of important components or classes

Page 42: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

42SE 2 (02162 e19), L05

Reminder: Component Diagrams

Component (on different levels of granularity)

Provided interface

Required interface

Sub-components (could be classes)

Page 43: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

43SE 2 (02162 e19), L05

Design principles

Clearly identified functionality Simplicity of interfaces Loose coupling between different components Performance / efficiency

Page 44: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

44SE 2 (02162 e19), L05

Model refinements

Naming conventions Directions of associations Relaxed cardinalities Proper containments ( serialization) Visibilities of attributes and references Auxiliary attributes, classes, and associations

(in EMF often generated automatically) DB Schema

Page 45: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

45SE 2 (02162 e19), L05

Excursion / Discussion

(OO) Analysis vs. (OO) Design

Page 46: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

46SE 2 (02162 e19), L05

GUI

Sketch GUI visually Associate GUI elements with model elements Discuss main use cases in terms of GUI

(hand book)

Page 47: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

47SE 2 (02162 e19), L05

Req Spec vs. Swt Spec

1. Objectives2. Product use3. Product functions4. Product characteristics (non-functional req.) Platform Performance Security …

5. …6. Glossary

Page 48: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

4. On Writing Well

Page 49: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

49SE 2 (02162 e19), L05

Motivation

Writing good texts is hard work!

Most of it can learned and is more on about the writer’s attitude than on talent:What is the purpose?What do I want to achieve?Who is the reader? How do I achieve my goals?

Page 50: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

50SE 2 (02162 e19), L05

Motivation

Problems The readers can’t ask the writer The writer must foresee possible questions and

misunderstandings(and take care of them)

The writer should not assume too much The writer should not make implicit

assumptions or conclusions

Page 51: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

51SE 2 (02162 e19), L05

Comprehensibility

When is a text comprehensibility?

Are there criteria for comprehensibility?

Langer, Schulz von Thun, Tausch:„Sich verständlich ausdrücken!“

Page 52: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

52SE 2 (02162 e19), L05

Criteria

Simplicity ( -- - 0 + ++ ) simple words simple sentences short sentences concrete (e.g. by example)

Structuring ( -- - 0 + ++ ) one idea after the other form and content are coherent conclusive

Page 53: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

53SE 2 (02162 e19), L05

Criteria

Conciseness ( -- - 0 + ++) shortness focussed on essentials no empty words and sentences

Inspiring Additions ( -- - 0 + ++)motivating interesting diversified

Page 54: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart KindlerImportant issues

Set the scene / context:Don’t assume anything (except readers’ pragmatics) for granted

Different levels of abstraction:Typical student mistake: always on the lowest level!!

Guide the reader:Why do you say what you are saying

Bring the point (argument) home – completely!

”Spiralform writing”: Writing linearly about a complex network of concepts

54SE 2 (02162 e19), L05

Page 55: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

55SE 2 (02162 e19), L05

More rules (of thumb)

important stuff first / high-lightedstrong verbs (avoid adjectives /

adverbs)short sentencesuse singular whenever possible familiar terms and expressionsuse “active” wherever possibleclear headlines…

Page 56: Software Engineering 2 (02162) · 2019-09-30 · SE 2 (02162 e19), L05 41. Architecture Notations: Component diagrams Class diagrams (refined domain model + software models) Design

Ekkart Kindler

56SE 2 (02162 e19), L05

Comprehensibility

The above criteria hold for almost all textsFor scientific texts: consistent terminology (same term for

same concept throughout the text):My favourite counter example„Deutscher Fußballreporter“:Ball, Rund, Kulle, Leder, Ding, … Same structure for alike structured

content