lecture 28 metrics
play

LECTURE 28: METRICS! CSE 442 Software Engineering Putting the E - PowerPoint PPT Presentation

LECTURE 28: METRICS! CSE 442 Software Engineering Putting the E in SE Have mostly focused on creating software Putting the E in SE Have mostly focused on creating software Team Dynamics Putting the E in SE Have mostly focused on


  1. LECTURE 28: METRICS! CSE 442 – Software Engineering

  2. Putting the E in SE ¨ Have mostly focused on creating software

  3. Putting the E in SE ¨ Have mostly focused on creating software ¤ Team Dynamics

  4. Putting the E in SE ¨ Have mostly focused on creating software ¤ Team Dynamics ¤ Management

  5. Putting the E in SE ¨ Have mostly focused on creating software ¤ Team Dynamics ¤ Management ¤ Software Lifecycle

  6. Putting the E in SE ¨ Have mostly focused on creating software ¤ Team Dynamics You want what? ¤ Management ¤ Software Lifecycle ¤ Requirements

  7. Putting the E in SE ¨ Have mostly focused on creating software ¤ Team Dynamics You want what? ¤ Management ¤ Software Lifecycle ¤ Requirements ¤ Design

  8. Putting the E in SE ¨ Have mostly focused on creating software ¤ Team Dynamics ¤ Management ¤ Software Lifecycle ¤ Requirements ¤ Design ¤ Testing

  9. Putting the E in SE ¨ Have mostly focused on creating software ¤ Team Dynamics ¤ Management ¤ Software Lifecycle ¤ Requirements ¤ Design ¤ Testing ¤ Implementation

  10. Engineering Requirements ¨ Demands attention to details, rules, precision…

  11. Engineering Requirements ¨ Demands attention to details, rules, precision… … and numbers

  12. Engineering Requirements ¨ Demands attention to details, rules, precision… … and numbers ¨ Results used to answer many types of questions: ¤ How much … ? ¤ How often … ? ¤ How many… ? ¤ Why?

  13. Metrics ¨ Provide data which drives process of engineering ¤ Allow us to make changes and evaluate results ¤ Apply scientific process to improve process & results

  14. Why We Use Metrics ¨ Stop making all our decisions using intuition

  15. Why We Use Metrics ¨ Stop making all our decisions using intuition to process relying on facts & evidence

  16. Numeric ≠ Useful ¨ Need solid basis by which number generated ¨ Number should accurately reflect reality

  17. Metric Problems There are 3 kinds of lies: 1. Lies 2. Damned Lies 3. Statistics

  18. Metric Problems ¨ Misused metrics no better than random guess ¤ Much, much worse in most situations ¤ People’s faith & trust replaced by doubt ¨ Correlation is not causation – cannot forget this

  19. Statistics Abuse ¨ Fact: People with larger shoe sizes better spellers

  20. Statistics Abuse ¨ Fact: People with larger shoe sizes better spellers

  21. Statistics Abuse ¨ Fact: People with larger shoe sizes better spellers Adults good at spelling; Also wear grown-up shoes

  22. Statistics Abuse ¨ Fact: People with larger shoe sizes better spellers Adults good at spelling; Kids bad at spelling; Also wear grown-up shoes Small feet use kids' sizes

  23. Why He Deserves a Raise I wrote more code last year than any other employee

  24. And The Boss Replies…

  25. And The Boss Replies… Measuring programming progress by lines of code is like measuring aircraft building progress by weight

  26. Lines Of Code ¨ Of these lines, which each equal to 1 LoC? /* Some of these lines are really ugly */ int countMatches(E[] arr, E ignore) { int sum = (2 * 4) – (int)Math.sqrt(64); for (int i = 0; i < arr.length; i++) { E val = arr[i]; if (val.equals(ignore)) ; else { sum++; } } return sum; }

  27. What Are You Measuring?

  28. What Are You Measuring? ¨ Are you sure?

  29. Good Metric Example ¨ Cyclomatic complexity quick & easy to measure ¤ Equal to number of simple decisions + 1 ¤ || and && count also simple decisions 1 ¨ Complexity is 4 for this example ¤ Written as V(G) = 4 2 ¨ Provides deeper insight 3 ¤ Counts different ways to screw up

  30. Good Metric Example ¨ Cyclomatic complexity quick & easy to measure ¤ Equal to number of simple decisions + 1 ¤ || and && count also simple decisions 1 ¨ Complexity is 4 for this example ¤ Written as V(G) = 4 2 ¨ Provides deeper insight 3 ¤ Counts different ways to screw up

  31. Good Metric Example ¨ Cyclomatic complexity quick & easy to measure ¤ Equal to number of simple decisions + 1 ¤ || and && count also simple decisions 1 ¨ Complexity is 4 for this example ¤ Written as V(G) = 4 2 ¨ Provides deeper insight 3 ¤ Counts different ways to screw up

  32. Good Metric Example ¨ Cyclomatic complexity quick & easy to measure ¤ Equal to number of simple decisions + 1 ¤ || and && count also simple decisions 1 ¨ Complexity is 4 for this example ¤ Written as V(G) = 4 2 ¨ Provides deeper insight 3 ¤ Counts different ways to screw up

  33. What Makes it Good? ¨ Studies found V(G) correlated to error probability ¤ Opportunities for bugs much, much larger ¨ Inside complex methods find far more errors 20% of modules, but … # of 80% of bugs Modules V(G)

  34. Is It Enough? ¨ Probability of bugs jumps once V(G) gets too large ¤ Often suggest rewrite methods w/ complexity > 7 ¤ V(G) > 9 demand rewrite or split into pieces ¨ Possible strategy: test complex methods only?

  35. Ego Check ¨ Who is the best programmer in the class?

  36. Ego Check ¨ Who is the best programmer in the class? ¤ How can you prove it?

  37. Real-World Questions ¨ Have 11 employees; but can only promote 3

  38. Real-World Questions ¨ Have 11 employees; but can only promote 3 ¤ Whom do you promote?

  39. Real-World Questions ¨ Have 11 employees; but can only promote 3 ¤ Whom do you promote? ¤ How will you explain your choice in court?

  40. Real-World Questions ¨ Changed the application lifecycle used

  41. Real-World Questions ¨ Changed the application lifecycle used ¤ 1 st project sucked: client was an

  42. Real-World Questions ¨ Changed the application lifecycle used ¤ 1 st project sucked: client was an ¤ How do you justify your decision to your boss?

  43. Singular of Data: Anecdote ¨ Single project cannot provide usable metrics ¤ Too many variables: must isolate cause-and-effect ¨ Results should converge given enough data ¤ If no convergence, results may be random ¤ May take time before convergence occurs

  44. Singular of Data: Anecdote ¨ Important to track metrics for large data set ¤ Many coders on single project ¤ Track group over long period of time ¨ Be careful evaluating metrics ¤ Limit evaluation to trends ¤ Smooth results by using moving averages

  45. Measurement Principles ¨ Define objectives first, collect data second ¤ Will always find patterns in data ¤ Simple coincidences should not be relied upon

  46. Measurement Principles ¨ Select metrics using theory valid for domain ¤ Analyze designs with design concepts not coding ¤ Verify positive results would be found

  47. Measurement Principles ¨ Tailor uses & analysis to answer your question ¤ If metric serves no purpose, do not collect that data ¤ Generate results you care about & not any others ¤ Check & double-check this does not bias results

  48. Once Analysis Is Complete ¨ Interpretation ¤ Look for insights about process ¤ Check how well/if metric represents the results ¤ Secondary effects of the process should be evaluated ¨ Answer the question: What do these results mean?

  49. Once Analysis Is Complete ¨ Interpretation ¤ Look for insights about process ¤ Check how well/if metric represents the results ¤ Secondary effects of the process should be evaluated ¨ Answer the question: What do these results mean?

  50. Most Important Step ¨ Feedback ¤ Recommend changes based upon the results ¤ Clarify confusing results by proposing additional experiments ¤ Verify work as good as possible and collect the big money

  51. Most Important Step ¨ Feedback ¤ Recommend changes based upon the results ¤ Clarify confusing results by proposing additional experiments ¤ Verify work as good as possible and collect the big money

  52. Most Important Step ¨ Feedback ¤ Recommend changes based upon the results ¤ Clarify confusing results by proposing additional experiments ¤ Verify work as good as possible and collect the big money

  53. How Much To Collect? X

  54. Class-Oriented Metrics ¨ Size of each class ¨ Average method size ¨ Method complexity ¨ Weighted methods per class ¨ Average number of parameters per method

  55. Class-Oriented Metrics ¨ Number of subclasses ¨ Depth of the inheritance tree ¨ Number of overridden operations ¨ Number of added operations in subclass ¨ Specialization index

Recommend


More recommend