Abstract:
A software predictive engine is described that provides a tool to analyze the import of defects in the software development process. By providing a prediction of escaping defects, in terms of the normalized sigma measure and the predicted lines of code, together with historical data the impact of defects at the stages of the design can be predicted. As actual defects are measured predicted sigma level can also be predicted. The engine includes generating a defect containment matrix for the historical data and for the current software program being developed.

Description:
This application claims priority under 35 USC §119(e)(1) of provisional application No. 60/008,116, filed Oct. 30, 1995. 
    
    
     NOTICE 
     Copyright© 1994 Texas Instruments Incorporated 
     A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the United States Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. 
     TECHNICAL FIELD OF THE INVENTION 
     This invention is related to a method and apparatus for predicting product defects. 
     BACKGROUND OF THE INVENTION 
     Texas Instruments Incorporated Defense Systems and Electronics Group (DSEG), a 1992 Malcolm Baldrige Quality Award Winner, has developed both the technology and deployment infrastructure for a quality initiative named Six Sigma. Aimed at measuring and reducing variation in a product or service, this technology has allowed many Texas Instruments disciplines, including software development, to quantify progress towards zero defects. Six Sigma originated with a concept that variation in a product or service is the culprit behind defects. Consequently, one can begin with customer requirements and identify units of product or service in which opportunities for defects and actual defects are itemized. Through simple computations, a sigma level of performance may be identified. Higher sigma values represent higher quality levels. Six Sigma performance is equivalent to no more than 3.4 defects per million opportunities. But why do we care about Six Sigma? In terms of cost of quality, a Four Sigma organization cannot compete with a Six Sigma organization A Four Sigma organization will spend as much as 25% of each sales dollar on cost of non-conformance while a Six Sigma organization will spend less than 1%. Organizations performing at Four Sigma will spend 25 times more dollars on rework, etc. than a Six Sigma organization will. Additionally, Six Sigma analysis supports defect causal analysis, prevention and prediction. It has been incorporated into our process improvement program and is part of a widespread training program for all employees of Texas Instruments DSEG. Over the past 5 years, we believe that this technology contributed to our 10X improvement in software fault density. Six Sigma measurement begins with the customers and their requirements. Defect categories may then be identified along with units of product or service. From this framework, defects per unit, opportunities for defects, defects per million opportunities and sigma levels may be computed. Defects per million opportunities (DPMO) may be computed by simply dividing the defects per unit (DPU) by the opportunity count (source lines of delivered software) and then multiplying by 1 million. 
     The number of defects per million opportunities (DPMO) may be converted into a Sigma level via use of a conversion chart as shown in FIG.  1 . Note that changes in the DPMO levels are not linearly proportional to the Sigma levels. Thus, for an organization of higher levels of sigma performance, smaller amounts of DPMO improvement are needed to achieve the same sigma improvement as that of an organization at a lower level of sigma performance. Sigma measures support benchmarking of quality levels. 
     In the development of software there are generally at least five stages—the first being the requirement stage (RA); the second being the preliminary design stage (PD); the third being the design detail stage (DD); the fourth being the coding stage (CUT), and the fifth being the integrating and testing stage (I&amp;T). Defects in software development activity represent rework, resulting in increased cost and cycle times. 
     While it is known to make estimates of escaping defects mode during a latter phase of integration and test using Weibull curve fittings, there is no known solution for long range prediction of the number of escaping defects. 
     SUMMARY OF THE INVENTION 
     In accordance with one preferred embodiment of a present invention, there is provided a method and statistical tool apparatus for predicting defects in products. The method according to one embodiment includes the step of providing historical data of defects at different stages of development and a value representing a goal for escaping defects. Also provided is the planned total number of opportunities for defects. The goal for number of escaping defects and planed number of opportunities for defects are backsolved to determine the total number of defects. The total defects are distributed as a function of the historical data to provide prediction of defects at the different stages of development. 
     The apparatus according to one preferred embodiment of the present invention comprises a processor, a memory, a keyboard, a drive for loading a software package and a display. The processor is loaded with a program for storing historical data indicating the historical pattern of defect containment in the stages of development. The processor has stored therein algorithms for computing sigma values based on opportunities and escaping defects in the stages and including an algorithm for backsolving from historical data. 
     These and other features of the invention will be apparent to those skilled in the art from the following detailed description of the invention, taken together with the accompanying drawings. 
    
    
     DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a conversion chart of DPMO to Sigma; 
     FIG. 2 is a diagram of the personal computer used for the engine according one embodiment of the present invention; 
     FIG. 3 is a system diagram according to one embodiment of the present invention; 
     FIG. 4 is a flow chart of the operation according to one embodiment of the present invention; 
     FIG. 5 illustrates defect flow analysis; 
     FIG. 6 illustrates the historical sheet; 
     FIG. 7 illustrates the current sheet; 
     FIG. 8 illustrates a summary sheet; and 
     FIG. 9 illustrates a current sheet with equations embedded therein. 
    
    
     DESCRIPTION OF PREFERRED EMBODIMENT 
     The Software Sigma process according to the present invention stresses defect prevention, monitoring of defect levels, causal analysis for process improvement, and the sigma metric to predict, early in the development cycle, the level of escaping defect delivered with the product. A unique aspect of the statistical model we construct to predict escaping defects is the use of project defect phase containment data in a dual manner. As historical data, phase containment data, converted to conditional probabilities, is used to model the current state of a projects software process&#39;s effectiveness to prevent and capture defects. During the development phase, actual phase containment data is captured and utilized to make the prediction of escaping defects from the finished product. 
     Variation in performance of a quality attribute causes defects. Performance of a quality attribute is often assumed to follow a normal distribution (bell shape curve) which is centered on a given mean (average) value. The potential for defects arises when the tails of the performance curve fall outside given specification limits. Adapted to software, there is no assumption made about distribution normality. In fact, distributions of interest appear to follow Poisson or Weibull distributions. 
     In accordance with one embodiment of the present invention, a software sigma predictive engine is provided for predicting defects in software. The engine comprises, for example, a personal computer (PC)  19  with a processor  11 , a storage unit  13  (such as a disk drive), a monitor  15 , and input device such as a keyboard  17  and mouse  17   a  as shown in FIG.  2 . The processor is loaded with a software spreadsheet program such as Microsoft Excel 5.0. The operation is implemented as a workbook in three sheets. The user enters data in two sheets, the historical sheet  21  and the current sheet  23 . See diagram in FIG. 3. A third sheet  27 , the summary sheet, automatically summarizes the decisions made, actual observed defects, the predicted number of escaping defects, and statistical confidence intervals qualifying the “goodness” of the prediction. There is also a fourth sheet or page which contains the original computer program to calculate the Poisson probabilities. 
     In accordance with one embodiment of the present invention illustrated by the flow chart of FIG. 4, historical defect containment data is entered (step A) in the cells of Excel 5.0 as a workbook in the historical sheet as a stage defect containment matrix. The user enters historical defect containment data for the various stages of design in a defect containment matrix at cell locations. This is arrived at from previous designs and detections of defects at these stages. Based on estimated efficiency of detection of defects entered (Step B), the inspection efficiencies are calculated and copied to the second sheet or page called the current sheet  27 . The estimated overall efficiency of the process to detect DPU of each type over all stages is entered. The number of software lines of code (SLOC) is entered on the current workbook sheet  23  (step C) and the goal sigma value is entered on the current workbook sheet  23  (step D). Each SLOC represents a defect opportunity. Based on the goal sigma values and lines of code (SLOC) entered the total number of observed defects are calculated. The initial distribution of these defects is calculated using probability P ij  (step E) of a defect in ith step of being detected and removed in jth step. The upper bounds for initial defect spread is calculated (step F) and the lower bounds for initial defect spread is calculated (step G). The defect spread is copied down to the actual locations in the current sheet (step H). The confidence interval is then calculated (step I). The statistical model used views the number of defects generated in each stage as Poisson random variables which are independent between the different stages of the development process. These random numbers of defects are then subjected to the random process of defect detection and the resulting number of detected, and undetected, defects are random variables whose distributions remain Poisson. The total number of detected defects, as well as the total number of escaping defects, then can be represented as the sum of independent Poisson random variables and it is this that makes it possible to develop an unbiased estimator for the mean number of escaping defects. An estimate of the variance of the estimator, along with the asymptotic normality of its distribution, allows for the calculation of an approximate statistical confidence interval for the mean number of escaping defects, as well as an approximate prediction interval for the actual number of escaping defects. These estimates and intervals are automatically calculated and displayed in the spreadsheet, along with corresponding estimates and intervals for the process sigma level. The initial prediction is up-dated (step J) with actual data until all actuals have been entered (step K). As the design progresses and actual defects are measured the actual defects are compared to the error bounds to determine if there is consistency between the data and the model and to see if the sigma goal will be reached. 
     Referring to FIG. 5, there is illustrated the defect flow analysis for a software design project which starts with RA as a requirement and proceeds to the second Step PD, which is preliminary design, which proceeds to a detailed design (DD) which then proceeds to actual generation of code (CUT) and then to the fifth step of integration and test (I&amp;T). FIG. 5 indicates the defect data flow model used to estimate the number of escaping defects for a typical software product. Some of the final defects from the requirements (RA) escape through the preliminary design, the detailed design, the coding and integration and test. Likewise some uncorrected defects in the preliminary design (second line) escape and pass on to detailed design, through the coding, and through integration and test. Some defects at the detailed design escape through coding and integration and test. Some coding errors escape through integration and test. Some integration and test errors escape. The total escaped defects per million opportunities is the defects per million opportunities (DPMO) which is converted to the Sigma level. 
     The historical sheet shown in FIG. 6 is the primary location for loading historical data to prime the pump in preparation for the collection of actual defect data during the project. The primary software sigma measure is defects per unit (DPU). When we associate opportunities and a chance for non-conformance, we are providing a measure of complexity that allows us to compare products of different size. The use of opportunities as a common denominator to compute defects per million opportunities (dpmo) is a way to normalize the different sizes between both intermediate and final product. Enter in cells C 4 :G 8  of Excel 5.0 historical workbook sheet the defects for each stage observed from historical data or best engineering judgement. This data represents the pattern of defects detected across the project phases. For example the defects originated at requirements stage RA and detected at RA is  30 . The defects detected at Integration and Test originated  1  at RA,  1  at PD,  5  at DD,  17  at CUT, and  3  at I&amp;T. It represents the pattern most likely to occur and is transformed into conditional probabilities in cells C 15 :G 19  labeled “inspection efficiencies”. These probabilities are automatically calculated in cells C 15 :G 19  of the historical sheet: and are copied onto the current and summary sheets. Represented as percentages, these are the conditional probabilities that a defect generated in a prior or same stage will be observed in the current stage. For example, the total RA defects is 64 and the defect at C 4  is 30 so the percentage is 30/64×100%=47. These percentages are then derated by the estimated efficiencies. The percentages listed represent derating of perfect capture which the conditional probabilities would suggest. In fact, the conditional probabilities are adjusted by the estimated efficiency percentages to indicate that our observations are not 100% efficient. These multipliers may be estimated for programs with complete data, but without that one must use best engineering judgement. The spreadsheet shown in FIG. 6 has these values preset at 95% for requirements DPU, 94% for preliminary design defects, 93% for detailed design defects, 92% for code and unit test and 90% for integration and test. Screening effectiveness percentages are conditional probabilities estimated from historical stage containment data and may be revised. 
     The initial values in the current sheet (FIG. 7) allow the developer to model his environment and the effect in terms of DPU for given values of screen effectiveness and assumed sigma for the product. As actual data is entered for each phase, it overrides the DPU computed by the spreadsheet, which were needed to obtain the assumed goal sigma. From this point in time forward, to improve the product&#39;s sigma it is necessary to reduce the DPU observed at each stage by improved software process steps. The screen detection probabilities may be increased by improving the screens ability to detect both in-stage and out-of-stage DPU. The process is improved by finding most DPU in early stages of development. 
     The product name, delivered SLOC (Software Lines of Code) and goal sigma are entered at E 4  and E 5  in the shaded blocks at the top of the current sheet illustrated in FIG.  7 . Note that the goal sigma may be based upon Fault Density Data of similar products or be the development goal the project expects to attain. 
     The DPU count by percentage in the historical sheet based on defects observed are computed and copied to in the current sheet. These percentages are used to spread the DPU in the following cells with planning DPU spread by stage. The percentages may be adjusted to reflect engineering judgement if required. 
     Using the percent spread, knowledge of the goal sigma of E 5 , the delivered SLOC E 4  and the probabilities of detection, the engine back calculates the DPU needed in each phase to reach the sigma goal. These DPU are copied to the cells (C 51 , G 55 ) called “defects observed” where actuals will overwrite these estimates as they are received. Note that the number of DPU passed to the next phase and the number generated (greater than observed) are also indicated below these cells. First the total DPU are calculated from the sigma value and SLOC and then based on percentage in C 10 :G 14 . The initial values in C 51 :G 55  are entered. This predictive framework is based on assumptions. 
     Assume a process has N steps or stages. In step i, L i  defects are introduced. Assume L i  has a Poisson distribution with mean λ i  and that L i  and L j  are independent for i≠j. Assume also that a defect introduced in the ith step has a probability P ij  of being detected and removed in the jth step, j≧i, and that the detection of defects forms a Bernoulli process and the detection of one defect is independent of the detection of other defects. It can be shown that the number of defects detected in stage, K ii , has a Poisson distribution with mean λ i P ii  and that the number of defects escaping from the stage they were introduced, L i −K ii , has a Poisson distribution with mean λ i (1−P ii ). Furthermore, it can be shown that these random variables are independent. 
     This leads to the fact that the numbers of defects of a specific origin, found in each stage, have Poisson distributions and are all independent of each other. Since the number of defects which escape from step i to step i+1, L i −K ii , has a Poisson distribution with mean λ i (1−P ii ), and since these defects each have a probability P ii+1  of being detected, the number of stage i defects detected in step i+1, K ii+1 , has a Poisson distribution with mean (1−P ii )P ii+1 λ i . In general, the number of step i defects detected (and removed) in the jth step is given by K ij  and has a Poisson distribution with mean (1−P ii )(1−P ii+1 ) . . . (1−P ij−1 ) P ij λ i . Furthermore, these K ij  are all independent. In addition, since they are simply the sum of independent Poisson variables, the total number of defects detected in each stage, the total number of detected defects introduced at each stage, and the total number of escaping defects all have Poisson distributions. 
     Let          L   i   *     =       L   1            ∑     j   =   i     N          K   ij                                
     be the number of step i defects which have not been detected after the Nth step. By induction, it can be shown that L i * has Poisson distribution. The mean of L i * is given by          λ   i   *     =         λ   i            ∏     j   =   i     N          (     1   -     P   ij       )         =           λ   1          (     1   -     P   ii       )            (     1   -     P     ii   +   1         )                   …                   (     1   -     P   iN       )       =       a   i          λ   i                                  
     where          a   i     =       ∏     j   =   i     N          (     1   -     P   ij       )                              
     Let          L   *     =       ∑     i   =   1     N          L   i   *                              
     be the total number of escaping defects. Since the L i * are independent Poisson variables, L* has a Poisson distribution with mean          λ   *     =         ∑     i   =   1     N          λ   i   *       =         ∑     i   =   1     N            λ   i            ∏     j   =   i     N          (     1   -     P   ij       )           =       ∑     i   =   1     N            a   i          λ   i                                    
     Estimators 
     As stated before, the K ij  are independent, Poisson variables with means            (     1   -     P   ii       )          (     1   -     P     ii   +   1         )                   …                   (     1   -     P     ij   -   1         )          P   ij          λ   i       =           a   i          P   ij          λ   i           b   ij     =       ∏     k   =   j     N          (     1   -     P   ik       )           =         a   i          P   ij          λ   i         b   ij                                
     where          b   ij     =       ∏     k   =   j     N          (     1   -     P   ik       )                              
     This means that          K     i   .       =       ∑     j   =   i     N          K   ij                              
     the total number of defects from stage i which were detected, has a Poisson distribution with mean and variance given by:          E        (     K     i   .       )       =         a   i          λ   i            ∑     j   =   i     N              P   ij       B   ij                     and                   Var        (     K     i   .       )             ==                  a   i          λ   i            ∑     j   =   i     N            P   ij       b   ij                                    
     The K i.  also form a sufficient statistic for estimating the λ i , and hence the λ i * and λ*. 
     The maximum likelihood estimators (MLE) for the λ i  are given by            λ   ^     i     =       K   i       a                     ∑     j   =   i     N            P   ij       b   ij                                    
     and this the MLE for λ* is given by            λ   ^     *     =         ∑     j   =   i     N              λ   ^     i   *            ∑     j   =   i     N            a   i            λ   ^     1             =       K   i       a                     ∑     j   =   i     N            P   ij       b   ij                                      
     Since          E        (       λ   ^     *     )       =         ∑     j   =   i     N            a   i          λ   i         =     λ   *                              
     {circumflex over (λ)}* is also an unbiased estimator of λ* with variance given by.          Var        (       λ   ^     *     )       =         ∑     j   =   i     N            Var        (     K   1     )           (       ∑     j   =   i     N            P   ij       b   ij         )     2         =       ∑     j   =   i     N              a   i          λ   i           ∑     j   =   i     N            P   ij       b   ij                                      
     which can be estimated by          Var        (       λ   ^     *     )       =       ∑     i   =   1     N            K   i         (       ∑     j   =   i     N            P   ij       b   ij         )     2                                
     For the above software development/inspection process N=5. Thus 
     
       
           a   1 =(1− P   11 )(1− P   12 )(1− P   13 )(1− P   14 )(1− P   15 ) 
       
     
     
       
           a   2 =(1− P   22 )(1− P   23 )(1− P   24 )(1− P   25 ) 
       
     
     
       
           a   3 =(1− P   33 )(1− P   34 )(1− P   35 ) 
       
     
     
       
           a   4 =(1− P   44 )(1− P   45 ) 
       
     
     
       
           a   5 =(1− P   55 ) 
       
     
     
       
         λ*=a 1 λ 1   +a   2 λ 2   +a   3 λ 3   +a   4 λ 4   +a   5 λ 5   
       
     
     and            λ   ^     *     =       K   i         a   i            ∑     j   =   i     5            P   ij       b   ij                                    
     with            λ   ^     *     =           a   1            λ   ^     1       +       a   2            λ   ^     2       +       a   3            λ   ^     3       +       a   4            λ   ^     4       +       a   5            λ   ^     5         =         K   1         ∑     j   =   i     5            P     1      j         b     1      j             +       K   2         ∑     j   =   2     5            P     2      j         b     2      j             +       K   3         ∑     j   =   3     5            P     3      j         b     3      j             +       K   4         ∑     j   =   4     5            P     4      j         b     4      j             +       K   5         P   55       b   55                       V        a   ^          r        (       λ   ^     *     )         =         K   1         (       ∑     j   =   i     5            P     1      j         b     1      j           )     2       +       K   2         (       ∑     j   =   2     5            P     2      j         b     2      j           )     2       +       K   3         (       ∑     j   =   3     5            P     3      j         b     3      j           )     2       +       K   4         (       ∑     j   =   4     5            P     4      j         b     4      j           )     2       +       K   5         (       P   55       b   55       )     2                                
     The block of cells C 31 :G 35  are the upper limits and these are calculated based upon Poisson probability tails. The numbers represent upper bounds for actual DPU counts entered in the defects observed block or cells. The probability that one of the actual DPU values is greater than the corresponding upper bound cell, given our historical assumptions, is at most Alpha_U. In other words, there is at most an Alpha_U×100% chance that an actual number of defects will exceed the corresponding upper limit, given true historical assumptions. If several actuals, say n, exceed their corresponding upper bounds, then there is at most an (Alpha_U) n ×100% chance that the historical assumptions are correct. To reject the historical assumptions there are two alternatives hypothesis: 
     First, the DPU may exceed expected results due to superior process which is finding more DPU. 
     Second, the process is not as effective at preventing DPU from occurring in the process, resulting in more defects to be found. Only experienced engineering judgement can determine the correct conclusion. In any case, the DPU escaping and product sigma will be lower than the initial goal. A fourth page in Excel Macros contains the original computer programs to calculate Poisson probabilities. 
     The block of cells C 41 :G 45  are lower limits are calculated based upon Poisson probability tails. The numbers represent lower bounds for actual DPU counts entered in the defects observed block of cells. The probability that one of the actual DPU values is less than the corresponding lower bound, given our historical assumptions, is at most Alpha_L. To reject the historical assumptions there are two alternative hypothesis: 
     First, the DPU may be less than expected due to an inferior inspection process which is finding fewer defects than expected. 
     Second, the process is more effective than expected at preventing defects from occurring in the process, resulting in fewer defects to be found. Only experienced engineering judgement can determine the correct conclusion. 
     The block of cells C 51 :G 55  is initialized to the planning DPU spread by stage. As actual DPU data is collected by the project, it is entered to overwrite this data. Finally, the data contains only actual data and based upon actual data observed, the sigma of escaping DPU is calculated. 
     The confidence level E 58  represents the probability that the true values of DPU, dmpo, and sigma in the corresponding cells are within the upper and lower bounds indicated. The sigma interval labeled in this program represents a confidence interval predicting the sigma for escaping DPU based upon this programs actual data. The interval labeled average represents a confidence interval based upon repeating the experiment of collecting actuals multiple times for this program. The estimator can be used to generate an approximate confidence interval for the mean number of escaping defects, as well as an approximate prediction interval for the actual number of escaping defects. 
     The first block of cells in the Summary page as illustrated in FIG. 8 reminds the reviewer of the historical stage containment data which has been used to model process effectiveness at defect observation. The second block of cells represents the data set of actual stage containment DPU for the current project. This data resulted from overwriting the planning DPU spread on the current sheet into the defects observed block. The confidence level set on the current page is copied to the summary page. It represents the probability that the true values of DPU, dpmo, and sigma in the corresponding cells are within the upper and lower bounds indicated. The sigma interval labeled in this program represents a confidence interval predicting the sigma for escaping DPU based upon this programs actual data. The interval labeled average represents a confidence interval for the long-term average DPU level for all projects with the same defect generation and inspection characteristics. 
     In FIG. 9 there is illustrated a current sheet with equations behind the cells. Cells C 81 :G 86  calculate the total defects. The Poisson upper limits are cells C 31 :G 35 . The Poisson lower limits are in cells C 41 :G 45 . 
     Other Embodiments 
     Although the present invention and its advantages have been described in detail, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.