Software Metrics *** state of the art, weak points and possible improvements Gordana Rakić, Zoran Budimac Department of Mathematics and Informatics, Faculty.

Slides:



Advertisements
Similar presentations
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Advertisements

1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Detailed Design Kenneth M. Anderson Lecture 21
A GOAL-BASED FRAMEWORK FOR SOFTWARE MEASUREMENT
Object-Oriented Metrics
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
SMIILE Finaly COBOL! and what else is new Gordana Rakić, Zoran Budimac.
Advanced Topics in Software Engineering ATSE 2009 Topics, participants and results Gordana Rakic, Zoran Budimac.
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Chapter 9.3 Software Testing Strategies.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Protus 2.0: Ontology-based semantic recommendation in programming tutoring system Presentor: Boban Vesin Boban Vesin, Aleksandra Klašnja-Milićević Higher.
USING SOFTWARE METRICS IN EDUCATIONAL ENVIRONMENT Ivan Pribela, Zoran Budimac, Gordana Rakić.
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.
Software Project Management Fifth Edition
An Architecture for Empathic Agents. Abstract Architecture Planning + Coping Deliberated Actions Agent in the World Body Speech Facial expressions Effectors.
1 Software Quality CIS 375 Bruce R. Maxim UM-Dearborn.
Paradigm Independent Software Complexity Metrics Dr. Zoltán Porkoláb Department of Programming Languages and Compilers Eötvös Loránd University, Faculty.
Software Metrics Software Engineering.
Agenda Introduction Overview of White-box testing Basis path testing
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 23 Instructor Paulo Alencar.
Software Metrics (Part II). Product Metrics  Product metrics are generally concerned with the structure of the source code (example LOC).  Product metrics.
Concepts of Software Quality Yonglei Tao 1. Software Quality Attributes  Reliability  correctness, completeness, consistency, robustness  Testability.
Software Engineering 2 Software Testing Claire Lohr pp 413 Presented By: Feras Batarseh.
Software Design Design is the process of applying various techniques and principles for the purpose of defining a device, a process,, or a system in sufficient.
SEG3300 A&B W2004R.L. Probert1 COCOMO Models Ognian Kabranov.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
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.
Towards the better software metrics tool motivation and the first experiences Gordana Rakić Zoran Budimac.
CS551 - Lecture 5 1 CS551 Lecture 5: Quality Attributes Yugi Lee FH #555 (816)
Metrics in Education (in informatics) Ivan Pribela, (Zoran Budimac)
Gordana Rakić, Zoran Budimac
Software Testing White Box Testing. Agenda What is White Box Testing Correctness Tests and Path Coverage Correctness Tests and Line Coverage McCabe Cyclomatic.
CSC 480 Software Engineering Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
CSE 303 – Software Design and Architecture
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
SSQSA present and future Gordana Rakić, Zoran Budimac Department of Mathematics and Informatics Faculty of Sciences University of Novi Sad
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Agent program is the one part(class)of Othello program. How many test cases do you have to test? Reversi [Othello]
Metrics "A science is as mature as its measurement tools."
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Cyclomatic complexity (or conditional complexity) is a software metric (measurement). Its gives the number of indepented paths through strongly connected.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
Csontos Péter, Porkoláb Zoltán Eötvös Loránd Tudományegyetem, Budapest ECOOP 2001 On the complexity of exception handling.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Test Metrics When you can measure what you are speaking about and express it in numbers, you know something about it; but when you cannot measure,
A Hierarchical Model for Object-Oriented Design Quality Assessment
Metrics of Software Quality
Software Metrics 1.
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Software Testing.
Cyclomatic complexity
Design Characteristics and Metrics
Towards a Multi-paradigm Complexity Measure
CS 5010 Program Design Paradigms “Bootcamp” Lesson 5.1
Object-Oriented Metrics
Design Metrics Software Engineering Fall 2003
Design Metrics Software Engineering Fall 2003
Metrics for SmartApps
On SNEIPL (software networks extractor) – a part of the SSQSA back end
Software Testing (Lecture 11-a)
Halstead software science measures and other metrics for source code
Estimating Timing Profiles for Simulation of Embedded Systems
Software Metrics SAD ::: Fall 2015 Sabbir Muhammad Saleh.
Software Testing “If you can’t test it, you can’t design it”
Software Testing COM /12/2019 Testing/Spring 98.
1. Cyclomatic complexity
Chapter 8: Design: Characteristics and Metrics
Presentation transcript:

Software Metrics *** state of the art, weak points and possible improvements Gordana Rakić, Zoran Budimac Department of Mathematics and Informatics, Faculty of Sciences, University of Novi Sad Melinda Tóth Eotvos Lorand University Budapest

Contents Abstract Introduction State of the Art Motivation Recursion Aware Complexity Conclusion Future Work

Abstract By target  Process  Product  Resources By availability  Internal  External By measurement object  Size  Complexity  Structure  Architecture By applicability  Specification  Design  Source code  … (Some of) Software metrics classifications

