Назад в библиотеку

Analysis of software quality using software metrics

Authors: Ermiyas Birihanu Belachew, Feidu Akmel Gobena, Shumet Tadesse Nigatu
Source: International Journal on Computational Science & Applications (IJCSA) Vol.8, No.4/5, October 2018, 11–19 pp.

Abstract

Software metrics have a direct link with measurement in software engineering. Correct measurement is the prior condition in any engineering fields, and software engineering is not an exception, as the size andcomplexity of software increases, manual inspection of software becomes a harder task. Most Software Engineers worry about the quality of software, how to measure and enhance its quality. The overallobjective of this study was to asses and analysis’s software metrics used to measure the software productand process.

In this Study, the researcher used a collection of literatures from various electronic databases, availablesince 2008 to understand and know the software metrics. Finally, in this study, the researcher has beenidentified software quality is a means of measuring how software is designed and how well the softwareconforms to that design. Some of the variables that we are looking for software quality are Correctness,Product quality, Scalability, Completeness and Absence of bugs, However the quality standard that wasused from one organization is different from others for this reason it is better to apply the software metricsto measure the quality of software and the current most common software metrics tools to reduce thesubjectivity of faults during the assessment of software quality. The central contribution of this study is anoverview about software metrics that can illustrate us the development in this area, and a critical analysisabout the main metrics founded on the various literatures.

Introduction

Correct measurement is the prior condition in any engineering fields, and software engineering isnot an exception. Software metrics have a direct link with measurement in software engineering.According to De Marco; You can’t manage what you can’t measure! [1] And Campbell alsogives an emphasized the importance of measurement in software engineering by setting If youaren’t measuring, you aren’t managing — you’re only along for the ride [2].

Software metrics will reduce the subjectivity of faults during the assessment of software qualityand it provides a quantitative basis for making decisions about the software quality. Metrics arethe numerical value of software and it is used to predict the fault [3]. Software metrics occur file-level, class-level, component-level, method-level, process-level and quantitative values-levelmetrics [4], This helps the project manager and software engineers to find defects and makingthe prevention method for the defect.

Software metrics can be applied to each software development phase. During requirementanalysis software metrics can be developed, for instance, in order to determine cost estimationand resource needed. At the time of system design we also develop metrics in order to count function point. Metrics applied at implementation phase are also used to measure software size[5]. According to Vikas Verma , having software metrics have a number of benefits such asprovide a basis for estimation and facilitates planning ,a means for controlling status reporting,identifying risk areas and effectiveness and efficiency of testing[6].

Measuring the software project has a number of benefits for company it saves development effort,time and money. In addition to this for complex projects using metrics have easy to understand,identify common problems early, and manage resources [7].As mentioned above even if it has thebenefit there is also drawbacks that are better understanding (knowledge) and need a lot of effortand time. Software metrics enable software developers to analyze their code and makeimprovements if required. Metrics can be developed for software size, cost estimation, softwarequality, maintainability, defect analysis and software testing [5]. In this paper, we studied thestate of art of software metrics; specifically focus on the quality metrics to measure software’sboth product and process.

Statement of problems

Software defect is not only the quality of software, but also increase costs and suspend thedevelopment schedule. In addition to above, there could be many reasons for the system to befaulty; most of them are because of the human factor, mistake and errors made in designing orcoding by the peoples, data entry, documentation and communication failures. In order to solvethe most common human factors we shall use software fault prediction before us taking thesoftware systems to test and maintains.

Software testing is one of the most critical and costly phases of software development. Project managers need to know when to stop testing? and which parts of the code to test?". Theanswers to these questions would directly affect defect rates and product quality as well asresource allocation (i.e. Experience of test staff, how many people to allocate for testing) and the cost.

As the size and complexity of software increases, manual inspection of software becomes aharder task. In this context, alternative methods that are used to predict potential effects clearlyare software defect prediction. Since testing typically consumes 40 — 50% of development efforts,and consumes more effort for systems that require higher levels of reliability, it is a significantpart of the software engineering [8–10]. Software fault predictions used to solve the problemthat reduces the qualities software product. In this paper, we studied the software tester topredict and fix the bug before it is delivered to customers that assures the quality ofsoftware and evaluate the state of art of software metrics; specifically focus on the qualitymetrics to measure software’s product and process.

