15.07.2013 Views

jgrasp handbook

jgrasp handbook

jgrasp handbook

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DRAFT, February 18, 2003, Page 7<br />

Complexity Profile Graph (CPG). The CPG is a statement-level complexity metric intended to provide<br />

a measure of source code comprehensibility [Cross et al. 1997, McQuiad et al. 1997]. Figure 7 shows the<br />

CPG for the Java class ArrayTest3 from Figure 1 above. The source code is divided into chunks or<br />

segments roughly corresponding to program statements. Each segment is assigned a complexity that is<br />

a weighted sum of individual metrics for reachability, content, breadth, and inherent complexity, and then<br />

represented as a bar in the graph. The CPG is currently generated for Ada and Java source code. The<br />

premise is that the peaks in the CPG indicate the area that may be most difficult to comprehend and, as a<br />

result, may be the most likely place to find errors in the code. These peak sections should be<br />

reviewed/tested more carefully, or the code should be rewritten to reduce the complexity.<br />

Figure 7. Complexity Profile Graph

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!