measuring software: from data to actionable knowledge
TRANSCRIPT
![Page 1: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/1.jpg)
Measuring Software: From Data to Actionable Knowledge
16 May 2015
International Workshop on Software Architecture and Metrics
Radu Marinescu [email protected]
@radu_marinescu
![Page 2: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/2.jpg)
![Page 3: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/3.jpg)
Logo- culori
Culoare pentru o institu]ie unic\ - clar\, curat\, u[or de recunoscut - culoarea este elementul cel mai u[or de recunoscut, albastru indigo reflect\ personalitatea institu]iei de <nv\]\m>nt superior tehnic - ferm, puternic, dar introspectiv, valorizator. Este o combina]ie de albastru [i ro[u, <n care dominant este albastrul cu atributele sale introspective. Griul neutru pune <n valoare albastrul, accentu>nd valorile sale.
![Page 4: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/4.jpg)
Logo- culori
Culoare pentru o institu]ie unic\ - clar\, curat\, u[or de recunoscut - culoarea este elementul cel mai u[or de recunoscut, albastru indigo reflect\ personalitatea institu]iei de <nv\]\m>nt superior tehnic - ferm, puternic, dar introspectiv, valorizator. Este o combina]ie de albastru [i ro[u, <n care dominant este albastrul cu atributele sale introspective. Griul neutru pune <n valoare albastrul, accentu>nd valorile sale.
![Page 5: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/5.jpg)
Logo- culori
Culoare pentru o institu]ie unic\ - clar\, curat\, u[or de recunoscut - culoarea este elementul cel mai u[or de recunoscut, albastru indigo reflect\ personalitatea institu]iei de <nv\]\m>nt superior tehnic - ferm, puternic, dar introspectiv, valorizator. Este o combina]ie de albastru [i ro[u, <n care dominant este albastrul cu atributele sale introspective. Griul neutru pune <n valoare albastrul, accentu>nd valorile sale.
![Page 6: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/6.jpg)
Logo- culori
Culoare pentru o institu]ie unic\ - clar\, curat\, u[or de recunoscut - culoarea este elementul cel mai u[or de recunoscut, albastru indigo reflect\ personalitatea institu]iei de <nv\]\m>nt superior tehnic - ferm, puternic, dar introspectiv, valorizator. Este o combina]ie de albastru [i ro[u, <n care dominant este albastrul cu atributele sale introspective. Griul neutru pune <n valoare albastrul, accentu>nd valorile sale.
![Page 7: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/7.jpg)
Michele LanzaRadu Marinescu
Object-Oriented Metrics
in PracticeUsing Software Metrics to
Characterize, Evaluate, and Improve the Design of Object-Oriented Systems
Foreword by Stéphane Ducasse
Lanza · Marinescu
Object-O
riented M
etrics in Practice
Michele Lanza is an Assistant Professor at the University of Lugano, Switzer-land. His main research interests lie in software (re)engineering and software evo-lution with a special focus on software visualization and metrics. He is the creatorof CodeCrawler, a freely available language-independent software visualizationtool. His Ph.D. work won the Ernst Denert Software Engineering Award in 2003.Radu Marinescu is an Assistant Professor at the Politehnica University ofTimisoara, Romania. His research focus is on object-oriented design, reenginee-ring and quality assurance. He is the author of a suite of novel object-orientedmetrics and the main creator of iPlasma, an integrated and freely available tool-kit for Java and C++ projects. Several of his published research ideas have alreadybeen applied in the well-known “Borland Together Control Center” CASE tool.
783540 2442959
ISBN 3-540-24429-8
› springer.com
Object-Oriented Metrics inPracticeMetrics are paramount in every engineering discipline. However, due to its lackof rigor and its intrinsic complexity, software engineering is not considered aclassical engineering activity. Moreover, defining, understanding and applyingsoftware metrics often looks like an overly complex activity, recommended onlyto ‘trained professionals’. In general, if a software system is delivering theexpected functionality, only few people – if any – care about measuring the qua-lity of its internal structure. Consequently, software metrics are still regardedrather circumspectly by most software developers.
Lanza and Marinescu demystify the design metrics used to assess the size,quality and complexity of object-oriented software systems. Based on a novelapproach, backed by generally accepted semantics for metrics and by statisticalinformation from many industrial projects, they deduce a suite of metrics-basedpatterns for assessing the design of object-oriented software systems. Theyshow in detail how to identify design disharmonies in code, and how to deviseand apply remedies.
The combination of theoretically sound results and practically tested procedu-res and solution paths makes this book an ideal companion for professionalsoftware architects, developers and quality engineers. The pattern-oriented des-cription of disharmonies offers easy access to detecting shortcomings andapplying solutions to real problems.
Features and Benefits:
* comprehensive list of object-oriented disharmony patterns
* many reengineering strategies for poorly structured code
* brief introduction to software visualization
‘’This well-written book is an impor-tant piece of work that takes theseemingly forgotten art of object-oriented metrics to the next level interms of relevance and usefulness.’Richard C. Gronback,Chief Scientist, Borland SoftwareCorporation
13
1
1000+ reprinted 2010/2015
MIP ICSME’14
![Page 8: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/8.jpg)
inFusion
![Page 9: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/9.jpg)
inFusion
![Page 10: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/10.jpg)
inFusion
![Page 11: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/11.jpg)
inFusion
![Page 12: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/12.jpg)
seentoo much…
I have
![Page 13: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/13.jpg)
time & money wasted on…
![Page 14: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/14.jpg)
“hide & seek” bug chasing
![Page 15: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/15.jpg)
playing futile numbers games
![Page 16: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/16.jpg)
code being thrown away
![Page 17: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/17.jpg)
but also…
![Page 18: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/18.jpg)
myriads of useless papers
![Page 19: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/19.jpg)
tens of “mayfly” prototypes
![Page 20: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/20.jpg)
a true story…
![Page 21: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/21.jpg)
![Page 22: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/22.jpg)
180.9
(12 subsystems)
(17 methods)
(3 subsystems)
NOW6 months ago
(1 class)
(22
(10 methods)
(32 classes)
(16 classes)
(28 classes)
(120 methods)
![Page 23: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/23.jpg)
![Page 24: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/24.jpg)
180.9
(12 subsystems)
(17 methods)
(3 subsystems)
NOW6 months ago
(1 class)
(22
(10 methods)
(32 classes)
(16 classes)
(28 classes)
(120 methods)
![Page 25: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/25.jpg)
180.9
(12 subsystems)
(17 methods)
(3 subsystems)
NOW6 months ago
(1 class)
(22
(10 methods)
(32 classes)
(16 classes)
(28 classes)
(120 methods)
![Page 26: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/26.jpg)
180.9
(12 subsystems)
(17 methods)
(3 subsystems)
NOW6 months ago
(1 class)
(22
(10 methods)
(32 classes)
(16 classes)
(28 classes)
(120 methods)
![Page 27: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/27.jpg)
CYCLOMATIC COMPLEXITY
![Page 28: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/28.jpg)
!This is not an isolated story
![Page 29: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/29.jpg)
![Page 30: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/30.jpg)
use of metrics(and other code analyses) in
![Page 31: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/31.jpg)
use of metrics(and other code analyses) in
misuse
![Page 35: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/35.jpg)
12 Person-Years
1 issues / 8 LOC1 “key” issue / 140 LOChttp://nemo.sonarqube.org/
![Page 36: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/36.jpg)
12 Person-Years
1 issues / 8 LOC1 “key” issue / 140 LOC
OMG! How is an “E”?!
http://nemo.sonarqube.org/
![Page 37: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/37.jpg)
Picture from http://www.savvykidsofarkansas.com/event/the-boy-who-cried-wolf/
![Page 39: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/39.jpg)
The most efficient 7 weeks in the history of software development…
http://nemo.sonarqube.org/
![Page 40: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/40.jpg)
The most efficient 7 weeks in the history of software development…
http://nemo.sonarqube.org/
![Page 41: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/41.jpg)
The most efficient 7 weeks in the history of software development…
16.5 Person-Years of Technical Debt vanished!http://nemo.sonarqube.org/
![Page 42: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/42.jpg)
The most efficient 7 weeks in the history of software development…
16.5 Person-Years of Technical Debt vanished!http://nemo.sonarqube.org/
![Page 43: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/43.jpg)
![Page 44: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/44.jpg)
Let’s zoom-in…
![Page 56: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/56.jpg)
reducing CYCLO takes only 1 min / branch ?
reducing CYCLO for class is easier (137’) than for methods (285’)
http://nemo.sonarqube.org/
![Page 60: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/60.jpg)
never knew it’s so easy to change a signature!
http://nemo.sonarqube.org/
![Page 61: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/61.jpg)
but what if…
![Page 62: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/62.jpg)
but what if…
![Page 64: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/64.jpg)
solving duplication does only depend on the number of blocks?
http://nemo.sonarqube.org/
![Page 65: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/65.jpg)
…are these 2 cases equally easy?
![Page 66: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/66.jpg)
…
![Page 68: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/68.jpg)
Let’s summarize…
![Page 69: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/69.jpg)
![Page 70: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/70.jpg)
1 Irrelevant Warnings
![Page 71: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/71.jpg)
1 Irrelevant Warnings
2 Misleading Debt Quantification
![Page 72: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/72.jpg)
1 Irrelevant Warnings
2 Misleading Debt Quantification
3 Toxic/Stupid Refactoring Advices
![Page 73: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/73.jpg)
1 Irrelevant Warnings
2 Misleading Debt Quantification
3 Toxic/Stupid Refactoring Advices
4 Phony Thresholds
![Page 74: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/74.jpg)
Why ?
![Page 75: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/75.jpg)
Technical Debt
![Page 76: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/76.jpg)
The first scary things was bugs
![Page 77: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/77.jpg)
http://www.google.com/imgres?imgurl=http://micheltriana.com/wp-content/uploads/2010/12/
resharper-8x6.png&imgrefurl=http://micheltriana.com/2010/12/01/configuring-resharper-code-analysis/
&h=459&w=640&tbnid=MFJydOmaXXj3xM:&zoom=1&docid=e0dqbvDRdbGVSM&ei=xOEcVaXfOsiWaoa6gJAI&tbm=isch&client
=safari&ved=0CBwQMygAMAA
![Page 78: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/78.jpg)
http://www.google.com/imgres?imgurl=http://micheltriana.com/wp-content/uploads/2010/12/
resharper-8x6.png&imgrefurl=http://micheltriana.com/2010/12/01/configuring-resharper-code-analysis/
&h=459&w=640&tbnid=MFJydOmaXXj3xM:&zoom=1&docid=e0dqbvDRdbGVSM&ei=xOEcVaXfOsiWaoa6gJAI&tbm=isch&client
=safari&ved=0CBwQMygAMAA
![Page 79: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/79.jpg)
![Page 80: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/80.jpg)
![Page 81: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/81.jpg)
![Page 82: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/82.jpg)
![Page 83: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/83.jpg)
but then we realised…
![Page 84: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/84.jpg)
Most maintenance effort goes into
understanding messy code
47%
19%
6%
28%
Testing DocumentingCoding Understanding
M. Ben-Menachem and G. S. Marliss. Software quality: Producing practical, consistent software. International Thomson Computer Press, 1997
![Page 85: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/85.jpg)
Bugserror-prone
![Page 86: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/86.jpg)
Bugs
Timehard to maintain
error-prone
![Page 87: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/87.jpg)
… and bugs also usually hide in
messy code
![Page 88: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/88.jpg)
Checkstyle
![Page 89: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/89.jpg)
!We missed
an essential distinction
![Page 90: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/90.jpg)
=
![Page 91: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/91.jpg)
Strategic Flaws
Tactical Flaws
Execution Flaws
…system
…statements
…classes and functions
How do I design the…
![Page 92: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/92.jpg)
Execution flaws Tactical flaws
![Page 93: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/93.jpg)
Execution flaws Tactical flaws
![Page 94: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/94.jpg)
Execution flaws Tactical flaws
![Page 95: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/95.jpg)
Execution flaws Tactical flaws
![Page 96: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/96.jpg)
Execution flaws Tactical flaws
![Page 97: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/97.jpg)
![Page 98: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/98.jpg)
![Page 99: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/99.jpg)
PSA
![Page 100: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/100.jpg)
PSA Gleason
![Page 101: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/101.jpg)
PSA Gleason
![Page 102: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/102.jpg)
PSA Gleason
![Page 103: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/103.jpg)
?what about tactical problems
![Page 104: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/104.jpg)
public class TarHeader{ /**
* The entry's name. */public StringBuffer name;/** * The entry's permission mode. */public int mode;/** * The entry's user id. */public int userId;/** * The entry's group id. */public int groupId;
}
![Page 105: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/105.jpg)
public/**
* The entry's name. */
/** * The entry's permission mode. */
int/** * The entry's user id. */
/** * The entry's group id. */
int
}
public
public
public
public
![Page 106: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/106.jpg)
public/**
* The entry's name. */
/** * The entry's permission mode. */
int/** * The entry's user id. */
/** * The entry's group id. */
int
}
public
public
public
publicDat
a
Class
![Page 107: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/107.jpg)
public/**
* The entry's name. */
/** * The entry's permission mode. */
/** * The entry's user id. */
/** * The entry's group id. */
int
}
![Page 108: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/108.jpg)
public/**
* The entry's name. */
/** * The entry's permission mode. */
/** * The entry's user id. */
/** * The entry's group id. */
int
}
private
private
private
private
![Page 109: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/109.jpg)
public/**
* The entry's name. */
/** * The entry's permission mode. */
/** * The entry's user id. */
/** * The entry's group id. */
int
}
private
private
private
private
Encapsulate public data (in TarHeader)1
![Page 110: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/110.jpg)
compile errors!
![Page 111: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/111.jpg)
public class {
public void parseTarHeader( TarHeader hdr, byte[] header ){int offset = 0;hdr.name = TarHeader.parseName( header, offset,
TarHeader.NAMELEN );
offset += TarHeader.NAMELEN;hdr.mode = (int)TarHeader.parseOctal( header, offset,
TarHeader.MODELEN );
offset += TarHeader.MODELEN;
hdr.userId = (int)TarHeader.parseOctal( header, offset, TarHeader.UIDLEN );
offset += TarHeader.UIDLEN;
hdr.groupId = (int)TarHeader.parseOctal( header, offset, TarHeader.GIDLEN );}
TarEntry
![Page 112: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/112.jpg)
public
public
hdr.TarHeader.
offset += TarHeader.hdr.
TarHeader.
offset += TarHeader.
hdr.TarHeader.
offset += TarHeader.
hdr.TarHeader}
TarEntry
TarHeader hdr
hdr.name
hdr.mode
hdr.userId
hdr.groupId
parseTarHeader
![Page 113: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/113.jpg)
public
public
hdr.TarHeader.
offset += TarHeader.hdr.
TarHeader.
offset += TarHeader.
hdr.TarHeader.
offset += TarHeader.
hdr.TarHeader}
TarEntry
TarHeader hdr
hdr.name
hdr.mode
hdr.userId
hdr.groupId
parseTarHeader
Move the method (TarEntry > TarHeader)1
![Page 114: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/114.jpg)
public
public
hdr.TarHeader.
offset += TarHeader.hdr.
TarHeader.
offset += TarHeader.
hdr.TarHeader.
offset += TarHeader.
hdr.TarHeader}
TarEntry
TarHeader hdr
hdr.name
hdr.mode
hdr.userId
hdr.groupId
parseTarHeader
Encapsulate public data (in TarHeader)2
Move the method (TarEntry > TarHeader)1
![Page 115: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/115.jpg)
however …
![Page 116: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/116.jpg)
public
public inthdr.
header, offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader
} public
int
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
long
offset = TarHeader.getLongOctalBytes( size, outbuf, offset, TarHeader.
}
hdr.mode = (int)TarHeader.parseOctal( header,
hdr.mode = (int)TarHeader.parseOctal( header,
offset, TarHeader.MODELEN );
offset, TarHeader.MODELEN );
offset += TarHeader.MODELEN;
offset += TarHeader.MODELEN;
hdr.userId = (int)TarHeader.parseOctal( header,
hdr.userId = (int)TarHeader.parseOctal( header, offset, TarHeader.UIDLEN );
offset, TarHeader.UIDLEN );
parseTarHeader
writeEntryHeader
![Page 117: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/117.jpg)
public
public inthdr.
header, offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader
} public
int
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
long
offset = TarHeader.getLongOctalBytes( size, outbuf, offset, TarHeader.
}
hdr.mode = (int)TarHeader.parseOctal( header,
hdr.mode = (int)TarHeader.parseOctal( header,
offset, TarHeader.MODELEN );
offset, TarHeader.MODELEN );
offset += TarHeader.MODELEN;
offset += TarHeader.MODELEN;
hdr.userId = (int)TarHeader.parseOctal( header,
hdr.userId = (int)TarHeader.parseOctal( header, offset, TarHeader.UIDLEN );
offset, TarHeader.UIDLEN );
parseTarHeader
writeEntryHeader
Duplic
ated
Code
![Page 118: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/118.jpg)
public
public inthdr.
header, offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader
} public
int
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
long
offset = TarHeader.getLongOctalBytes( size, outbuf, offset, TarHeader.
}
hdr.mode
hdr.mode
offset, TarHeader.
offset, TarHeader.
offset += TarHeader.
offset += TarHeader.
hdr.userId
hdr.userIdoffset, TarHeader.
offset, TarHeader.
parseTarHeader
writeEntryHeader
Extract method (by factoring out the duplicated code)1
![Page 119: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/119.jpg)
public
public inthdr.
header, offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader
} public
int
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
long
offset = TarHeader.getLongOctalBytes( size, outbuf, offset, TarHeader.
}
hdr.mode
hdr.mode
offset, TarHeader.
offset, TarHeader.
offset += TarHeader.
offset += TarHeader.
hdr.userId
hdr.userIdoffset, TarHeader.
offset, TarHeader.
parseTarHeader
writeEntryHeader
Extract method (by factoring out the duplicated code)1
Move the newly created method (in TarHeader)2
![Page 120: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/120.jpg)
public
public inthdr.
header, offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader
} public
int
hdr.offset, TarHeader.
offset += TarHeader.
hdr.offset, TarHeader.
long
offset = TarHeader.getLongOctalBytes( size, outbuf, offset, TarHeader.
}
hdr.mode
hdr.mode
offset, TarHeader.
offset, TarHeader.
offset += TarHeader.
offset += TarHeader.
hdr.userId
hdr.userIdoffset, TarHeader.
offset, TarHeader.
parseTarHeader
writeEntryHeader
Extract method (by factoring out the duplicated code)1
Move the newly created method (in TarHeader)2
Encapsulate public data (in TarHeader)3
![Page 121: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/121.jpg)
yet, there is an alternative solution…
![Page 122: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/122.jpg)
![Page 123: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/123.jpg)
Move data (TarHeader > TarEntry)1
![Page 124: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/124.jpg)
Move data (TarHeader > TarEntry)1
Encapsulate public data (in TarEntry)2
![Page 125: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/125.jpg)
vs.
Extract method(out of the duplicated code)1
Move the newly created method(in TarHeader)2
Encapsulate public data(in TarHeader)3
Move data(TarHeader > TarEntry)1
Encapsulate public data(in TarEntry)2
![Page 126: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/126.jpg)
vs.
Which solution is best?
Extract method(out of the duplicated code)1
Move the newly created method(in TarHeader)2
Encapsulate public data(in TarHeader)3
Move data(TarHeader > TarEntry)1
Encapsulate public data(in TarEntry)2
![Page 127: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/127.jpg)
Only the developer who knows the context
can decide!
![Page 128: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/128.jpg)
?How to deal with
tactical flaws
![Page 129: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/129.jpg)
start with
symptom indicators
Checkstyle
![Page 130: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/130.jpg)
Lorenz, Kidd, 1994Chidamber, Kemerer, 1994
LOC - number of lines of code
CYCLO - cyclomatic complexity of a function NOF - number of functions
FANOUT - outgoing coupling
NOA - number of attributes
DIT - depth of inheritance tree
TCC - tight class cohesion
…
![Page 131: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/131.jpg)
The problem is…
![Page 133: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/133.jpg)
![Page 134: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/134.jpg)
!Tactical flaws must be treated as
first-class entities
![Page 135: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/135.jpg)
!…and symptoms must be
aggregated
![Page 136: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/136.jpg)
for example…
![Page 137: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/137.jpg)
from S.Demeyer, S.Ducasse, O.Nierstrasz - Object-Oriented Reengineering Patterns, 2003
![Page 138: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/138.jpg)
from S.Demeyer, S.Ducasse, O.Nierstrasz - Object-Oriented Reengineering Patterns, 2003
![Page 139: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/139.jpg)
from S.Demeyer, S.Ducasse, O.Nierstrasz - Object-Oriented Reengineering Patterns, 2003
![Page 140: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/140.jpg)
or another example…
![Page 141: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/141.jpg)
God Classes use data from small data-classes, centralize the intelligence of the system, and do everything.
A.Riel, 1996
![Page 142: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/142.jpg)
God Classes break encapsulation, and are complex, and are not cohesive.
A.Riel, 1996
![Page 143: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/143.jpg)
ATFD > FEW
Class uses directly more than a
few attributes of other classes
WMC ≥ VERY HIGH
Functional complexity of the
class is very high
TCC < ONE THIRD
Class cohesion is low
AND GodClass
from M.Lanza, R.Marinescu - Object-Oriented Metrics in Practice, 2006
![Page 144: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/144.jpg)
but there is
one more problem when dealing with metrics…
![Page 145: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/145.jpg)
Thresholds
![Page 146: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/146.jpg)
who “authorized” these thresholds?
![Page 148: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/148.jpg)
![Page 149: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/149.jpg)
5 projects?!?! < 100 classes?!?!
![Page 150: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/150.jpg)
Michele LanzaRadu Marinescu
Object-Oriented Metrics
in PracticeUsing Software Metrics to
Characterize, Evaluate, and Improve the Design of Object-Oriented Systems
Foreword by Stéphane Ducasse
Lanza · Marinescu
Ob
ject-Orien
ted
Metrics in
Practice
Michele Lanza is an Assistant Professor at the University of Lugano, Switzer-land. His main research interests lie in software (re)engineering and software evo-lution with a special focus on software visualization and metrics. He is the creatorof CodeCrawler, a freely available language-independent software visualizationtool. His Ph.D. work won the Ernst Denert Software Engineering Award in 2003.Radu Marinescu is an Assistant Professor at the Politehnica University ofTimisoara, Romania. His research focus is on object-oriented design, reenginee-ring and quality assurance. He is the author of a suite of novel object-orientedmetrics and the main creator of iPlasma, an integrated and freely available tool-kit for Java and C++ projects. Several of his published research ideas have alreadybeen applied in the well-known “Borland Together Control Center” CASE tool.
783540 2442959
ISBN 3-540-24429-8
› springer.com
Object-Oriented Metrics inPracticeMetrics are paramount in every engineering discipline. However, due to its lackof rigor and its intrinsic complexity, software engineering is not considered aclassical engineering activity. Moreover, defining, understanding and applyingsoftware metrics often looks like an overly complex activity, recommended onlyto ‘trained professionals’. In general, if a software system is delivering theexpected functionality, only few people – if any – care about measuring the qua-lity of its internal structure. Consequently, software metrics are still regardedrather circumspectly by most software developers.
Lanza and Marinescu demystify the design metrics used to assess the size,quality and complexity of object-oriented software systems. Based on a novelapproach, backed by generally accepted semantics for metrics and by statisticalinformation from many industrial projects, they deduce a suite of metrics-basedpatterns for assessing the design of object-oriented software systems. Theyshow in detail how to identify design disharmonies in code, and how to deviseand apply remedies.
The combination of theoretically sound results and practically tested procedu-res and solution paths makes this book an ideal companion for professionalsoftware architects, developers and quality engineers. The pattern-oriented des-cription of disharmonies offers easy access to detecting shortcomings andapplying solutions to real problems.
Features and Benefits:
* comprehensive list of object-oriented disharmony patterns
* many reengineering strategies for poorly structured code
* brief introduction to software visualization
‘’This well-written book is an impor-tant piece of work that takes theseemingly forgotten art of object-oriented metrics to the next level interms of relevance and usefulness.’Richard C. Gronback,Chief Scientist, Borland SoftwareCorporation
13
1
![Page 151: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/151.jpg)
Michele LanzaRadu Marinescu
Object-Oriented Metrics
in PracticeUsing Software Metrics to
Characterize, Evaluate, and Improve the Design of Object-Oriented Systems
Foreword by Stéphane Ducasse
Lanza · Marinescu
Ob
ject-Orien
ted
Metrics in
Practice
Michele Lanza is an Assistant Professor at the University of Lugano, Switzer-land. His main research interests lie in software (re)engineering and software evo-lution with a special focus on software visualization and metrics. He is the creatorof CodeCrawler, a freely available language-independent software visualizationtool. His Ph.D. work won the Ernst Denert Software Engineering Award in 2003.Radu Marinescu is an Assistant Professor at the Politehnica University ofTimisoara, Romania. His research focus is on object-oriented design, reenginee-ring and quality assurance. He is the author of a suite of novel object-orientedmetrics and the main creator of iPlasma, an integrated and freely available tool-kit for Java and C++ projects. Several of his published research ideas have alreadybeen applied in the well-known “Borland Together Control Center” CASE tool.
783540 2442959
ISBN 3-540-24429-8
› springer.com
Object-Oriented Metrics inPracticeMetrics are paramount in every engineering discipline. However, due to its lackof rigor and its intrinsic complexity, software engineering is not considered aclassical engineering activity. Moreover, defining, understanding and applyingsoftware metrics often looks like an overly complex activity, recommended onlyto ‘trained professionals’. In general, if a software system is delivering theexpected functionality, only few people – if any – care about measuring the qua-lity of its internal structure. Consequently, software metrics are still regardedrather circumspectly by most software developers.
Lanza and Marinescu demystify the design metrics used to assess the size,quality and complexity of object-oriented software systems. Based on a novelapproach, backed by generally accepted semantics for metrics and by statisticalinformation from many industrial projects, they deduce a suite of metrics-basedpatterns for assessing the design of object-oriented software systems. Theyshow in detail how to identify design disharmonies in code, and how to deviseand apply remedies.
The combination of theoretically sound results and practically tested procedu-res and solution paths makes this book an ideal companion for professionalsoftware architects, developers and quality engineers. The pattern-oriented des-cription of disharmonies offers easy access to detecting shortcomings andapplying solutions to real problems.
Features and Benefits:
* comprehensive list of object-oriented disharmony patterns
* many reengineering strategies for poorly structured code
* brief introduction to software visualization
‘’This well-written book is an impor-tant piece of work that takes theseemingly forgotten art of object-oriented metrics to the next level interms of relevance and usefulness.’Richard C. Gronback,Chief Scientist, Borland SoftwareCorporation
13
1
37/45 projects…
![Page 152: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/152.jpg)
![Page 153: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/153.jpg)
4800 projects (SourceForge) 300.000.000 lines of code
![Page 154: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/154.jpg)
4800 projects (SourceForge) 300.000.000 lines of code inFusion
![Page 155: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/155.jpg)
4800 projects (SourceForge) 300.000.000 lines of code inFusion
![Page 156: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/156.jpg)
Wrapping it up…
![Page 157: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/157.jpg)
#1 Distinguish tactical flaws from execution flaws
![Page 158: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/158.jpg)
#2 Don’t correct tactical flaws by fixing isolated symptoms
![Page 159: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/159.jpg)
#3 Correcting tactical flaws requires exploration tools
![Page 160: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/160.jpg)
#3 Correcting tactical flaws requires exploration tools
powerf
ul
![Page 161: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/161.jpg)
Flaw Summary
![Page 162: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/162.jpg)
Flaw Summary
Visualization
Metrics
Related flaws
Source Highlighter
Dependency Breakout
![Page 163: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/163.jpg)
#4 Improve technical debt calculators
![Page 164: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/164.jpg)
#5 Build massive collection of curated measurement data
![Page 165: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/165.jpg)
“ ”A single arrow is easily broken, but not ten in a bundle.
Japanese proverb
![Page 166: Measuring Software: From Data to Actionable Knowledge](https://reader038.vdocuments.mx/reader038/viewer/2022103118/55cc8ebabb61eb0b2d8b45a4/html5/thumbnails/166.jpg)
Measuring Software: From Data to Actionable Knowledge
16 May 2015
International Workshop on Software Architecture and Metrics
Radu Marinescu [email protected]
@radu_marinescu