a hierarchical measure for software complexity

14
Dirk Beyer Jeff Jiang Presented by: Ashgan Fararooy

Upload: andra

Post on 25-Feb-2016

39 views

Category:

Documents


0 download

DESCRIPTION

A Hierarchical Measure for Software Complexity. Dirk Beyer Jeff Jiang Presented by: Ashgan Fararooy. Abstract. The complexity of the software product can affect software quality A new simple metric is presented to determine the complexity of a software system - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: A Hierarchical Measure for Software Complexity

Dirk BeyerJeff Jiang

Presented by: Ashgan Fararooy

Page 2: A Hierarchical Measure for Software Complexity

The complexity of the software product can affect software quality

A new simple metric is presented to determine the complexity of a software system

Based on variables defined and used in source code and arguments involved in each function call

Page 3: A Hierarchical Measure for Software Complexity

Software Complexity Metrics* McCabe’s measure (Cyclomatic complexity)

measures the number of linearly independent paths through a program's source code

Halstead’s measures (computed statically) Program length: N = N1 + N2 Program vocabulary: n = n1 + n2 Volume: Difficulty : D = (n1/2) (N2/n2) Effort: E = D V

*From Wikipedia

Page 4: A Hierarchical Measure for Software Complexity

Definition

Evaluating software complexity based on the following factors:

The number of variables defined and used in a software system

The number of arguments (parameters) involved in each function call in the source code

Page 5: A Hierarchical Measure for Software Complexity

A source code which utilizes more variables: Intuition: Is harder to understand, maintain, and

migrate Justification: Considering most modern

programming languages are strong typed, it requires more attention regarding:

Initialization Type checking Type conversion Value tracking Deconstruction

Page 6: A Hierarchical Measure for Software Complexity

The same argument applies for function parameters

Function arguments (parameters) can be considered variables

Function is supposed to validate all parameters passed into it and handle all exceptions

A function with a large number of parameters is hard to understand, debug, and maintain

Page 7: A Hierarchical Measure for Software Complexity

Developed an Eclipse plug-in tool for measuring complexity

Goals: Evaluating the proposed metric Computing and comparing the complexity of

different Java source codes based on the metric

Page 8: A Hierarchical Measure for Software Complexity
Page 9: A Hierarchical Measure for Software Complexity

I. In a statement that is not a variable declaration, each variable used will contribute one point to complexity index

II. In a statement that is not a function declaration, each method/function invocation will contribute n points to complexity index (n = the number of arguments)

III. Class member attributes will be treated as variables except in their declaration statements

Page 10: A Hierarchical Measure for Software Complexity

Does the proposed metric really reflect the complexity degree of programs?

Through a series of experiments and tests, the proposed measure was evaluated

This was done by evaluating the complexity index and studying the difference between different revisions

The revisions of the sample programs provide the same functionality, but the code is simplified

Page 11: A Hierarchical Measure for Software Complexity

Testing the software tool and evaluating the proposed measure

Merge sort and Quick sort are more complex than Bubble sort and Insertion sort

Although the first two have better running times, but their source code is indeed more complicated

Page 12: A Hierarchical Measure for Software Complexity
Page 13: A Hierarchical Measure for Software Complexity

Revising/Refining the point assignment system in complexity evaluations rules

Taking nested loops into account for complexity measurement

Considering operators in addition to function calls?

Improving the plug-in and adding more features

Support for other languages

Page 14: A Hierarchical Measure for Software Complexity