Document

advertisement
Software Engineering
Pert and Gantt exercises
Lecturer: Giuseppe Santucci
1
Degree of freedom!
2
I.3a
3
3
3
6
I.1
I.2
I.3b
I.4
6
I.3c
2
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
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
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
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
Goal 1: draw the PERT network
13
G
2
L
C
6
A
1
8
B
0
s
21
H
8
E
2
D
t
13
F
0
A,L<C
39
I
7
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
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
Goal 2: Computing tmin
0
L
A
0
0
s
H
0
2
C
6
13
1
B
8
D
2
21
t
F
0
E
G
13
0
8
0
I
0
39
Z = set of predecessors of Y
tmin(Y) = max [tmin(Zi) + t(Zi)]
10
Goal 2: Computing tmin
0
L
A
0
0
s
H
0
2
2
C
6
6
13
1
B
8
D
2
21
t
F
0
E
G
13
0
8
0
I
0
39
Z = set of predecessors of Y
tmin(Y) = max [tmin(Zi) + t(Zi)]
11
Goal 2: Computing tmin
0
L
A
0
0
s
H
0
2
2
C
6
6
13
1
7
B
8
D
2
21
t
F
0
E
G
13
0
8
0
I
0
39
Z = set of predecessors of Y
tmin(Y) = max [tmin(Zi) + t(Zi)]
12
Goal 2: Computing tmin
0
L
A
0
0
s
H
0
2
2
C
6
6
13
1
7
B
21
8
D
2
21
t
F
0
E
G
13
0
8
0
I
0
39
Z = set of predecessors of Y
tmin(Y) = max [tmin(Zi) + t(Zi)]
13
Goal 2: Computing tmin
0
L
A
0
0
s
H
0
2
2
C
6
6
13
1
7
B
21
8
D
2
21
t
F
0
E
G
8
13
0
39
0
I
0
39
Z = set of predecessors of Y
tmin(Y) = max [tmin(Zi) + t(Zi)]
14
Goal 2: Computing tmin
0
L
A
0
0
s
H
0
2
2
C
6
6
13
1
7
B
21
8
D
52
2
21
t
F
0
E
G
8
13
0
39
0
I
0
39
Z = set of predecessors of Y
tmin(Y) = max [tmin(Zi) + t(Zi)]
15
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
Goal 2: Computing tmax
24
L
A
0..0
26
2
H
28
E
1
29
B
13
37
8
D
52..52
2
21
t
F
16
0
C
6
22
s
G
8
13
0
39
29
39
I
0
Z = set of successors of Y
tmax(Y) = min [tmax(Z)] - t(Y)
17
Goal 2: Computing tmax
24
L
A
0..0
26
2
H
28
E
1
29
B
13
37
8
D
52..52
2
21
t
F
16
0
C
6
22
s
G
8
13
0
39..39
29
39
I
0
Z = set of successors of Y
tmax(Y) = min [tmax(Z)] - t(Y)
18
Goal 2: Computing tmax
0
L
A
0..0
0
s
H
2..26
2
E
C
6
6
1
7
B
13
21..37
8
D
52..52
2
21
t
F
0
0
G
8
13
0
39..39
0
39
I
0..0
Z = set of successors of Y
tmax(Y) = min [tmax(Z)] - t(Y)
19
Goal 2: Computing tmax
0
L
A
0..0
0
s
H
2..26
2
E
C
6
6
1
7..29
B
8
13
21..37
D
52..52
2
21
0..16
0
G
8
t
F
13
0
39..39
0..29
39
I
0..0
Z = set of successors of Y
tmax(Y) = min [tmax(Z)] - t(Y)
20
Goal 2: Computing tmax
0
L
A
0..0
0
s
H
2..26
2
6
E
C
6..28
1
7..29
B
8
13
21..37
D
52..52
2
21
0..16
0
G
8
t
F
13
0
39..39
0..29
39
I
0..0
Z = set of successors of Y
tmax(Y) = min [tmax(Z)] - t(Y)
21
Goal 2: Computing tmax
0..24
L
A
0..0
2
6
0..22
s
H
E
G
C
6..28
1
7..29
B
8
13
21..37
D
52..52
2
21
0..16
0
2..26
8
t
F
13
0
39..39
0..29
39
I
0..0
Z = set of successors of Y
tmax(Y) = min [tmax(Z)] - t(Y)
22
Goal 2: Computing tmax
0..24
L
A
0..0
2
6
0..22
s
H
E
G
C
6..28
1
7..29
B
8
13
21..37
D
52..52
2
21
0..16
0
2..26
8
t
F
13
0
39..39
0..29
39
I
0..0
Z = set of successors of Y
tmax(Y) = min [tmax(Z)] - t(Y)
23
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
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 path
25
Goal 4: Gantt Chart
Note: we can delay some activity e.g. C and E, that are not in a critical path
x
26
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 several
Gantt Charts
– I cannot deduce a PERT network from a Gantt Chart
27
Additional issues
• Duration of activities is a statistical variable
• Some resources can be unavailable in certain time
period
28
E is delayed so
it’s not in parallel
with C
Availability Constraints
As a
consequence D
is delayed
Example: it is not possible to perform activities C and E in parallel
Possible solution: E is delayed and, consequently D
29
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
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
3
31
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
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
Goal 1: Draw the PERT network
C
B
1
0
s
1
D 1
E
2
t
1
A
A customer interview
B customer questionnaire
C questionnaire preparation
D req. analysis and conc. design
E coding
F test
0
F
C<B
B<D
A<D
D<E
E<F
3
34
Goal 2: compute tmin and tmax
0..0
1..1
C
B
1
0
s
1
A
0..1
1
2..2
D 1
3..3
E
2
5..5
8..8
0
t
F
3
35
Goal 3: Critical Path
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
36
Goal 4: Gantt Chart
Jan
We delay
activity A
Feb
A
X
B
X
C
D
E
F
Mar
Apr
May
X
X
Jun
Jul
Aug
X
X
X
X
X
37
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
Goal 5: Change the Gantt
GEN
FEB
A
X
B
X
C
D
E
F
MAR
APR
MAG
X
X
GIU
LUG
AGO
SET
X
X
X
X
X
39
Download