SOFTWARE QUALITY IMPROVEMENT THROUGH DEFECT PREDICTION DR. DEEPAK KUMAR VERMA ASSISTANT PROFESSOR DEPARTMENT OF COMPUTER SCIENCE & INFORMATION TECHNOLOGY BABASAHEB BHIMRAO AMBEDKAR UNIVERSITY, (A CENTRAL UNIVERSITY) SATELLITE CAMPUS, AMETHI (U.P.), INDIA-227413 ABSTRACT Quality of a software product is correlated with the number of defects as well as it is limited by time and cost. Software defects are expensive in terms of quality and cost. Software defect prediction is the process of tracing defective components in software prior to the start of testing phase. Occurrence of defects is inevitable, but we should try to limit these defects to minimum count. Defect prediction leads to reduced development time, cost, reduced rework effort, increased customer satisfaction and more reliable software. Therefore, defect prediction practices are important to achieve software quality and to learn from past mistakes. Size or complexity measures are simple regression models, which normally assume simple relationship between defects and program complexity. Keywords: Defect Prediction, Software Quality, Defect Detection. INTRODUCTION A software defect is an error, flaw, bug, mistake, failure, or fault in a computer program or software that may generate an inaccurate or unexpected result. A project team always tries to produce a quality software product with zero or little defects. Quality of software cannot be achieved by identifying the bugs or errors only at the testing phase. Bugs are automatically injected at every phase of software development life cycle. So the detection of the bugs should be at every phase in place of only at the testing phase. High risk components within the software project should be caught as soon as possible, in order to enhance software quality. Software defects always increases the cost and time in completing a software product with expected quality. Moreover, identifying and rectifying defects is one of the most time consuming and expensive software processes. It is not practically possible to eliminate each and every defect but reducing the magnitude of defects and their adverse effect on the projects is achievable. Software defect prediction is the process of locating defective modules in software. To produce high quality software, the final product should have as few defects as possible. Early detection of The Career Planners 42
software defects could lead to reduced development costs and rework effort and more reliable software. So, the study of the defect prediction is important to improve software quality. Many organizations want to predict the number of defects (faults) in software systems, before they are deployed to gauge the likely delivered quality and maintenance effort. Fig. 1: A basic model of software development life cycle The fig. 1 shows a basic model of software development life cycle. A defect might originate in one development stage and be detected in the same or a later stage. For instance, a missing interface in a design specification could propagate to the coding stage, resulting in missing functionality in the code. We might detect this design defect during a design inspection, code inspection, unit test, function test, or system test. Because defect detection focuses on abstraction levels, we consider that primary defect detection activities are at the same level of abstraction and secondary defect detection activities are at a different level. For example, for design defects, design inspection and functional testing are primary activities, and code inspection and unit testing are secondary defect detection activities. The Career Planners 43
PROBLEM DEFNITION Defect prediction techniques vary in the types of data they require, some require little data and other requires more. Some use work product characteristics and others require defect data only. All the techniques have strengths and weaknesses depending on the quality of the inputs used for prediction. The problem occurs during the selection of defect detection method. The choice of defect detection method depends on factors such as the artifacts, the types of defects they contain, who s doing the detection, how it s done, for what purpose, and in which activities. Factors also include which criteria govern the evaluation. These factors show that many variations must be taken into account. When we search the evidence for the pros and cons of using some defect detection method, we must choose specific levels of these factors to guide the appraisal of empirical evidence. Most defect prediction techniques used in planning rely on historical data. Defect Detection Techniques V & V Operational (Post Deployment) Dynamic Static User discovered System Administration Inspection Tool Based Environmental Path Testing Scenario based Testing Module interface testing User Interface Testing Checklist-based Inspection Perspective-based Inspection Complexity Measures Language Compilers Design Measures Fagan based Inspection The Career Planners 44
OVERVIEW OF VARIOUS DEFECT PREDICTION TECHNIQUES Empirical defect prediction technique This technique predicts the number of defects per size (defect density). Defect density determines the number of defects per thousand lines of codes based on historical data. Defect discovery technique This technique describes the projections based on based on time or phases of defect density found in process onto a theoretical discovery curve. It predicts defect density by time period enabling the estimation of defects to be found in the test. This technique is found in the SWEEP and STEER models. Coqualmo technique This is a defect prediction model for the requirements, design and coding phases based on sources of introduction and discovery techniques used. The strength of this technique is that it predicts the defects for three phases. Requirement Defects Design Defects Code Defects Orthogonal defect classification technique Detection and Removal factors are automated analysis, people reviews and Execution testing / tool This technique is based on classification and analysis of defects to identify project status based on comparison of current defects with historical patterns, identify areas for process improvement based on analysis of defect types, Triggers, Impact and Source. The Career Planners 45
Fault proneness technique This technique focuses on analysis of work product attributes to plan for allocation of defect detection resources as inspection and testing. Product Characteristics Size Complexity Cohesion coupling Product History Number of defects found Number of modifications Amount of V & V Fault Proneness Capture Recapture technique This technique focuses on analysis of pattern of defects detected within an artifact by independent defect detection activities. This technique can be used as soon as data are available. Defect prevention technique This technique focuses on root cause analysis of most frequently occurring defects. Sample of defect reports are selected for in-depth casual analysis and actions can be taken to make process change or improve training to eliminate the root cause of defects and prevent their recurrence. Statistical process control technique This technique use the control charts to determine whether inspection performance was consistent with prior process performance in terms of selected attributes. METHODOLOGY USED Our prime objective is to predict defects without overrunning the estimated cost as well as without delaying scheduled delivery of software. As earlier we have discussed that a defect might originate in any development stage and it can be detected in the same or a later stage. The verification and validation is one of the most common and important defect detection technique should be implemented at every phase of the software development life cycle as a primary defect detection activity. If we implement the V & V process each phase then a number of bugs can be The Career Planners 46
disinfected at each phase. In this way less number of bugs will be transferred from one phase to the next phase of the development cycle. The early detection of bug decreases the cost, time, efforts and also helps in achieving the quality and reliability of the software. Fig.2: Implementation of V & V process in SDLC The Career Planners 47
In the above fig.2 we have shown the impact of implementing verification and validation technique at each phase. First of all on the basis of the analysis we have classified the ratio/amount of defects injected at each phase of SDLC for any given amount of total injected defects (suppose 100) in a software. Then we have implemented V & V process at each phase and near about 50% defects are removed at each phase. In this way if 10% defects are injected at Requirement phase then before moving to the next phase V & V process will remove 5 defects in this phase and remaining 5 defects will be transferred to the designing phase. Now in the design phase 30% defects have been injected then total 35 defects will be processed by V & V process of design phase and 18 defects (50%) have been removed. Remaining 17 defects have been transferred to the coding phase. Due to most defect prone phase of SDLC 50% defects have been injected in this phase. In this way total 67 defects have been processed by V & V and 34 defects (50%) have been removed in this phase. Remaining 33 defects have been transferred to the testing phase. And now in testing phase 10% defects have been injected so total defects in this phase will be 43 and have been processed by V & V and 22 defects (50%) have been removed in this phase. The remaining 21 defects have been latent and these defects will be removed via post deployment techniques during feedback and maintenance. CONCLUSION AND FUTURE WORK Defect prediction techniques are very useful in producing quality software. With the help of the defect prediction techniques we can improve the quality and reliability of the software. Also the defect prediction leads to high quality software, reduced cost, reduced maintenance, more customer satisfaction. Data mining techniques are useful in prediction of defect repair time, Software bug estimation more accurately, and predicting the number of bugs in multi version environment i.e. language and platform independent. After studied of various data mining techniques and defect density techniques we can propose a model for defect prediction based on data density and characteristics of the project/software. t1 ACKNOWLEDGEMENT With great pleasure I would like to express my special thanks of gratitude to Prof. Brijendra Singh (Head, Department of Computer Science, University of Lucknow, Lucknow) for his kind support. Further I would like to thanks to Dr. S. P. Kannojia (Assistant Professor, Department of Computer Science, University of Lucknow, Lucknow) for his expert guidance. Secondly I would also like to thank my parents and friends who helped me a lot in finishing this paper within the limited time frame. The Career Planners 48
REFERENCES [1] Naheed Azeem, Shazia Usmani, Defect Prediction Leads to High Quality Product, Journal of Software Engineering and Applications, 2011, pp.639-645. [2] Dr. Deepshikha Jamwal, Analysis of Software Quality Models for Organizations, International Journal of Latest Trends in Computing (E-ISSN: 2045-5364)Volume 1, Issue 2, December 2010. [3] Brijendra Singh, Suresh Prasad Kannojia A Model for Software Product Quality Prediction, Journal of Software Engineering and Applications, 2012, pp.395-401. [4] Khaled Musa1 and Jawad Alkhateeb, QUALITY MODEL BASED ON COTS QUALITY ATTRIBUTES, International Journal of Software Engineering & Applications (IJSEA), Vol.4, No.1, January 2013. [5] Mrinal Singh Rawat1, Sanjay Kumar Dubey, Software Defect Prediction Models for Quality Improvement:A Literature Study, IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 5, No 2, September 2012. [6] Ms. Puneet Jai Kaur, Ms. Pallavi, Data Mining Techniques for Software Defect Prediction, International Journal of Software and Web Sciences (IJSWS). [7] Ortega, M. Pérez, M.; Rojas, T., A Model for Software Product Quality with a Systemic Focus. The Career Planners 49