28/06/2015Dr Andy Brooks1 MSc Software Maintenance MS Viðhald hugbúnaðar Fyrirlestur 42 Maintainability Index Revisited.

Slides:



Advertisements
Similar presentations
Effort Estimation and Scheduling
Advertisements

Sixteen Questions About Software Reuse William B. Frakes and Christopher J. Fox Communications of the ACM.
The “Lifecycle” of Software. Chapter 5. Alternatives to the Waterfall Model The “Waterfall” model can mislead: boundaries between phases are not always.
Automated Software Maintainability through Machine Learning by Eric Mudge.
20/05/2015Dr Andy Brooks1 MSc Software Maintenance MS Viðhald hugbúnaðar Fyrirlestrar 19 & 20 The Benefits of Design Patterns.
Figures – Chapter 24.
Chapter 3 Producing Data 1. During most of this semester we go about statistics as if we already have data to work with. This is okay, but a little misleading.
March 25, R. McFadyen1 Metrics Fan-in/fan-out Lines of code Cyclomatic complexity Comment percentage Length of identifiers Depth of conditional.
Nov R. McFadyen1 Metrics Fan-in/fan-out Lines of code Cyclomatic complexity* Comment percentage Length of identifiers Depth of conditional.
Soft. Eng. II, Spr. 02Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 6 Title : The Software Quality Reading: I. Sommerville, Chap: 24.
Object-Oriented Analysis and Design Lecture 10 Implementation (from Schach, “O-O and Classical Software Engineering”)
Chapter 2: Algorithm Discovery and Design
Delivered System Documentation u One of the most important things that can be done to make a system maintainable is to create the best, most complete,
Object-Oriented Metrics
March R. McFadyen1 Software Metrics Software metrics help evaluate development and testing efforts needed, understandability, maintainability.
24/06/2015Dr Andy Brooks1 MSc Software Maintenance MS Viðhald hugbúnaðar Fyrirlestur 41 Maintainability of OSS OSS Open Source Software CSS Closed Source.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
1 Complexity metrics  measure certain aspects of the software (lines of code, # of if-statements, depth of nesting, …)  use these numbers as a criterion.
C++ for Engineers and Scientists Third Edition
Chapter 2: Algorithm Discovery and Design
Software Testing and QA Theory and Practice (Chapter 15: Software Reliability) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
1 The Relationship of Cyclomatic Complexity, Essential Complexity and Error Rates Mike Chapman and Dan Solomon
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
Copyright © Cengage Learning. All rights reserved.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 15 Software Reliability
1 Shawlands Academy Higher Computing Software Development Unit.
Introduction By: Dr. Javad Razjouyan. Programming Languages.
Software Estimation and Function Point Analysis Presented by Craig Myers MBA 731 November 12, 2007.
SWEN 5430 Software Metrics Slide 1 Quality Management u Managing the quality of the software process and products using Software Metrics.
Invitation to Computer Science, Java Version, Second Edition.
What Makes an Essay an Essay. Essay is defined as a short piece of composition written from a writer’s point of view that is most commonly linked to an.
Mining and Analysis of Control Structure Variant Clones Guo Qiao.
1 Chapter 4: Selection Structures. In this chapter, you will learn about: – Selection criteria – The if-else statement – Nested if statements – The switch.
Software Engineering 2003 Jyrki Nummenmaa 1 SOFTWARE PRODUCT QUALITY Today: - Software quality - Quality Components - ”Good” software properties.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 15b: Product Metrics for Software Software Engineering: A Practitioner’s Approach, 6/e Chapter.
OHTO -99 SOFTWARE ENGINEERING “SOFTWARE PRODUCT QUALITY” Today: - Software quality - Quality Components - ”Good” software properties.
Software Quality Metrics
Disciplined Software Engineering Lecture #2 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #2 Software Engineering.
Design Metrics & Dolores Zage Wayne Zage & Sponsored by Status Report.
1 Metrics and lessons learned for OO projects Kan Ch 12 Steve Chenoweth, RHIT Above – New chapter, same Halstead. He also predicted various other project.
SOFTWARE METRICS. Software Process Revisited The Software Process has a common process framework containing: u framework activities - for all software.
Chapter 3: Software Project Management Metrics
Effort Estimation ( 估计 ) And Scheduling ( 时序安排 ) Presented by Basker George.
The Software Development Process
CSc 461/561 Information Systems Engineering Lecture 5 – Software Metrics.
Software Engineering 2004 Jyrki Nummenmaa 1 SOFTWARE PRODUCT QUALITY Today: - Software quality - Quality Components - ”Good” software properties.
1 Objectives ❏ To design and implement programs with more than one function ❏ To be able to design multi-function programs ❏ To understand the purpose.
Software Engineering – University of Tampere, CS DepartmentJyrki Nummenmaa SOFTWARE PRODUCT QUALITY Today: - Software quality -
Chapter 7 Measuring of data Reliability of measuring instruments The reliability* of instrument is the consistency with which it measures the target attribute.
Sixteen Questions About Software Reuse William B. Frakes and Christopher J. Fox Communications of the ACM.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Martin Hoffman Monica Hoffman. Goal To determine if a correlation exists between specified internal and dependability (external) metrics.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
Structural Coverage. Measurement of structural coverage of code is a means of assessing the thoroughness of testing. Such metrics do not constitute testing.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 جامعة الملك فيصل عمادة.
Static Software Metrics Tool
Certification of Reusable Software Artifacts
Software Metrics 1.
Object-Oriented Metrics
Design Metrics Software Engineering Fall 2003
Celia Chen1, Lin Shi2, Kamonphop Srisopha1
Design Metrics Software Engineering Fall 2003
Halstead software science measures and other metrics for source code
Structural Coverage.
Structural Coverage.
Software Metrics SAD ::: Fall 2015 Sabbir Muhammad Saleh.
Controlling Program Flow
Presentation transcript:

28/06/2015Dr Andy Brooks1 MSc Software Maintenance MS Viðhald hugbúnaðar Fyrirlestur 42 Maintainability Index Revisited

28/06/2015Dr Andy Brooks2 Case Study Dæmisaga Reference Maintainability Index Revisited – position paper -, Tobias Kuipers and Joost Visser. CSRM2007/SQM2007

Problems with the Maintainability Index “We have used the Maintainability Index in our consultancy practice over the last four years and found a number of problems with it.” “Although we see a clear use for determining the maintainability of the source code in one (or a few) simple to understand metrics, we have a hard time using the Maintainability Index to the desired effect.” 28/06/2015Dr Andy Brooks3

Root cause analysis Because MI is a composite metric it is very difficult to know what a value for means. When the MI has a low value, it is not immediately clear what should be done to increase it. 28/06/2015Dr Andy Brooks4

Average complexity The complexity metric is flawed. Because of all the getters and setters in Java which have a complexity of 1, the average complexity is low. –a class with 9 getters and setters and 1 method with a complexity of 10 will have an average complexity of 1.9 Anecdotal evidence suggests maintainance problems occur in a few outliers that have a complexity of over /06/2015Dr Andy Brooks5

Computability There is no formal definition of what constitutes an operator or operand for Java or C#. The Halstead Volume metric “is not widely accepted within the software engineering community”. 28/06/2015Dr Andy Brooks6

Comments “... we find that counting the number of lines... in general, has no relation with maintainability whatsoever.” Source code which has been “commented out” gets counted. Comments sometimes are not kept up-to-date and refer to a previous version. The comments part of the MI is optional. –it is possible drop the term containing PerCM 28/06/2015Dr Andy Brooks7

Understandability Developers feel they have a lack of control over the value of the MI and this “makes them dismissive of the MI for quality assessment purposes”. The developers´ attitude directly influences management´s acceptance of the value. 28/06/2015Dr Andy Brooks8

The SIG Maintainability Model The model is under development Five easy-to-calculate metrics Metrics are not composed into one unifying metric like MI “From discussions with developers of dozens of industrial systems we learn that the metrics are well accepted, or acceptable.” 28/06/2015Dr Andy Brooks9 Software Improvement Group

1. Total Size Source lines of code (SLOC). –excluding comments and blank lines A larger system requires a larger effort to maintain. So a smaller system is better. –a simple, intuitive idea that everyone understands No correction is applied for the expressiveness of a programming language. –a 1000-line Java program is considered to be more easily maintained than the functionally equivalent 1200-line C program 28/06/2015Dr Andy Brooks10 Five easy-to-calculate metrics

2. Number of Modules The ratio between the number of modules and the total lines of code is “a measure of how well a system is decomposed”. –“as an initial estimate it turns out to be rather useful” A module in Java or C# is a class. 28/06/2015Dr Andy Brooks11 Five easy-to-calculate metrics Andy asks: What is a reasonable ratio?

3. Number of units A module is decomposed into units. In Java or C#, a unit is a method. A unit is the smallest piece of code that can be executed (tested) individually. 28/06/2015Dr Andy Brooks12 Five easy-to-calculate metrics Andy asks: What is a reasonable number of units per module?

4. Cyclomatic Complexity above X Calculate complexity of units. Do not calculate average values. Complexity is expressed as the percentage of lines of code of the system that are in units which have a higher complexity than some threshold X. –X is currently taken to be 20 though McCabe suggests that X should be 10 28/06/2015Dr Andy Brooks13 Five easy-to-calculate metrics Andy asks: What is a reasonable % for complexity?

5. Duplication “... measuring code duplication gives a fairly simple estimate of how much larger a system is than it needs to be.” Exact string matching duplication. Duplication is measured as the percentage of all code that occurs more than once in equal code blocks of at least X lines. –“we take X to be 6” “we see a duplication percentage of around 3% for well managed systems” 28/06/2015Dr Andy Brooks14 Five easy-to-calculate metrics

Discussion and Conclusions The SIG Maintainability Model is easily explained to technical personnel and managers. How the source code influences the five metrics is clear. “We are currently putting this model to work in our consultancy practice.” 28/06/2015Dr Andy Brooks15 Andy asks: what about use of OO language features such as inheritance? keep DOI < 5?

28/06/2015Dr Andy Brooks16 Case Study Dæmisaga Reference The Software Maintainability Index Revisited Kurt D. Welker. CROSSTALK The Journal of Defense Software Engineering, August 2001, pp

Comments in code Comments that are out-of-date can actually hinder maintenance. Sometimes identifier names are used instead of comments. –distanceMetres –distance //measured in metres “A man in the maintainability assessment loop is essential both in how to measure comments in the source code (which MI equation) and then in determining the meaning of the results.” 28/06/2015Dr Andy Brooks17

28/06/2015Dr Andy Brooks18 Andy says: we agree this code is not very maintainable...

28/06/2015Dr Andy Brooks19 Figure 1: The Twelve Days of Christmas Andy says: we agree this code is maintainable...

Figure 2: The Twelve Days of Christmas - Metrics The 3 metric MI (without comments) suggests Example 1 is more maintainable. The 4 metric MI (with comments) suggests Example 2 is more maintainable. “... but did the comments really make the difference? No,” 28/06/2015Dr Andy Brooks20