Software Metric produces a numeric value or profile for an
attribute of a software component, system, or process
examples :
- Size of a product in lines of code
- the Fog index (Gunning, 1962), which is a measure of the readability of a passage of written text
- the number of reported faults in a delivered software product
- number of person-days required to develop a system component
Metrics facilitate prediction, costing, and management decision-making on the process, and expected products.
By comparing the values produced in measurement they can compare to the standards that apply across an organization, you may be able to draw conclusions about the quality of software, or assess the effectiveness of software processes, tools, and methods
produce an example of using a metric in a project:
example, say an organization intends to introduce a new software-testing tool. Before introducing the tool, you record the number of software defects discovered in a given time. This is a baseline for assessing the effectiveness of the tool. After using the tool for some time, you repeat this process. If more defects have been found in
the same amount of time, after the tool has been introduced, then you may decide that it provides useful support for the software validation process
Software Metrics – 2 Types
- control metrics (aka Process Metrics) - support process management
eg : average effort and the time required to repair reported defects - predictor metrics ( aka Product Metrics)- help you
predict characteristics of the software
eg : cyclomatic complexity of a module ,
average length of identifiers in a program,
number of attributes and operations associated with object classes in a design
How Metrics are use din each SDLC stage
- requirements analysis and specification
- design phase
- implementation and testing phase
stakeholders to release the product early, in the sure knowledge of the number and timing of patches that would follow in terms of maintenance.
- maintenance phase
Directly Measurable Quality attributes
Depth of Inheritance Tree
Cyclomatic Complexity
No of Errors/ error messages
Program size in No of Lines of Code
Length of user manual
Indirectly Measurable Quality attributes
Maintainability , Reliability ,Reusability , Usability
but there many be relationships between external and internal attributes, so we can indirectly measure them
Now lets talk about few product metrics
Product metrics have 2 classes
1. Dynamic metrics, which are collected by measurements made of a program in execution. Dynamic metrics help to assess the efficiency and reliability of a program
eg : number of bug reports or the time taken to complete a computation
2. Static metrics, which are collected by measurements made of representations of the system, such as the design, program, or documentation. Static metrics help assess the complexity, understandability, and maintainability of a software system
eg : code size and the average length of identifiers used
Some descriptions of Static Metrics
*** Cyclomatic complexity is a software metric, used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code.Lower the Program's cyclomatic complexity, lower the risk to modify and easier to understand
lets do a simple calculation of Cyclomatic Complexity
Cyclomatic complexity = E - N + 2*P where, E = number of edges in the flow graph. N = number of nodes in the flow graph. P = number of nodes that have exit points
The Cyclomatic complexity is calculated using the above control flow diagram that shows
seven nodes(shapes) and
eight edges (lines),
One exit point
hence the cyclomatic complexity is 8 - 7 + 2 = 3
questions to try :
March 2017 A1
a) Write a brief overview of the various forms of software process metrics
available today, and discuss how they might be usefully employed from the
initial project stages, through to the commissioning of a new system.
Illustrate your answers with examples.
c) Consider the following software attributes: Maintainability, Cyclomatic complexity,
Lines of Code count (LOC), Reliability, Number of errors. Which of these attributes can be measured directly and which indirectly?
Justify your answers.
Thanks for sharing,this blog makes me to learn new thinks.
ReplyDeleteinteresting to read and understand.keep updating it.
Selenium Training in Chennai
Selenium Training Institute in Chennai
JAVA Training in Chennai
Python Training in Chennai
Big data training in chennai
IOS Training in Chennai
Selenium Training in Annanagar