November 05, 2008

Cyclomatic Complexity

Contoh Kasus Perhitungan Cyclomatic Complexity

Program Pemangkatan Dengan Fungsi


Source Code :


Flow Graph Notation :


Cyclomatic Complexity :

1). Region

2). Predicate Node

3). McCabe

Result :

1). Number of Region : R1,R2,R3

Cylomatic Complexity = 3

2). Predicate Node :

Cylomatic Complexity = predicate_node + 1

Predicate_node = …..(1) & …..(2)

Cylomatic Complexity = 2 + 1 = 3


3) McCabe

V(G) = E – N + 2

· Edge = 11

· Node = 10

V(G) = 11 – 10 + 2

V(G) = 3





Oleh : Mohammad Irfan Rahardian (22064117)


Tidak ada komentar: