39
Software Engineering Pert and Gantt exercises Lecturer: Giuseppe Santucci 1

Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Software Engineering

Pert and Gantt exercises

Lecturer: Giuseppe Santucci

1

Page 2: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Degree of freedom!

I.1 I.2

I.3a

I.3b

I.3c

I.4

3 3

2

63

6

2

Page 3: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Exercise’s goals

1. Draw a PERT network (AON) representing a project’s characteristics

2. Compute earliest/latest time of start (tmin/tmax) and earliest/latest time of finish (tmin_c/tmax_c) for each activity

3. Compute Critical Path(s)

4. Draw the Gantt diagram for the project

3

Page 4: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Project’s characteristics• A project has 10 activities, they are referred to by the letters A, B, ..., L

• Between such activities the following dependencies hold:

– A, L < C (C cannot start before A and L are complete)

– C < B

– B, E, H < D

– D, G, I < F

– L < G• Each activity is estimated to last t(X), that we consider fixed for the sake of simplicity.

• Time unit of measure is week

• Duration of activities is as follows

A B C D E F G H I L

6 8 1 2 8 13 13 21 39 2

4

Page 5: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 1: draw the PERT network

1. Nodes:

a) An activity is represented by a node

b) There are two special nodes: s and t, meaning start and end of

the project, respectively (source, target)

2. Arcs:

a) A precedence relationship is represented by a directed arc

b) There is an arc from node s to every starting node (identified at

point 1)

c) There is an arc from every dead-end node (identified at point 1)

to node t

5

Page 6: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 1: draw the PERT network

3. Labels:

a) Each node X is labeled with its duration t(X)

b) Nodes s and t are labeled with 0 (their duration is

conventionally 0)

6

Page 7: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 1: draw the PERT network

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

82

13

130

A,L<C

7

Page 8: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: min and max times -- Definitions

• Minimum time for starting activity A (tmin(A) ):

minimum time within is possible to finish all needed activities to

start A

• Minimum time for finishing the project:

tmin (t)

• Maximum time for starting activity A (tmax(A) ):

maximum time within it is mandatory to finish all needed

activities to start A in order to not delay the whole project

8

Page 9: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmin

Algorithm for computing tmin

Pre-condition: acyclic network

tmin(s) = 0;

1. Take a node Y such that tmin(Zi) have been

computed, with Zi predecessors of Y

2. tmin(Y) = max [tmin(Zi) + t(Zi)];

// t(Zi) is duration of Z

3. if Y != t go to step 2;

4. end

9

Page 10: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmin

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0

0

0

0

0

Z = set of predecessors of Y

tmin(Y) = max [tmin(Zi) + t(Zi)]

10

Page 11: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmin

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0

0

0

2

6

0

0

Z = set of predecessors of Y

tmin(Y) = max [tmin(Zi) + t(Zi)]

11

Page 12: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmin

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0

0

0

2

6

7

0

0

Z = set of predecessors of Y

tmin(Y) = max [tmin(Zi) + t(Zi)]

12

Page 13: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmin

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0

0

0

2

6

0

0

Z = set of predecessors of Y

tmin(Y) = max [tmin(Zi) + t(Zi)]

13

217

Page 14: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmin

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0

0

0

2

6

7

39

21

0

0

Z = set of predecessors of Y

tmin(Y) = max [tmin(Zi) + t(Zi)]

14

Page 15: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmin

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0

0

0

2

6

7

39

21

520

0

Z = set of predecessors of Y

tmin(Y) = max [tmin(Zi) + t(Zi)]

15

Page 16: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

Algorithm for computing tmax

Pre-condition: acyclic network

1. tmax(t) = tmin(t);

2. Take a node Y such that all tmax(Zi) have been

computed, with Z successors of Y

3. tmax(Y) = min[tmax(Zi)] – t(Y);

// t(Y) is duration of Y

4. if Y != s go to step 2;

5. end

16

Page 17: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

24

22

16

29

0

26

28

29

39

37

52..52

0

0..0

Z = set of successors of Y

tmax(Y) = min [tmax(Z)] - t(Y)

17

Page 18: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

24

22

16

29

0

26

28

29

39..39

37

52..52

0

0..0

Z = set of successors of Y

tmax(Y) = min [tmax(Z)] - t(Y)

18

Page 19: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0

0

0..0

2..26

6

7

39..39

21..37

52..52

0

0..0

Z = set of successors of Y

tmax(Y) = min [tmax(Z)] - t(Y)

19

Page 20: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0..16

0..29

0..0

2..26

6

7..29

39..39

21..37

52..52

0

0..0

Z = set of successors of Y

tmax(Y) = min [tmax(Z)] - t(Y)

20

Page 21: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0

0

0..16

0..29

0..0

2..26

6..28

7..29

39..39

21..37

52..52

0

0..0

Z = set of successors of Y

tmax(Y) = min [tmax(Z)] - t(Y)

21

Page 22: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0..24

0..22

0..16

0..29

0..0

2..26

