1. Cyclomatic complexity

Slides:



Advertisements
Similar presentations
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Advertisements

Path Analysis Why path analysis for test case design?
1 Ivan Marsic Rutgers University LECTURE 15: Software Complexity Metrics.
CYCLOMATIC COMPLEXITY 1. Invented by Thomas McCabe (1974) to measure the complexity of a program ’ s conditional logic Cyclomatic complexity of graph.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
David Woo (dxw07u).  What is “White Box Testing”  Data Processing and Calculation Correctness Tests  Correctness Tests:  Path Coverage  Line Coverage.
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.
Metrics Project and Process Metrics. Why do we measure? Assessing project status Allows us to track risks Before they go critical Adjust workflow See.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
1 Static Analysis Methods CSSE 376 Software Quality Assurance Rose-Hulman Institute of Technology March 20, 2007.
Software engineering for real-time systems
March R. McFadyen1 Software Metrics Software metrics help evaluate development and testing efforts needed, understandability, maintainability.
Basis Path Testing - Example
BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
1 The Relationship of Cyclomatic Complexity, Essential Complexity and Error Rates Mike Chapman and Dan Solomon
A Complexity Measure THOMAS J. McCABE Presented by Sarochapol Rattanasopinswat.
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 Systems Verification and Validation Laboratory Assignment 3
Prof. Mohamed Batouche Software Testing.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Agenda Introduction Overview of White-box testing Basis path testing
Software Metrics (Part II). Product Metrics  Product metrics are generally concerned with the structure of the source code (example LOC).  Product metrics.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Software Metrics Cmpe 550 Fall Software Metrics.
BASIS PATH TESTING.
Creator: ACSession No: 7 Slide No: 1Reviewer: SS CSE300Advanced Software EngineeringSeptember 2005 Software Measurement – Estimation and Productivity CSE300.
Software Testing White Box Testing. Agenda What is White Box Testing Correctness Tests and Path Coverage Correctness Tests and Line Coverage McCabe Cyclomatic.
1 Ivan Marsic Rutgers University LECTURE 15: Software Complexity Metrics.
Theory and Practice of Software Testing
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]
White Box Testing by : Andika Bayu H.
Cyclomatic complexity (or conditional complexity) is a software metric (measurement). Its gives the number of indepented paths through strongly connected.
Cyclomatic Complexity Philippe CHARMAN Last update:
CHAPTER 9 - PART 2 Software Testing Strategies. Lesson Outlines ■ White box testing – Data processing and calculation correctness tests – Correctness.
Structure Based Test Design
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,
TQS - Teste e Qualidade de Software (Software Testing and Quality) Test Case Design: White Box Testing João Pascoal Faria.
BASIS PATH TESTING.
Cyclomatic Complexity
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
Software Engineering (CSI 321)
Data Coverage and Code Coverage
Types of Testing Visit to more Learning Resources.
White Box Testing.
Constructing and Using
Cyclomatic Complexity
Cyclomatic Complexity
Software Testing (Lecture 11-a)
Cyclomatic Complexity
Chapter 14 Software Testing Techniques
LECTURE 15: Software Complexity Metrics
CS223: Software Engineering
Halstead software science measures and other metrics for source code
Cyclomatic Complexity
GreedyMaxCut a b w c d e 1.
Solution to problem 4. a) Control flow graph art Start k = i + 2 * j
Cyclomatic Complexity
Software Engineering Lecture #35
Software Metrics SAD ::: Fall 2015 Sabbir Muhammad Saleh.
Software Testing “If you can’t test it, you can’t design it”
Software Metrics using EiffelStudio
By: Lecturer Raoof Talal
Unit III – Chapter 3 Path Testing.
Presentation transcript:

1. Cyclomatic complexity Introduced by Thomas McCabe in 1976, it measures the number of linearly-independent paths through a program. Cyclomatic complexity is a measure of source code complexity. When computing the Cyclomatic Complexity, the result is returned as a number. The bigger the number, the more complex the program is.

Complexity  V(G) = edges – nodes + 2 The metric tries to capture the number of paths through the code. The complexity typically increases because of branch points. To compute the Cyclomatic complexity: Complexity  V(G) = edges – nodes + 2 Example:

Complexity  V(G) = edges – nodes + 2 If(success) Do something; Else Do the other thing; V(G) = 4 –4+2 = 2

2. Comments percentage % The goal is to maximize code understandability. The more you provide documentation, the more people understand it. Comments% = comment lines / total number of lines.

3. Size (Number of Lines) The size can be found by counting the non-empty lines. Comment Lines, and Java_doc Lines are counted too. 4. Weighted Methods The methods in a class are counted. The more there are methods, the class becomes more complex

For each method, the number of lines is counted.