Skip to main content
Erschienen in: Empirical Software Engineering 5/2009

01.10.2009

On the relative value of cross-company and within-company data for defect prediction

verfasst von: Burak Turhan, Tim Menzies, Ayşe B. Bener, Justin Di Stefano

Erschienen in: Empirical Software Engineering | Ausgabe 5/2009

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

We propose a practical defect prediction approach for companies that do not track defect related data. Specifically, we investigate the applicability of cross-company (CC) data for building localized defect predictors using static code features. Firstly, we analyze the conditions, where CC data can be used as is. These conditions turn out to be quite few. Then we apply principles of analogy-based learning (i.e. nearest neighbor (NN) filtering) to CC data, in order to fine tune these models for localization. We compare the performance of these models with that of defect predictors learned from within-company (WC) data. As expected, we observe that defect predictors learned from WC data outperform the ones learned from CC data. However, our analyses also yield defect predictors learned from NN-filtered CC data, with performance close to, but still not better than, WC data. Therefore, we perform a final analysis for determining the minimum number of local defect reports in order to learn WC defect predictors. We demonstrate in this paper that the minimum number of data samples required to build effective defect predictors can be quite small and can be collected quickly within a few months. Hence, for companies with no local defect data, we recommend a two-phase approach that allows them to employ the defect prediction process instantaneously. In phase one, companies should use NN-filtered CC data to initiate the defect prediction process and simultaneously start collecting WC (local) data. Once enough WC data is collected (i.e. after a few months), organizations should switch to phase two and use predictors learned from WC data.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Fußnoten
1
Throughout the paper, the following notation is used: a defect predictor (or predictor) means a binary classification method that categorizes software modules as either defective or defect-free; data refers to MxN matrices of raw measurements of N metrics from M software modules; these N metrics are referred to as features.
 
2
Therefore, throughout the paper, the term “data” refers to static code features.
 
3
We should carefully note that we do not make use of any conceptual similarities, since our analysis is based on static code features. As to the issue of conceptual connections within the code, we refer the reader to the concept location and cohesion work of Marcus et al. (2008).
 
5
E.g. given an attribute’s minimum and maximum values, replace a particular value n with (n − min)/((max − min)/10). For more on discretization, see Dougherty et al. (1995).
 
6
In other languages, modules may be called “function” or “method”.
 
7
SOFTLAB data were not available at that time.
 
8
Details of this issue are out of the scope of this paper. For more, please see Table 1 in (Domingos and Pazzani 1997).
 
9
Caveat: We did not optimize the value of k for each project. We simply used a constant k = 10. We consider it as a future work to dynamically set the value of k for a given project (Baker 2007).
 
10
In order to reflect the use in practice, we do not use the remaining 90% of the same project for training, we rather use a random 90% of data from other projects. Please note that all WC analysis in this paper reflects within-company, not within project simulations. Since SOFTLAB data are collected from a single company, learning a predictor on some projects and to test it on a different one does not violate within company simulation.
 
11
That panel supported neither Fagan’s claim (Fagan 1986) that inspections can find 95% of defects before testing nor Shull’s claim that specialized directed inspection methods can catch 35% more defects that other methods (Shull et al. 2000).
 
12
TR(a,b,c) is a triangular distribution with min/mode/max of a,b,c.
 
13
Please note that we can only compare the defect detection properties of automatic vs manual methods. Unlike automatic defect prediction via data mining, the above manual inspection methods don’t just report “true,false” on a module, Rather, the manual methods also provide specific debugging information. Hence, a complete comparison of automatic vs manual defect prediction would have to include both an analysis of the time to detect potential defects and the time required to fix them. Manual methods might score higher to automatic methods since they can offer more clues back to the developer about what is wrong with the method. However, such an analysis is beyond the scope of this paper. Here, we focus only on the relative merits of different methods for predicting error prone modules.
 
