Predicting software defects in varying development lifecycles using Bayesian nets
Introduction
In [8] we reviewed the various approaches to software defect prediction. We concluded that traditional statistical approaches, such as using regression modelling alone, were inadequate. We proposed that causal models were needed for more accurate predictions. We described a simple Bayesian Net (BN) as an example of the kind of causal model needed for this purpose. Since then a number of authors, for example [3], [7], [24], have used BNs in various related aspects of software engineering management. Our own research has extended the use of BNs to more general software project management [13]. However, the original motivation of more accurate software defect prediction has continued to be an important focus of our research and this paper describes some of the most recent results in this area.
Following on from the early ideas presented in [8], in [12] we have shown how BNs can be used to predict the number of software defects remaining undetected after testing. This work led to the AID tool [22] developed in partnership with Philips, and used to predict software defects in consumer electronic products. Project managers use a BN-based tool such as AID to help decide when to stop testing and release software, trading-off the time for additional testing against the likely benefit.
Rather than relying only on data from previous projects, this work uses causal models of the Project Manager’s understanding, covering mechanisms such as:
- •
poor quality development increases the number of defects likely to be present,
- •
high quality testing increases the proportion of defects found.
Causal models are important because they allow all the evidence to be taken into account, even when different evidence conflicts. Suppose that few defects are found during testing – does this mean that testing is poor or that development was outstanding and the software has few defects to find? Regression-based models of software defects are little help to a Project Manager who must decide between these alternatives [8]. BN models allow back propagation of evidence to show the most likely causes of a given outcome. Data from previous projects are used to build the BN, with expert judgements on the strength of each causal mechanism.
In this paper, we extend the earlier work by describing a much more flexible and general method of using BNs for defect prediction. We also describe how the AgenaRisk [1] toolset is used to create an effective decision support system from the BN. An important limitation of the earlier work was the need to build a different BN for each software development lifecycle – to reflect both the differing number of testing stages in the lifecycle and the differing metrics data available. Given the work required to build a BN, this severely limits the practicality of the approach. To overcome this limitation, we describe a BN that models the creation and detection of software defects without commitment to a particular development lifecycle. We then show how a software development organisation can adapt this BN to their development lifecycle and metrics data with much less effort than is needed to build a tailored BN from scratch.
The contents of the remainder of the paper are as follows: in Section 2 we introduce BNs and show how they are used for causal modelling in software engineering. Section 3 introduces the idea of a ‘phase’ as a sub-part of a software lifecycle and shows how several phase models can be combined to model different lifecycles. The phase model is described in detail in Section 4; Section 5 shows how it is adapted to different development lifecycles. An experimental validation of defect predictions is described in Section 6.
Section snippets
Bayesian nets
A Bayesian net [14] (BN) is a directed acyclic graph (such as that shown in Fig. 1) together with an associated set of probability tables. The nodes represent uncertain variables and the arcs represent the causal/relevance relationships between the variables. We have adopted the convention in this paper that a dotted margin around a node indicates that it is a “link” node. The semantics of these nodes will be discussed in Section 3.2.
The BN of Fig. 1 forms a causal model of the process of
Varying the lifecycle
When we describe defects being inserted in ‘implementation’ and removed in ‘testing’ we are referring to the activities that make up the software development lifecycle. We need to fit a decision support system to the lifecycle being used, but practical lifecycles vary greatly. In this section, we describe how this can be achieved without having to build a bespoke BN for every different lifecycle. The solution has two steps: the idea of a lifecycle ‘phase’ modelled by a BN and a method of
Modelling a single phase
We describe the ‘phase-level BN’, which models a single software development phase, first giving an overview and then describing two parts of the BN in more detail.
Application methodology
There are two steps for applying the defect prediction model to a specific software development environment.
- 1.
Choose the ‘indicators’ used to judge the qualities of the different processes.
- 2.
Link together phase BNs to model the full lifecycle.
Validation
The toolset and models have been widely trialled by various commercial organisations, including those involved in the MODIST project [13], namely Philips, Israel Aircraft Industries (Tel Aviv) and QinetiQ (Malvern). In addition, Philips has recently completed a retrospective trial of 30 projects carried out at Bangalore.
Conclusions
We have shown how a wide variety of software lifecycles can be modelled using a Dynamic Bayesian Net, in which each time frame is a lifecycle ‘phase’ combining all software development activities in different amounts. This approach allows a BN for software defect prediction to be tailored to different software development environments. The AgenaRisk toolset makes this a practical approach, providing a formula language with standard statistical distributions that can be used to change the
Acknowledgements
This report is based in part on work undertaken on the following funded research projects:
- •
MODIST (EC Framework 5 Project IST-2000-28749),
- •
SCULLY (EPSRC Project GR/N00258),
- •
SIMP (EPSRC Systems Integration Initiative Programme Project GR/N39234),
- •
SCORE (EPSRC Project Critical Systems Programme GR/R24197/01),
- •
eXdecide (EPSRC Grant Reference: EP/C005406/1).
We also acknowledge the contributions of the following individuals: Patrick Cates, Manesh Tailor and Simon Forey from Agena, Geert Acke and Shoaib
References (22)
- et al.
On the use of Bayesian belief networks for the prediction of software productivity
Information and Software Techniques
(2003) - AgenaRisk: Advanced risk analysis for important decisions....
- O. Bangsø, P.H. Wuillemin, Top-down construction and repetitive structures representation in Bayesian networks, in:...
- S. Bibi, I. Stamelos, Software Process Modeling with Bayesian Belief Networks, in: Proceedings of 10th International...
- F. Cozman, E. Krotkov, Truncated Gaussians as Tolerance Sets, Technical Report CMU-RI-TRI, Robotics Institute, Carnegie...
- eXdecide: Quantified Risk Assessment and Decision Support for Agile Software Projects, EPSRC project EP/C005406/1,...
- Fan, Chin-Feng, Yu, Yuan-Chang, BBN-based software project risk management, Journal of Systems Software 73 (2004)...
- et al.
A Critique of Software Defect Prediction Models
IEEE Transactions on Software Engineering
(1999) - N.E. Fenton, M. Neil, SCULLY: Scaling up Bayesian Nets for Software Risk Assessment, Queen Mary University of London,...
- et al.
Probabilistic Modelling for Software Quality Control
Journal of Applied Non-Classical Logics
(2002)
Software Measurement: Uncertainty and Causal Modelling
IEEE Software
Cited by (149)
Exhaustive testing of safety-critical software for reactor protection system
2020, Reliability Engineering and System SafetyThe influence of employee training and information on the probability of accident rates
2019, International Journal of Industrial ErgonomicsExhaustive Test Case Generation for Nuclear Safety Software Based on the Software Logic Model
2024, Nuclear TechnologyDiagNNose: Toward Error Localization in Deep Learning Hardware-Based on VTA-TVM Stack
2024, IEEE Transactions on Computer-Aided Design of Integrated Circuits and SystemsAn efficient Bayesian network model (BNM) for software risk prediction in design phase development
2023, International Journal of Information Technology (Singapore)Software reliability prediction: A survey
2023, Quality and Reliability Engineering International