cs428-02 - 1 Technical Metrics for OO Systems 428-1 2...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Technical Metrics for OO Systems 428-1 2 Complexity • Complex systems are – hard to understand – hard to change – hard to reuse Cyclomatic complexity Cohesion and coupling “Software science” 428-1 3 Cyclomatic Complexity • A measure of logical complexity • Tells how many tests are needed to execute every statement of program • Number of branches (if, while, for) + 1 428-1 4 Cyclomatic Complexity def processInterest() : for acc in account_list : if hasInterest(acc) : acc.balance = acc.balance + acc.balance * acc.interest 428-1 5 Cyclomatic Complexity def addInterest for if acc.balance = ... done 428-1 6 Cyclomatic complexity • Number of predicates + 1 • Number of edges - number of nodes + 2 • Number of regions of the flow graph 428-1 7 Testing view • Cyclomatic complexity is the number of independent paths through the procedure • Gives an upper bound on the number of tests necessary to execute every edge of control graph 428-1 8 Metrics view • McCabe found that modules with a cyclomatic complexity greater than 10 were hard to test and error prone. • Look for procedures with high cyclomatic complexity and rewrite them, focus testing on them, or focus reviewing on them. 428-1 9 Coupling and cohesion • Number and complexity of shared variables – Functions in a module should share variables – Functions in different modules should not • Number and complexity of parameters • Number of functions/modules that are called • Number of functions/modules that call me 428-1...
View Full Document

This note was uploaded on 06/14/2009 for the course CS 427 taught by Professor Jones during the Fall '07 term at University of Illinois at Urbana–Champaign.

Page1 / 33

cs428-02 - 1 Technical Metrics for OO Systems 428-1 2...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online