Objective

The primary objective of this study was to asses and analysis’s software metrics used to measuresoftware quality particularly software product and process.

Literature review

The first survey on software metrics was done by Kafura in 1985 and he suggests existing codemetrics, complexity metrics and validation metrics. Generally , in this survey work have shownthat the major relationships exist between the software metrics and quality attributes such as comprehensibility of code, error characteristics, length of coding time, and structural soundness[11].

According to Ming Chang et al [12] discussed the role of software metrics and softwaremeasurement for software quality. Authors also classified the software metrics according tovarious manners which are commercial, important, observation, measurement and softwaredevelopment. In addition to this, the author also discussed various methodologies which arearound 15 measurement methodologies and 24 types of testing with their definitions, formula and effects.

Poornima Gupta et al [13] presented the software fault prediction using artificial intelligencemethods and this research work focused on related work on software metrics particularly on AI approaches and software metrics.

Kunal Chopra et al [14] discussed about software metrics complexity using Ndepend to measuresoftware product such as size metrics, control flow metrics and data flow metrics. The final contribution of the researcher was introducing the most common known and used softwaremetrics proposed and evaluation their use in constructing models of the software development process.

Classification of software metrics

In order to measure the software from the requirement up to generating of source codes thesoftware metrics can be grouped as follows:

Product metrics (code metrics)

This is one of the software metrics that we are applied to measure the quality of the softwaresystems; mostly it measures the system final product such as software code or designdocumentation. It can be size metrics, the complexity metrics (Cyclomatic and Halsted). It canalso be internal or external attribute measurement of the products [5].

The external attributes include the parameter that is going to measure: software usability and re-usability, portability and efficiency and the internal attribute includes the size of the software,correctness, complexity, bugs and testability.

Size metrics

The size metrics is an attempt to quantify the ‘Size’ of software, and the widely used metrics is aLine of Code (LOC). The size metrics have some limitation because of it cannot be measured bythe process of development is completed. It measures the implementation of the project only. Thesize metrics are used to measure “volume, length, quantity, and overall magnitude of softwareproducts” [15]. The main strength of line of code metrics is easy to count extensively automatedfor counting and requires various software estimating tools while the drawbacks are may containdead code, blank and comments, mixed language projects and ambiguous software reuse [16].

Cyclomatic complexity metrics

The word Cyclomatic comes from a number of fundamental cycles in connected, undirectedgraphs [17]. This was proposed by McCabe for measuring the software especially for Designphase. McCabe described by viewing the program graph, and finding the number of paths toreach entire graph. If the complexity of the program become long, it is difficult to easily count thenumber of paths. Due to the above reason McCabe suggests counting the number of basic paths,which is Cyclomatic number. Cyclomatic complexity has two basic benefits which giving it thenumber of recommended tests for software and it is used in all phases of software developmentcycles, beginning for the design phase in order to achieve software quality parameters.

Cyclomatic complexity can be expressed as the equation shown on Fig. 1.

Figure 1 — Cyclomatic complexity equation

Figure 1 — Cyclomatic complexity equation

McCabe rule to count edge and nodes [18]:

To count the number of nodes and edges for graph McCabe sets the rule these are as follow:

Halstead metrics

Halsted suggested that measuring the software program by counting the number of operator andoperands in program. In order to measure operands and operator he developed the basic formulathat includes vocabulary, length and Volumes of the software the program [19].

Program Vocabulary: this includes the total number of operands and operator. Program vocabulary can be expressed in equation shown on Fig. 2.

Figure 2 — Program vocabulary equation

Figure 2 — Program vocabulary equation

Program Length: it refers to the total usage of ‘all’ operators appearing in the implementationplus the total usage of ‘all’ operands appearing in the Implementation. Program length can be expressed in equation shown on Fig. 3.

Figure 3 — Program length equation

Figure 3 — Program length equation

Program Volume: it refers to the size of the program. Program volume can be expressed in equation shown on Fig. 4.

Figure 4 — Program volume equation

Figure 4 — Program volume equation