6..28

7..29

39..39

21..37

52..52

0

0..0

Z = set of successors of Y

tmax(Y) = min [tmax(Z)] - t(Y)

22

Page 23: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 2: Computing tmax

s

L

t

A

H

I

C

E

B

F

D

G

0

2

6

21

8

39

1

8

2

13

13

0..24

0..22

0..16

0..29

0..0

2..26

6..28

7..29

39..39

21..37

52..52

0

0..0

Z = set of successors of Y

tmax(Y) = min [tmax(Z)] - t(Y)

23

Page 24: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 3: Critical path -- Definitions

• Critical activity: activity A such that tmin(A) = tmax(A)

• Critical path: s-t path compound of all critical activities

• Minimum time for completing activity A:

tmin_c(A) = tmin(A) + t(A)

• Maximum time for completing activity A:

tmax_c(A) = tmax(A) + t(A)

24

Page 25: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 3: Critical Path

Activity A B C D E F G H I L

Duration 6 8 1 2 8 13 13 21 39 2

tmin 0 7 6 21 0 39 2 0 0 0

tmax 22 29 28 37 29 39 26 16 0 24

tmin_c 6 15 7 23 8 52 15 21 39 2

tmax_c 28 37 29 39 37 52 39 37 39 26

• I and F are critical activities

• s-I-F-t is the unique critical path25

Page 26: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 4: Gantt Chart

Note: we can delay some activity e.g. C and E, that are not in a critical path

x

26

Page 27: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Comments

• From a PERT network you can always draw a Gantt Chart

– By starting all activities at their tmin, or

– By starting activities consistently with their tmin and tmax (consistently means between tmin and tmax)

• From the same PERT network I can derive severalGantt Charts

– I cannot deduce a PERT network from a Gantt Chart

27

Page 28: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Additional issues

• Duration of activities is a statistical variable

• Some resources can be unavailable in certain time period

28

Page 29: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Availability Constraints

Example: it is not possible to perform activities C and E in parallel

Possible solution: E is delayed and, consequently D

E is delayed so

it’s not in parallel

with C

As a

consequence D

is delayed

29

Page 30: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Availability Constraints

We have to verify that Gantt changes did not violate

any PERT precedence

Note: several commercial tools allow for checking

PERT and Gantt consistency

30

Page 31: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Exercise

• A simple software project has the following activities

• Requirement analysis, implies customer interview (A) and a questionnaire to be filled by old customers (B)

• Preparation of the questionnaire (C)

• Requirement analysis and conceptual design (D)

• Coding in Java (E)

• Test (F)

• The project starts at 01/01/2018.

• The team that will perform the test won’t be available during July 2018 because involved in another project

• Durations of activities (in months) are as follows

A B C D E F

1 1 1 1 2 331

Page 32: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Exercise’s goals

1. Draw a PERT network (AON) representing project’s characteristics

2. Compute earliest/latest time of start (tmin/tmax) for each activity

3. Compute Critical Path(s)

4. Draw the Gantt diagram for the project

5. Verify consistency between the PERT network, the Gantt Chart, and constraints. If needed, change the Gantt chart

32

Page 33: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Analysis

• From the description of the activities, it can be deduced that the process model applied is the waterfall model

• Requirement analysis activities can be conducted in parallel

• The other activities have to be performed in sequence as defined by the waterfall

33

Page 34: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 1: Draw the PERT network

s t

C

A

BD

F

E

01

1

1

1

2

3

0

C<B

B<D

A<D

D<E

E<F

A customer interview

B customer questionnaire

C questionnaire preparation

D req. analysis and conc. design

E coding

F test 34

Page 35: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

s t

C

A

BD

F

E

01

1

11

2

3

0

0..0

0..1

1..12..2 3..3

5..5

8..8

Goal 2: compute tmin and tmax

35

Page 36: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Activity A B C D E F

Duration 1 1 1 1 2 3

tmin 0 1 0 2 3 5

tmax 1 1 0 2 3 5

tmin_c 1 2 1 3 5 8

tmax_c 2 2 1 3 5 8

• B, C, D, E and F are critical activities

• s-C-B-D-E-F-t is the only CP

Goal 3: Critical Path

36

Page 37: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 4: Gantt Chart

Jan Feb Mar Apr May Jun Jul Aug

A X

B X

C X

D X

E X X

F X X X

We delay

activity A

37

Page 38: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

Goal 5: Consistency

• The Gantt chart is not considering the unavailability of the testing team

• By modifying the Gantt Chart based on tmin/tmax we cannot comply to such constraint

• We have to suspend activity F (Test) in July, meaning that it will finish in September

38

Page 39: Software Engineering Pert and Gantt exercises Lecturer ... · 1. Draw a PERT network (AON) representing project’s characteristics 2. Compute earliest/latest time of start (tmin/tmax)

GEN FEB MAR APR MAG GIU LUG AGO SET

A X

B X

C X

D X

E X X

F X X X

Goal 5: Change the Gantt

39