Abstract Code complexity is measured by “old” metrics Inconsistency between the tools [Novak and Rakic, 2011] [Lincke et al. 2008] Metrics algorithm are sometimes adapted during the implementation according to  Programming language  Programming paradigm  Programming style  …

Question Could some of these changes be generalized by introducing new metrics?

Contents Abstract Introduction State of the Art Motivation Recursion Aware Complexity Conclusion Future Work

Software quality Attributes of Product Quality (not only the software product)  user point of view functionality usability reliability efficiency portability  producer point of view maintainability

Maintainability ISO 9126: maintainability of software product expresses easiness of making changes during the product life cycle is formally divided into analyzability, changeability, stability, and testability. strongly depends on  readability and clarity of the source code. source code complexity Sometimes including  code size and  data organization and usage.

Contents Abstract Introduction State of the Art Motivation Recursion Aware Complexity Discussion Conclusion Future Work

State of the Art Complexity and size metrics  LOC  Halstead  Cyclomatic Complexity ...  Derived metrics

Cyclomatic Complexity Expresses number of linearly independent paths through the program Calculates the value based on number of control flows in the program [McCabe, 1976]

Cyclomatic Complexity Can underestimate or overestimate complexity [Vinju and Godfry, 2012] Derived metrics and modifications of CC:  for OO languages WMC [Chidamber and Kemerer, 1993]  for functional languages number of branches of recursion [Király and Kitlei, 2011] CC calculated on the graph built by in-lining the function ...

Question How RECURSION affect complexity and maintainability? How to measure it?

Contents Abstract Introduction State of the Art Motivation Recursion Aware Complexity Conclusion Future Work

Motivation Trends  Multilingual projects  Multi-paradigm languages  …  Tending to simplicity in programming we go from introducing recursion to increase maintainability to long chain of (recursive) calls which decreases maintainability

Motivation Control Flow Graph (CFG)  One control flow graph represents one function/procedure/method/etc.  Cyclomatic Complexity is used to measure number of paths in CFG  Problem: Functions are not independent units => CFGs should be connected to give real picture

Motivation Program: set of the interconnected functions  Represented by directed graph of higher level nodes of CFGs connected in a graph  Available metrics measuring communication between functions: Number of input links Number of output links  There are no metrics measuring complexity by observing the paths through the graph higher level equivalent to CC

Motivation sum(a, b){ sum=0; if (a = b) { sum := a + b; } else if (a>b){ while (a > b){ sum += a; a--; } sum += b; } else{ while (b > a){ sum += b; b--; } sum += a; } return sum; }

Motivation sum_max(max, min){ sum = 0; while (max > min){ sum += max; max--; } sum += min; return sum; } sum(a, b){ sum=0; if (a = b) { sum := a + b; } else if (a>b){ sum:= sum_max(a, b); } else{ sum:= sum_max(b, a); } return sum; }

Motivation sum(a, b){ sum=0; if (a = b) { sum := a + b; } else if (a>b){ sum+= a + sum(a-1, b); } else{ sum:= b + sum(b-1, a); } return sum; }

Parameters of complexity Local control flow  complexity for each observed CFG Global control flow complexity  complexity of the interactions between observed CFGs the length of the chains of calls the length of chains when there are closed chains of calls (recursion)

Contents Abstract Introduction State of the Art Motivation Recursion Aware Complexity Conclusion Future Work

Recursive Complexity LoR: Length of the Recursion  number of branches (which is equivalent to the number of nodes) in the recursive chain

Q1: How to define Recursive Complexity (RC) if we know the Length of Recursion (LoR)? RC = LoR ???  In this case n self recursions have the same weight as one recursion whose chain contains n nodes  Answer: not good enough RC = LoR 2 ???  Show case: mutual recursion of two functions four self-recursions  Open question: are these two cases the similarly maintainable

Q2: How to define Overall Path Complexity (OPC) if we have in mind the definition of Cyclomatic Complexity (CC) and Recursive Complexity (RC) ???

Demonstration of OPC calc1(A)-> f(A). f(0) -> 1; f(N) -> g(f(N-1)) + calc1(10). g(0) -> 1; g(N) -> h(g(N-1)). h(0) -> 0; h(N) -> case N of 1 -> 1; 2 -> f(h(N-1)) end.

Demonstration of OPC

Contents Introduction State of the Art Motivation Recursive Complexity Conclusion Future Work

Conclusion Numerous complexity and maintainability metrics but still some gaps To fill the gap we propose introducing:  Recursive Complexity  Overall Path Complexity Implemented and tested several variations of this recursion aware metrics  Implementation included in RefactorErl

Contents Introduction State of the Art Motivation Recursive Complexity Discussion Conclusion Future Work

To implement RC and OPC  Integrate with the language independent SMIILE tool (SSQSA) [Budimac et al, 2012] Validate on broader range of examples To explore if there is correlation between OPC and  Other metrics  Execution time  …

Gordana Rakić, Zoran Budimac Department of Mathematics and Informatics, Faculty of Sciences, University of Novi Sad Melinda Tóth Eotvos Lorand University Budapest