CSC 395 – Software Engineering Lecture 32: Even More Metrics -or- More Ways To View A Project
Jan 02, 2016
CSC 395 –Software Engineering
Lecture 32:
Even More Metrics -or-More Ways To View A Project
In This Lecture
Examine metrics and why important Review metrics from last lecture Evaluate which ones are most used and why
Theorize proper use of these metrics More touchy-feely manager issues Conventional wisdom on middle management
does not examine life as non-management Example of real metric collection and analysis
Midterm Part 2 Cofee Talk
What should go in a use-case?
What starts this program? What ends it?
How should event flow states be connected?
Is software engineering worth it?
Holy Roman Empire was neither holy, nor Roman, nor an Empire
Code Monkeys
Do not want to trust code monkeys Often untrained & unskilled programmers Also includes new graduates starting their first job Internal candidate pool for engineer positions
Nobody and nothing is perfect At implementation start, design contain faults Code monkeys must find faults
Often will just fix the small ones Good monkeys will clean & optimize the ugly
design bits Managers must identify & nurture these diamonds
NASA Metrics Suite
http://satc.gsfc.nasa.gov/support/STC_APR98/apply_oo/apply_oo.html
Cyclomatic Complexity (CC) Lines of Code (LOC) Comment Percentage (CP) Weighted Methods per Class (WMC) Response For a Class (RFC) Lack of Cohesion Of Methods (LCOM) Coupling Between Objects (CBO) Inheritance Tree Depth (DIT) Number Of Children (NOC)
Objectives For Each Metric
METRIC OBJECTIVE Cyclomatic Complexity Low
Lines of Code Low
Comment Percentage ~ 20 – 30 %
Weighted Methods per Class Low
Response For a Class Low
Lack of Cohesion Of Methods Low
Coupling Between Objects Low
Inheritance Tree Depth Low (trade-off)
Number Of Children Low (trade-off)
Weighted Methods per Class
Most classes are (relatively) simple Complex classes must be tested heavily
Should be examined for potential revision
Response For a Class
Most methods have few methods called Higher values require complex & extensive testing
Also good candidates for revision
Response For a Class
Coupling is just plain bad Used by lazy, less experienced, & incompetent
Using Multiple Metrics
Combining metrics identifies problem regions
Inheritance is Mixed Bag
Higher DIT increases reuse Also makes code more complex & harder to maintain
Additional metric could show if inheritance is good
For Next Lecture
Continue looking at metrics Changing hows, whens, & whys of measurement
Will be discussing chapter 9 of the book Do your reading
Looking at how to plan and measure project Programmers universally under estimate needs Important when bidding on contracts, charging for
changes, & other business functions