2. Anton Litvinenko
3. Key competence:software measurement and metrics 9 years of software development at Programeter, Mobi, and MicroLink 4. MSc in computer science at Tartu University 5. Agenda
6. Are software metrics good or bad ? 7. What is a measure ? 8. What is a measure? Way of associating anumberwith someattribute of a physical object height -> meters temperature -> degrees Celsius 9. What is measure? One-to-one mappingbetweenphysicalobjects andformalobjects (e.g numbers) 10. Same Stuff Formally
11. Relations on these objects ( e.g. more, equal ) 12. Binary operations on these objects ( e.g. combine, put together )
13. Relationships and Operations
14. Steve Ballmer has 4 apples Jobs has more apples 15. Jobs and Ballmer can cooperate and put their apples together to have a larger pile 16. We defined a complete transition from real world into formal world 17. Same Stuff Formally... again
18. B be a relational system offormal objects( e.g.numbers) 19. m be a measure from A to B then 20. TupleA ,Bandmis ascaleif
21. For each operator in A there is a corresponding operator in B 22. Why is this important? 23. What Can You Say? 24. Why is this important?
25. 20 modules with complexity 10 30 range Which one is less complex? 26. We don't have intuition for such cases 27. Intelligence Barrier 28. Example: Temperature
29. Anton : today is 4C, yesterday was 27C Statements :
30. Anton :Yesterday was warmer than today 31. Example: Temperature
32. Anton : today is 4C, yesterday was 27C Statements :
33. Statement ismeaningfulwhen it givessame resultonall similarscales 34. Scalesaresimilarwhen there is atransformationfrom one scale to another thatretains all defined relations and operations 35. Nominal Scale
Numbers on t-shirts of football players
36. View from 3000 feet :) Nominal Scales Gender T-shirt Numbering 37. Ordinal Scale
38. Middle element median
39. All Ordinal Scales Are Nominal Nominal Ordinal Gender T-shirt Numbering Top 100 Grading 40. Interval Scale
41. Similar reachable viapositive linear transformation :t(x) = ax + b
42. Interval Scales Are Ordinal Nominal Ordinal Interval Gender T-shirt Numbering Top 100 Grading Temperature 43. Ratio Scale
44. Similar reachable via positive linear transformation in form oft(x) = ax Length, height, ...
45. Ratio Scales Are Interval Nominal Ordinal Interval Ratio Gender T-shirt Numbering Top 100 Grading Temperature Length Height 46. Absolute Scale
47. My software is 25 lines of code 48. Absolute Scales Are Ratio Nominal Ordinal Interval Ratio Absolute Scales Gender T-shirt Numbering Top 100 Grading Temperature Length Height Team Size 49. Exercise 2
50. Qualityis onlyordinal(rarely interval) 51. Judgment in terms of value
52. Should we pay 2x for 2x quality?Combiningcost measure on aratio scalewith quality measure onordinal scale ,what scale do you get ? 53. In This Course:Metric = Measure 54. Software Metricis ameasureof anything directly related tosoftwareor itsproduction 55. Agenda
56. Examples of software metrics
57. Can anybody name any software metric? 58. Lines Of Code (LOC) Product Size
59. Lines Of Code 60. Lines Of Code Summary
61. Comments 62. Several statements on one line Language dependent 63. Doesn't respect complexity and content 64. McCabe's Cyclomatic Complexity
65. Complexity of a program
66. Usually calculated using flow graph V(G) = e n + 2p
67. McCabe's Cyclomatic Complexity 68. McCabe's Cyclomatic Complexity
69. n = 6 70. p = 1 71. V(G) = 3 72. Cyclomatic Complexity Summary
73. Maintainability
Testability
V(G) is a lower bound for the path coverage
Doesn't respect other types of complexity
74. Exercise 3
75. Draw aflow graph 76. CalculateMcCabe's cyclomatic complexity Code snippet 77. Agenda
78. Examples of software metrics
79. Object oriented metrics 80. Object Oriented Metrics
81. Measure unique aspects of theobject orientedapproach 82. Inheritance Metrics
Number of children (NOC)
NOC: 2 DIT: 2 NOC: 3 DIT: 1 83. Complexity
Response for a class (RFC)
84. Complexity Example RFC = 6, WMC = 1 + 2 + 1 = 4 85. Coupling
Lack of cohesion in methods (LCOM)
86. Coupling Example CBO = 2, LCOM = 3 0 = 3 87. Coupling Example LCOM = 2 1 = 1 88. Agenda
89. Examples of software metrics
90. Object oriented metrics 91. Object oriented design quality metrics 92. Object Oriented Design
Class design principles
Package architecture principles
93. OO Design Quality Metrics
94. Measurequalityof anobject oriented design 95. Can we divide dependencies into good and bad ? Dependencies Between Classes 96. Dependencies
97. Stable
98. Hard to change = many dependents = responsible Unstable
99. Easy to change = no dependents = irresponsible 100. Class Category
101. Reused together 102. Same goal
103. Dependency Metrics
Efferent Coupling (Ce) number of classes inside the category depending on the classes outside the category
104. Example - Coupling Package One Package Two Package Three Ca(Package One) = 1, Ce(Package One) = 2 105. Instability (I)
106. Stable-> I = 0 -> Ce = 0 107. Unstable-> I = 1 -> Ca = 0, Ce > 0 108. Should all categories bestable ? 109. Why astablecategory needs to beextensible ? How? 110. Abstractness (A)
Completely abstract-> A = 1 -> all classes are abstract 111. Completely concrete-> A = 0 -> no abstract classes in category 112. Is there a relationship betweenInstabilityandAbstractness ? 113. Main Sequence 114. Distance From Main Sequence
115. Agenda
116. Examples of software metrics
117. Object oriented metrics 118. Object oriented design quality metrics 119. Developer and team metrics 120. Developer and Team Metrics
Knowledge
Expertise
Team healthiness
121. Productivity: Code Churn Metrics
122. Churned LOC number of added, modified and deleted lines of code 123. Churn Count number of changes made to a file 124. Files Churned number of changed files 125. 126. 127. 128. 129. 130. 131. 132. Code Churn Metrics
Vulnerable files have higher code churn metrics
133. Agenda
134. Examples of software metrics
135. Object oriented metrics 136. Object oriented design quality metrics 137. Developer and team metrics
138. Knowledge 139. Knowledge Metrics
Does developer share her knowledge with colleagues?
140. 141. 142. 143. 144. 145. Unique: 2 / 5-> 40% Shared: 1 / 5 -> 20% Unique: 1 / 5-> 20% Shared: 1 / 5 -> 20% 146. Example
Unique - 35% Shared - 10% Unique - 10% Shared - 35% 147. Agenda
148. Examples of software metrics
149. Object oriented metrics 150. Object oriented design quality metrics 151. Developer and team metrics 152. Project size metrics 153. How would you measure product size? 154. Perfect Hours
Relative measureof effort
Team specific 155. Applied early Manual and subjective 156. Points
Not tied to time 157. Team specific 158. Applied early Manual and subjective 159. Velocity
Completed Points Iterations 160. Function Points
161. Agenda
162. Examples of software metrics
163. Object oriented metrics 164. Object oriented design quality metrics 165. Developer and team metrics 166. Project size metrics 167. Quality metrics 168. What does high quality mean? Quality Metrics 169. Quality Metrics
170. Functionality, reliability, usability, portability,
171. 172. Quality Developer's Perspective
173. Architecture and design 174. Used technologies and libraries Testability + Existing tests
175. Code coverage with tests 176. Quality PM's Perspective
177. Delivery planning 178. Additional costs Correctness
179. Serves customer needs 180. Quality Customer's Perspective
181. Return on investment Transparency
182. Delays and troubles are not hidden 183. Quality User's Perspective
184. Comprehensibility Performance
185. Critical functionality is quick Functionality
186. Example: Defect Detection Percentage
DDP = E / (E + D)
187. D defects = errors foundafter delivery
188. Example: Time Between Escaped Defects
189. Course:IDY0204 Software Quality and Standards 190. Agenda
191. Examples of software metrics 192. Classification of software metrics 193. Classification of Software Metrics Subject of measurement 194. Subject:Development Process
195. On the organizational level strategic purposes 196. On the project level tactical purposes
197. Number of changes in requirements 198. Number of finished tasks 199. Defect detection percentage 200. Subject:Resources
201. Developer fluctuation 202. Developer productivity and know-how in the project 203. Maturity of the code written by developer 204. Subject:Product
205. McCabe's cyclomatic complexity 206. Code coverage with test 207. Code stability 208. Classification Overview What is measured? 209. Classification of Software Metrics Lines of Code vs Quality 210. DirectMetrics
211. McCabe's cyclomatic complexity 212. Number of requirements 213. IndirectMetrics
214. Developer productivity, efficiency 215. Reliability 216. Classification Overview What is measured? Is it measurable? 217. Classification of Software Metrics (In)dependency on the measurement context 218. InternalAttributes
219. McCabe's cyclomatic complexity 220. Code coverage with tests 221. ExternalMetrics
222. Developer productivity 223. Source code comprehensibility 224. Usability 225. Classification Overview What is measured? Is it measurable? Is context dependent? 226. Classification Example What is measured? Is it measurable? Is context dependent? 227. References
Wikipedia
C. Lange, Metrics in software architecting
M. Gkmen, Software process and project metrics
H. Nestra, Metrics, Software engineering 2005
Lines of code
228. References II
229. http://www.stsc.hill.af.mil/crosstalk/1994/12/xt94d12b.asp 230. http://www.answers.com/topic/cyclomatic-complexity S. Chidamber and C. Kemerer, A metrics suite for object oriented des.
C. Martin, OO Quality design metrics
R. Pressman, Software engineering: a practitioner's approach
More
231. http://www.parlezuml.com/metrics/OO%20Design%20Principles%20&%20Metrics.pdf 232. http://www.parlezuml.com/metrics/Metrics%20Definitions.pdf 233. Home Reading David Longstreet Function Point Manual 234. Thank you for your time and attention!