lecture 8 - ida.liu.setddc32/lectures/tddc32-08.pdf · lecture 8 ooad – design phase details....

27
Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java 6 February 2013 Tommy Färnqvist, IDA, Linköping University 8.1 Lecture Topics Contents 1 Interaction Modeling 1 1.1 Introduction .......................................... 1 1.2 Sequence Diagrams ...................................... 4 1.3 Collaboration Diagrams .................................... 5 2 State Diagrams 6 3 Architecture Design Models 12 3.1 Introduction .......................................... 12 3.2 Package Diagrams ...................................... 14 3.3 Deployment Diagrams .................................... 16 4 Testing 18 4.1 Motivation and Alternatives .................................. 18 4.2 Unit Testing .......................................... 21 4.3 JUnit .............................................. 24 8.2 1 Interaction Modeling 1.1 Introduction 1

Upload: others

Post on 12-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

Lecture 8OOAD – Design Phase Details.TestingTDDC32

Lecture notes in Design and Implementation of a Software Module in Java 6 February 2013

Tommy Färnqvist, IDA, Linköping University

8.1

Lecture Topics

Contents

1 Interaction Modeling 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 Collaboration Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 State Diagrams 6

3 Architecture Design Models 123.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2 Package Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.3 Deployment Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4 Testing 184.1 Motivation and Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.2 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.3 JUnit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 8.2

1 Interaction Modeling

1.1 Introduction

1

Page 2: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.3

8.4

2

Page 3: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.5

8.6

3

Page 4: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.7

1.2 Sequence Diagrams

8.8

4

Page 5: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.9

8.10

1.3 Collaboration Diagrams

5

Page 6: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.11

8.12

2 State Diagrams

6

Page 7: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.13

8.14

7

Page 8: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.15

8.16

8

Page 9: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.17

8.18

9

Page 10: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.19

8.20

10

Page 11: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.21

8.22

11

Page 12: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.23

8.24

3 Architecture Design Models

3.1 Introduction

12

Page 13: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.25

8.26

13

Page 14: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.27

3.2 Package Diagrams

8.28

14

Page 15: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.29

8.30

15

Page 16: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.31

3.3 Deployment Diagrams

8.32

16

Page 17: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.33

8.34

17

Page 18: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.35

4 Testing

4.1 Motivation and Alternatives

8.36

18

Page 19: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.37

8.38

19

Page 20: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.39

8.40

20

Page 21: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.41

8.42

4.2 Unit Testing

21

Page 22: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.43

8.44

22

Page 23: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.45

8.46

23

Page 24: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.47

4.3 JUnit

8.48

24

Page 25: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.49

8.50

25

Page 26: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.51

8.52

26

Page 27: Lecture 8 - ida.liu.seTDDC32/lectures/tddc32-08.pdf · Lecture 8 OOAD – Design Phase Details. Testing TDDC32 Lecture notes in Design and Implementation of a Software Module in Java

8.53

8.54

27