Presentation is loading. Please wait.

Presentation is loading. Please wait.

Static Software Metrics Tool

Similar presentations


Presentation on theme: "Static Software Metrics Tool"— Presentation transcript:

1 Static Software Metrics Tool
For Java Course Project CS 6367 Fall 2016 Aaron Leonard

2 Why software metrics? Relation between software quality, measurements, and metrics Static Java software metrics tool Supported metrics Unsupported metrics Final plan Questions

3 What/Why software metrics?
Software quality, measurements, and metrics Metrics are how to measure quality Can be applied to project management

4 Software quality, measurements, and metrics
How good or how bad is my software Many conflicting definitions We can define attributes of quality and try to measure them Complexity Maintainability Presence of errors

5 Software quality, measurements, and metrics
Quantitative indication of some attribute we’re trying to measure Complexity How long to understand this code? Relative to another? Scale of 1 to 10? Number of hours? Maintainability How hard is it to add some feature / fix some bug? Presence of errors Number of bugs

6 Software quality, measurements, and metrics
Quantitative value of some measurement Where measurement indicates some attribute we're really interested in Give a concrete value that really is observed Some metrics may apply to more than one measurement Some experts may disagree on the usefulness of a given metric

7 Java software metrics tool
Static software metrics Just need to analyse the program source code off-line Using ASM framework As opposed to metrics derived from runtime behavior Time executing, memory, CPU load, exceptions thrown, etc… Test suite quality (you have to actually run it) Code coverage (studied much in the class)

8 Supported metrics

9 Lines of code Baseline for many attributes Complexity Maintainability
Number of errors Analogous to statement coverage in test suite metrics

10 Comments Presence of/lines of comment Related to maintainability

11 McCabe cyclomatic complexity
Number of paths in the control flow graph Analogous to branch coverage in test suite metrics Higher value is “more complex”

12 Halstead metrics Based on number of operations and operands Measures
Complexity Maintenance Number of bugs

13 Halstead volume Length = |operators| + |operands|
Vocabulary = |distinct(operators)| + |distinct(operands)| Volume = Length * log(vocabulary) Amount of code written Larger for same lines of code implies more complex code

14 Halstead Effort, Time, Bugs
Difficulty = distinct(operators)| / 2 * |operands| / |distinct(operands)| How hard the code is to understand Effort = Difficulty * Volume How hard is it to write the same code from scratch Time = Effort / 18 Value in seconds Bugs = Volume / 3000

15 Maintainability index
Show maintainability on scale of 1 to 100 Composition of other metrics ( ln(Halstead volume) * Cyclomatic complexity * ln(Lines of code)) * 100 / 171 Derivation Expert engineers rate software maintainability on scale of 1 to 100 Statistical analysis to combine the existing metrics to fit the expert opinion

16 Not supported Other complexity metrics Data flow
Comment quality metrics Is the comment useful? Or noise Object Oriented design metrics Design reusability Coupling Cohesion

17 Final implementation plan
Given a java .class directory, create an HTML report of the supported metrics Report would show break down by each package, class, and method All supported metrics are implemented But the report generation is not finished Finish final report write up

18 Questions / comments


Download ppt "Static Software Metrics Tool"

Similar presentations


Ads by Google