lect-3-complexity-proving-adts

lect-3-complexity-proving-adts - 4/6/2011 But first from...

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

View Full Document Right Arrow Icon
4/6/2011 1 CSE503: SOFTWARE ENGINEERING COMPLEXITY, PROVING ADTS David Notkin Spring 2011 But first… from today’s Seattle Times 2011.5.4 503 11sp © UW CSE • D. Notkin 2 “Industry experts believed they knew where to look for crack-inducing metal fatigue on aging airplanes, but the in-flight rupture of a Southwest Airlines Boeing 737 on Friday has raised concerns about part of the fuselage they previously thought wasn't vulnerable. “A similar hole opened on a Southwest 737 only 21 months ago, and then on an American Airlines 757 last year, raising awareness that metal fatigue can cause the aluminum skin to separate at the so-called lap joints, where panels are spliced together .” Software complexity 503 11sp © UW CSE • D. Notkin 3 First, some common software complexity measures Then, why they are weak measures and (perhaps) a way forward From last lecture complexity in the “why is it hard?” sense Today: “how complex” is a piece of software? Lines of code (LOC, KLOC, MLOC) 503 11sp © UW CSE • D. Notkin 4 Count the lines, often omitting comments and/or omitting blank lines Lines vs. statements Delivered vs. total (including tests, etc.) Productivity: LOC/person/time I’ve seen published numbers ranging from ~2K -8K LOC/person/year Sensible? "I have made this letter longer than usual, because I lack the time to make it short.” – Blaise Pascal
Background image of page 1

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

View Full DocumentRight Arrow Icon
4/6/2011 2 Halstead software science metrics 503 11sp © UW CSE • D. Notkin 5 V = N log 2 (n) Volume is intended to capture the size of the implementation Making N choices from the vocabulary assuming that humans do logarithmic search leads to the formula “The volume of a function should be at least 20 and at most 1000. The volume of a parameterless one-line function that is not empty; is about 20. A volume greater than 1000 tells that the function probably does too many things.” [verifysoft.com] D = ( n1 / 2 ) ( N2 / n2 ) Difficulty is proportional to the unique operators and the ratio of total operands to the number of operands The intent of the second part is based on a belief that repeated use of operands is more error-prone E = V D Effort to implement or understand a program ... n1 = #distinct operators n2 = #distinct operands n = n1 + n2 “vocabulary” N1 = total # of operators N2 = total # of operands N = N1 + N2 “length” Cyclomatic complexity (McCabe) 503 11sp © UW CSE • D. Notkin 6 Take the CFG and find the number of edges ( E ), number of nodes ( N ), and the number of connected components ( P ) Connected components are subgraphs for which there is a path between any two vertices The cyclomatic complexity is M = E N + 2P and is intended to measure the number of linearly independent paths through a program’s source code #tests (branch coverage) M #tests (path coverage) Question: should the complexity include method dispatch in OOP? Examples
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/24/2012 for the course CSE 503 taught by Professor Davidnotikin during the Spring '11 term at University of Washington.

Page1 / 9

lect-3-complexity-proving-adts - 4/6/2011 But first from...

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

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