Mathematically extracting attributes

The existing software metrics tools and how they internally measures the given source code havediscussed previously. Here, we focus on doing the measurement practically with sample code theproduct metrics (McCabe metrics, Halsted metrics and Line of source code). The programming language that we selected to show was C++, but it’s also possible to choose other programming language. Sample code to show how we can measure C++ code using software metrics tools is depicted in algorithm 1 (Fig. 5–7).

Figure 5 — Measuring source code via Halstead Metrics (p. 1)

Figure 5 — Measuring source code via Halstead Metrics (p. 1)

Figure 6 — Measuring source code via Halstead Metrics (p. 2)

Figure 6 — Measuring source code via Halstead Metrics (p. 2)

Figure 7 — Measuring source code via Halstead Metrics (p. 3)

Figure 7 — Measuring source code via Halstead Metrics (p. 3)

Process metrics

This is software metric that is used to measure the quality of the software system. It measures thesoftware development life cycles such as type of methodology, the staff status and the requiredtime to finalize the system. This is mainly measured in software development life cycles and itmeasures the parameter such as duration estimate, cost assessment, effort required, processquality and effectiveness/efficiency of the development process [5].

Object oriented metrics

Since object oriented programming becomes popular now a time; as it increases its popularitymost companies are going to use it, the complexity and fault proneness become a problem so thatthere is software metrics to resolve this problem before delivered to the customers. The mostknown object oriented metrics are Chidamber and Kemerer (CK) metrics [20]. Chidamber andKemerer (CK) metrics were designed to measure the object oriented having the feature such asinheritance, coupling, and cohesion[20]. The basic difference between OO metrics and Procedural one is quickly led to new kinds of software metrics aimed exclusively at OO projects [16]. The main advantage OO metrics are psychologically attractive and simple from complex OO projects[16]. The drawback OO metrics are do not support studies outside of the OO paradigm, full life-cycle issues, have not yet been applied to testing, maintenance and lack of automation [16]. In Fig. 8 below object oriented metrics and its description was discussed.

Figure 8 — Chidamber and Kemerer (CK) metrics and their descriptions

Figure 8 — Chidamber and Kemerer (CK) metrics and their descriptions

Currently existing software metrics tools

There is a number of software metrics tool in the market. The basic goal of these metrics is toupgrade the process of developing, maintaining and managing software’s. Some of them are opensourced while others are proprietary tools. The main differences that we were looking in each arelanguage support, platform support, licensing prices, supporting metrics, availability and licensetype. Simply we can conclude that metrics based assessment of a software program and measurestaken to improve its design differ considerably from tool to tool. For the purpose of determiningthe suitable metrics the researcher passes through free searching on internet and finally they havegot around 46 metrics [21]. Some of them are mentioned in Fig. 9 below.

Figure 9 — Summary

Figure 9 — Summary

Conclusion and future work

In software development, software testing is highly desirable to assure the quality of the softwareproduct. Software testing performed via manual and software metrics, the former one (manual) is costly and it required high time interval to perform it because of it now a day software engineermoves to systematic measurement method which is software metrics. This study conducted to reveal to asses and analysis’s software metrics used to measure software quality particularlysoftware product and process. Software metrics used to measure the software product andprocess. The researcher used a collection of literatures from various electronic databases whichavailable since 2008 to understand and know the software metrics; the researcher has beenidentified software quality is a means of measuring how software is designed and how well thesoftware conforms to that design. Some of the variables that we are looking for software qualityare Correctness, Product quality, Scalability, Completeness and Absence of bugs, However thequality standard that was used from one organization is different from others for this reason it isbetter to apply the software metrics to measure the quality of software and the current mostcommon software metrics tools. In the future the researcher recommends the specific applicationarea of each software metrics and how can perform by the researcher to enhance the quality ofsoftware applications.

