1 / 14

A Hierarchical Measure for Software Complexity

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

andra
Download Presentation

A Hierarchical Measure for Software Complexity

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Hierarchical Measure for Software Complexity Dirk Beyer Jeff Jiang Presented by: Ashgan Fararooy

  2. 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 • Based on variables defined and used in source code and arguments involved in each function call

  3. Overview 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

  4. Proposed Metric • 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

  5. Motivation 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

  6. Motivation • 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

  7. Implementation • 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

  8. Architecture and High Level Design

  9. Complexity Evaluation Rules • 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

  10. Validity • 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

  11. Case Study • 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

  12. Case Study

  13. Further Work • 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

  14. Thank you

More Related