Literatur
Zurück zum Zitat Boehm B, Papaccio P (1988) Understanding and controlling software costs. IEEE Trans Softw Eng 14(10):1462–1477, October 1988CrossRef Boehm B, Papaccio P (1988) Understanding and controlling software costs. IEEE Trans Softw Eng 14(10):1462–1477, October 1988CrossRef
Zurück zum Zitat Brooks FP (1995) The mythical man-month, Anniversary edn. Addison-Wesley, Reading Brooks FP (1995) The mythical man-month, Anniversary edn. Addison-Wesley, Reading
Zurück zum Zitat Duda R, Hart P, Nilsson N (1976) Subjective bayesian methods for rule-based inference systems. In: Technical Report 124, Artificial Intelligence Center, SRI International Duda R, Hart P, Nilsson N (1976) Subjective bayesian methods for rule-based inference systems. In: Technical Report 124, Artificial Intelligence Center, SRI International
Zurück zum Zitat Fagan M (1976) Design and code inspections to reduce errors in program development. IBM Syst J 15(3):182–211CrossRef Fagan M (1976) Design and code inspections to reduce errors in program development. IBM Syst J 15(3):182–211CrossRef
Zurück zum Zitat Fagan M (1986) Advances in software inspections. IEEE Trans Softw Eng 12:744–751, July 1986 Fagan M (1986) Advances in software inspections. IEEE Trans Softw Eng 12:744–751, July 1986
Zurück zum Zitat Fenton NE, Pfleeger S (1995) Software metrics: a rigorous & practical approach, 2nd edn. International Thompson, London Fenton NE, Pfleeger S (1995) Software metrics: a rigorous & practical approach, 2nd edn. International Thompson, London
Zurück zum Zitat Goseva K, Hamill M (2007) Architecture-based software reliability: why only a few parameters matter? In: 31st annual IEEE international computer software and applications conference (COMPSAC 2007), Beijing, July 2007 Goseva K, Hamill M (2007) Architecture-based software reliability: why only a few parameters matter? In: 31st annual IEEE international computer software and applications conference (COMPSAC 2007), Beijing, July 2007
Zurück zum Zitat Hall G, Munson J (2000) Software evolution: code delta and code churn. J Syst Softw 54(2):111–118CrossRef Hall G, Munson J (2000) Software evolution: code delta and code churn. J Syst Softw 54(2):111–118CrossRef
Zurück zum Zitat Halstead M (1977) Elements of software science. Elsevier, AmsterdamMATH Halstead M (1977) Elements of software science. Elsevier, AmsterdamMATH
Zurück zum Zitat Khoshgoftaar TM, Seliya N (2003) Analogy-based practical classification rules for software quality estimation. Empirical Softw Eng 8(4):325–350CrossRef Khoshgoftaar TM, Seliya N (2003) Analogy-based practical classification rules for software quality estimation. Empirical Softw Eng 8(4):325–350CrossRef
Zurück zum Zitat Khoshgoftaar T, Seliya N (2004) Comparative assessment of software quality classification techniques: an empirical case study. Empirical Softw Eng 9(3):229–257CrossRef Khoshgoftaar T, Seliya N (2004) Comparative assessment of software quality classification techniques: an empirical case study. Empirical Softw Eng 9(3):229–257CrossRef
Zurück zum Zitat Kitchenham BA, Mendes E, Travassos GH (2007) Cross- vs. within-company cost estimation studies: a systematic review. IEEE Trans Softw Eng 33:316–329, May 2007CrossRef Kitchenham BA, Mendes E, Travassos GH (2007) Cross- vs. within-company cost estimation studies: a systematic review. IEEE Trans Softw Eng 33:316–329, May 2007CrossRef
Zurück zum Zitat Koru AG, Emam KE, Zhang D, Liu H, Mathew D (2008) Theory of relative defect proneness. Empirical Softw Eng 13(5):473–498CrossRef Koru AG, Emam KE, Zhang D, Liu H, Mathew D (2008) Theory of relative defect proneness. Empirical Softw Eng 13(5):473–498CrossRef
Zurück zum Zitat Lessmann S, Baesens B, Mues C, Pietsch S (2008) Benchmarking classification models for software defect prediction: a proposed framework and novel findings. IEEE Trans Softw Eng 34(4):485–496CrossRef Lessmann S, Baesens B, Mues C, Pietsch S (2008) Benchmarking classification models for software defect prediction: a proposed framework and novel findings. IEEE Trans Softw Eng 34(4):485–496CrossRef
Zurück zum Zitat Marcus A, Poshyvanyk D, Ferenc R (2008) Using the conceptual cohesion of classes for fault prediction in object-oriented systems. IEEE Trans Softw Eng 34(2):287–300, March–April 2008CrossRef Marcus A, Poshyvanyk D, Ferenc R (2008) Using the conceptual cohesion of classes for fault prediction in object-oriented systems. IEEE Trans Softw Eng 34(2):287–300, March–April 2008CrossRef
Zurück zum Zitat Musa J, Iannino A, Okumoto K (1987) Software reliability: measurement, prediction, application. McGraw Hill, New York Musa J, Iannino A, Okumoto K (1987) Software reliability: measurement, prediction, application. McGraw Hill, New York
Zurück zum Zitat Nagappan N, Ball T (2005a) Static analysis tools as early indicators of pre-release defect density. In: ICSE 2005, St. Louis Nagappan N, Ball T (2005a) Static analysis tools as early indicators of pre-release defect density. In: ICSE 2005, St. Louis
Zurück zum Zitat Nikora A, Munson J (2003) Developing fault predictors for evolving software systems. In: Ninth international software metrics symposium (METRICS’03) Nikora A, Munson J (2003) Developing fault predictors for evolving software systems. In: Ninth international software metrics symposium (METRICS’03)
Zurück zum Zitat Orrego A (2004) Sawtooth: learning from huge amounts of data. Master’s thesis, Computer Science, West Virginia University Orrego A (2004) Sawtooth: learning from huge amounts of data. Master’s thesis, Computer Science, West Virginia University
Zurück zum Zitat Porter A, Selby R (1990) Empirically guided software development using metric-based classification trees. IEEE Softw 7:46–54, MarchCrossRef Porter A, Selby R (1990) Empirically guided software development using metric-based classification trees. IEEE Softw 7:46–54, MarchCrossRef
Zurück zum Zitat Quinlan R (1992a) C4.5: programs for machine learning. Morgan Kaufman, San Francisco, iSBN: 1558602380 Quinlan R (1992a) C4.5: programs for machine learning. Morgan Kaufman, San Francisco, iSBN: 1558602380
Zurück zum Zitat Rakitin S (2001) Software verification and validation for practitioners and managers, 2nd edn. Artech House, Cormano Rakitin S (2001) Software verification and validation for practitioners and managers, 2nd edn. Artech House, Cormano
Zurück zum Zitat Shepperd M, Ince D (1994) A critique of three metrics. J Syst Softw 26(3):197–210, September 1994CrossRef Shepperd M, Ince D (1994) A critique of three metrics. J Syst Softw 26(3):197–210, September 1994CrossRef
Zurück zum Zitat Srinivasan K, Fisher D (1995) Machine learning approaches to estimating software development effort. IEEE Trans. Softw Eng 21(2):126–137, February 1995CrossRef Srinivasan K, Fisher D (1995) Machine learning approaches to estimating software development effort. IEEE Trans. Softw Eng 21(2):126–137, February 1995CrossRef
Zurück zum Zitat Tian J, Zelkowitz M (1995) Complexity measure evaluation and selection. IEEE Trans Softw Eng 21(8):641–649, August 1995CrossRef Tian J, Zelkowitz M (1995) Complexity measure evaluation and selection. IEEE Trans Softw Eng 21(8):641–649, August 1995CrossRef
Zurück zum Zitat Witten IH, Frank E (2005) Data mining, 2nd edn. Morgan Kaufmann, Los AltosMATH Witten IH, Frank E (2005) Data mining, 2nd edn. Morgan Kaufmann, Los AltosMATH
Metadaten
Titel
On the relative value of cross-company and within-company data for defect prediction
verfasst von
Burak Turhan
Tim Menzies
Ayşe B. Bener
Justin Di Stefano
Publikationsdatum
01.10.2009
Verlag
Springer US
Erschienen in
Empirical Software Engineering / Ausgabe 5/2009
Print ISSN: 1382-3256
Elektronische ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-008-9103-7