References

  1. D. a. Tom, Controlling Software Projects. New York: Yourdon Press, 1986.
  2. Campbell , Luke, and B. K, Software Metrics: Adding Engineering Rigor to a Currently EphemeralProcess 1995.
  3. Pooja P and D. A. Phalke, Survey on Software Defect Prediction Using Machine LearningTechniques, International Journal of Science and Research, vol. 3, December 2014
  4. Malkit S and D. S, Software Defect Prediction Tool based on Neural Network InternationalJournal of Computer Applications, vol. 70 2013.
  5. H. R. Bhatti, Automatic Measurement of Source Code Complexity, MASTER'S THESIS Computer Science and Engineering Lulea University of Technology.
  6. Vikas V and S. M, Applications of Software Testing Metrics In Constructing Models Of The Software Development Process Journal of Global Research in Computer Science, vol. 2 pp. 96–98 May 2011.
  7. Fernando, Wijayarathne, M. D. Fernando, and I. Guruge, The Importance of Software Metrics: Perspective of A Software Development Projects In Sri Lanka, SAITM Research Symposium onEngineering Advancements, 2014.
  8. C. Z. a. Q. SHICHAOZHANG, Data Preparation for Data Mining Applied Artificial Intelligence vol. 17, pp. 375–381 2003.
  9. S. Shivaji, Efficient Bug Prediction and Fix Suggestions PhD A dissertation UNIVERSITY OFCALIFORNIA 2013.
  10. Chayanika S, Sangeeta S, and R. S, A Survey on Software Testing Techniques using GeneticAlgorithm, International Journal of Computer Science vol. 10, pp. 381–393, January 2013.
  11. D. Kafura, A survey of software metrics presented at the ACM annual conference on The range of computing New York 1985
  12. Ming Chang Lee and T. Chang, Software Measurement and Software Metrics in Software Quality,"International Journal of Software Engineering and Its Applications, vol. 7, 2013
  13. Poornima Gupta and P. Sahai, A Review on Artificial intelligence Approach on Prediction ofSoftware Defects, International Journal of Research and Development in Applied Science andEngineering vol. 9, February 2016.
  14. Kunal Chopra and M. Sachdeva, EVALUATION OF SOFTWARE METRICS FOR SOFTWAREPROJECTS INTERNATIONAL JOURNAL OF COMPUTERS & TECHNOLOGY vol. 14, April2015
  15. S. D. Conte , a. V. Y. Shen, and W. M. Zage, A Software Metrics Survey in Technical Reports P.U. C. Science, Ed., ed, 1987.
  16. C. J, Strengths and Weaknesses of Software Metrics Software Productivity Research LLC, 2006
  17. A. H. and and T. J, Structured Testing: A Testing Methodology using the Cyclomatic ComplexityMetric National Institute of Standards and Technology Gaithersburg, September 1996
  18. H. B. KLASKY, A Study of Software Metrics The State University of New Jersey NewBrunswick2003
  19. J. Cahill, J. M. Hogan, and R. Thomas, Predicting Fault-Prone Software Modules with Rank Sum Classification, pp. 211–219, 2013.
  20. R. C. and and F.Kemerer, A Metrics Suite for Object Oriented Design IEEE Transactions on Software Enginneering vol. 20, 1994.
  21. Rudiger L, Jonas L, and W. L, Comparing Software Metrics Tools, ACM, July 2008.
  22. (Monday, August 01, 2016). Analyst4j Find Using Metrics Available: www.codeswat.com
  23. Syntegrico. Analyst4j Find Using Metric.
  24. (Friday October 30, 2015). CCCC Software metrics Available:http://www.sourceforge.net/projects/cccc/
  25. (Friday October 30, 2015). Chidamber and Kemerer Java Metrics Available:http://www.spinellis.gr/sw/ckjm/
  26. (Friday, October 30, 2015). Eclipse Metrics Plug-in 1.3.6. Available:http://sourceforge.net/projects/metrics/
  27. (Friday, October 30, 2015). Eclipse Metrics Plug-in 3.4 Available: :http://eclipse- metrics.sourceforge.net/
  28. Jarallah S, Raimi A, and Rufai and Sohel M, OOMeter: A Software Quality Assurance Tool Proceedings of the Ninth European Conference on Software Maintenance and Reengineering 2005
  29. (Friday, October 30, 2015). Semmle Available: http://semmle.com
  30. (Monday, August 01, 2016). SciTools Source Code Analysis and Metrics, Understand for Java.Available: www.scitools.com