Software Engineering Lecture 17 Software Metrics 1 What

  • Slides: 11
Download presentation
Software Engineering Lecture 17 Software Metrics 1

Software Engineering Lecture 17 Software Metrics 1

What is a Software Metric? • Quantitative measure of the quality of software. •

What is a Software Metric? • Quantitative measure of the quality of software. • Measure of the difficulty of testing, understanding, or maintaining a piece of software • Measure of ease of using software 2

Size Metrics The larger the more complex – There are many ways to define

Size Metrics The larger the more complex – There are many ways to define size of a program 1. Lines of Code (LOC) Standard definition of LOC – Count number of lines and data definitions – Do not count comment lines – Count a line containing both a statement or part of a statement and a comment as an executable line. 3

Problems with LOC • Lack of a Standard definition for line of code. •

Problems with LOC • Lack of a Standard definition for line of code. • Application written in multiple language. • Size variation due to individual programming style. 4

Size Metrics 2. Number of Tokens -- A detailed measure of size Size of

Size Metrics 2. Number of Tokens -- A detailed measure of size Size of program is number of tokens, where a token is a – lexical token – keyword, arithmetic operator, constants, grouping symbol such as parenthesis or bracket and so forth) 5

Data Structure Metrics A count of amount of data input to , processed in,

Data Structure Metrics A count of amount of data input to , processed in, and output from software is called data structure metrics. 6

Information Flow Metrics • A coupling module increases with the complexity of interface and

Information Flow Metrics • A coupling module increases with the complexity of interface and the total number of modules a module is coupled with. • We want a metric that is better at quantifying coupling between modules. • The information flow metrics attempt to define the complexity in terms of the total information flowing through a module 7

 • The complexity of module is considered as depending on the intra module

• The complexity of module is considered as depending on the intra module complexity and the inter module complexity. • intra module complexity- size of the module in LOC • inter module complexity- Total information flowing in the module(inflow) and total info flowing out of the module(outflow 8

 • Design complexity • Dc= size*(inflow*outflow)raise to the power 2 • Module complexity

• Design complexity • Dc= size*(inflow*outflow)raise to the power 2 • Module complexity also depends upon no of modules to or from which it is flowing. • Dc= fan_in*fan_out+inflow*outflow • Fan_in- the no of modules that call this module • Fan_out- no of modules this module calls 9

Error prone Dc > avg_complexity+ std_deviation Complex Avg_complexity <DC<Avg_complexity+std_deviation Normal Otherwise 10

Error prone Dc > avg_complexity+ std_deviation Complex Avg_complexity <DC<Avg_complexity+std_deviation Normal Otherwise 10

Function Points Weighted sum of following: 1. External inputs - provided by user that

Function Points Weighted sum of following: 1. External inputs - provided by user that describe distinct application-oriented data (e. g. file names) 2. External outputs - items provided to user that generate distinct application-oriented data (e. g. reports) 3. External inquiries - interactive inputs requiring a response 4. External files - machine readable interfaces to other systems 11 5. Internal files - logical master files in the system