0% found this document useful (0 votes)
38 views4 pages

Contoh Whitebox

The document describes white box testing of a program using flowcharts, flowgraphs, cyclomatic complexity, and predicate nodes. It provides the flowchart and flowgraph of the program which has 4 regions. The cyclomatic complexity is calculated to be 4 based on the number of edges and nodes. There are also 3 independent paths and the graph matrix confirms the cyclomatic complexity is 4 based on the number of predicate nodes.

Uploaded by

Ade M.S.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views4 pages

Contoh Whitebox

The document describes white box testing of a program using flowcharts, flowgraphs, cyclomatic complexity, and predicate nodes. It provides the flowchart and flowgraph of the program which has 4 regions. The cyclomatic complexity is calculated to be 4 based on the number of edges and nodes. There are also 3 independent paths and the graph matrix confirms the cyclomatic complexity is 4 based on the number of predicate nodes.

Uploaded by

Ade M.S.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Kasus yang akan diuji:

Program coba;
var a : integer;
begin
1 a := 5;
2 if a > 4 then
begin
3 while a < 10 do
begin
4 if a > 5 then
5/6 writeln(a); {dianalogikan ada endif}
7 a := a + 1;
8 end;
end
else
9/10 a := a + 10; {dianalogikan ada endif}
11 writeln;
end.

WHITE BOX TESTING


Flow chart:
START

3 9

4 10

5 11

6 FINISH

8
Flowgraph:

1,2

3,4 9

5 10
II

6 11
IV
III

Cyclomatic Complexity
V(G) = E – N + 2
= 11 – 9 + 2
=4

Jumlah Region
Jumlah region adalah 4

Independent Path
Path 1 : 1-2-3-4-5-6-7-8-10-11
Path 2 : 1-2-3-4-6-7-8-10-11
Path 3 : 1-2-9-10-11
Path 4 : 1-2-3-4-6-7-8-3-4-5-6-7-8-9-10-11
Graph Matrix

1,2 1

3,4 9 2 7

5 10 3 8

6 11 4 9

7 5

CONVERT
8 6

1 2 3 4 5 6 7 8 9
1 1 1 1
2 1 1 1
3 1 0
4 1 0
5 1 0
6 1 1 1
7 1 0
8 1 0
9 0
JUMLAH 3

V(G) = 3 + 1 = 4
Jumlah Predicate Node
Predicate Node = 1, 2, 6
V(G) = P + 1
=3+1
=4

You might also like