Advertisement
Advertisement

More Related Content

Advertisement
Advertisement

Predicting Faults from Cached History

  1. ` BugCache Predicting Defects Sung Kim • MIT Tom Zimmermann • Saarland University Jim Whitehead • UC Santa Cruz Andreas Zeller • Saarland University
  2. The Problem How should we allocate our resources for quality assurance? Which files should we focus on?
  3. Which files are most bug-prone? The Problem
  4. Where are bugs? Temporal locality: Defected files are likely to have more soon. [Ostrand, Weyuker] Spatial locality: In nearby other bugs! [Zimmermann et al.] In modified files! [Nagappan et al.] In new files! [Graves et al.]
  5. Bug Cache 10% files most defect-prone all files pre-fetch replacement Near by: co changes load
  6. Bug Cache load if missed load if missed pre-fetch A Fix change Non-fix change Fix change Change history B C
  7. Cache Model Miss Cache size: 2 A B C C
  8. Cache Model Hit Miss Miss Cache size: 2 Block size: 2 Hit A B C A D C B B A C A B Which one should be replaced?
  9. Cache Model Hit Miss Miss Cache size: 2 Block size: 2 Hit Replacement: BUG A B C A D C B B A C A B Block size: 1 Cache size: 2 File LRU CHANGE BUG -5 2 2 -3 3 1 B C BUG 2 1 (replace)
  10. Cache Model Hit Miss Miss Cache size: 2 Block size: 2 Replacement: BUG Pre-fetch size: 1 A B C A D C B B A C A B Hit rate = #Hits / #Defects = 25% Pre-fill Pre-fetch Miss D Pre-fetch
  11. Evaluation PostgreSQL jEdit Mozilla Columba
  12. Hit Rates Cache size = 10% Block/pre-fetch size = 50% of the cache size Replacement policy = LRU
  13. Function Level Default vs Optimal Options Cache size = 10% of all functions/methods
  14. Function Level Optimal Hit Rates Project Function Apache 1.3 Columba Eclipse JEdit Mozilla PostgreSQL Subversion 2,113 8,428 33,214 5,489 8,203 8,659 3,693 Cache size = 10% of all functions/methods Hit rate 62% 68% 72% 49% 55% 59% 46% Block 15% 57% 20% 85% 41% 29% 71% Pre-fetch 17% 20% 4% 8% 14% 17% 14% Replace BUG BUG BUG BUG LRU LRU BUG
  15. File Level Default vs Optimal Options Cache size = 10% of all files
  16. File Level Optimal Hit Rates Project Files Apache 1.3 Columba Eclipse JEdit Mozilla PostgreSQL Subversion 154 1,428 3,330 420 396 598 255 Cache size = 10% of all files Hit rate 82% 83% 95% 85% 88% 79% 73% Block 50% 59% 20% 23% 23% 22% 42% Pre-fetch 0% 0% 0% 0% 0% 0% 0% Replace LRU BUG LRU LRU LRU LRU LRU
  17. Related Work In previous work, 10% predicts 44%~78% 20% predicts 71~93% 10% BugCache predicts 73~95%
  18. Summary
  19. ` BugCache Predicting Defects Sung Kim • MIT Tom Zimmermann • Saarland University Jim Whitehead • UC Santa Cruz Andreas Zeller • Saarland University
  20. Changes that lead to problems as indicated by later fixes. Bug-introducing Changes ... if (foo!=null) { foo.bar(); ... FIX ... if (foo==null) { foo.bar(); ... BUG-INTRODUCING later fixed

Editor's Notes

  1. Usage Coupling
Advertisement