bug.c double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; Mama bug, papa bug, they all go back to the mother of all bugs... The First Bug (September 9, 1947) How to Debug (Sommerville 2004) ! ! ! !"" # $% & ' Mama Mama bug, bug, papa papa bug, bug, they they all go back to the mother all go back to the mother of of all all bugs... bugs... Counterfactual Causality ( ) ) ( bug.c double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; empty.c double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; Causes as Differences ( *+ # *+ # ( & + ( * Actual Causes $% ' , Isolating Causes double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; Isolating Causes double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; Isolating Causes double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; Isolating Causes double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; ( ( Isolating Causes double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; Isolating Causes double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; Isolating Causes double bug(double z[], int n) { int i, j; } i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] * (z[0] + 1.0); } return z[n]; # Isolating Causes ( ( ? % -. ( Isolating Causes ( ( $/0 * 1 ' ? % -. ( 2 Delta Debugging ! " 23 2 2% + 0 4 1 15%- -6 + 0 7 8 9 :0 + 0 ; * 7 # ( * < 22 + : ; = 9> / " % From Defect to Failure 0 *% * :* . ; *% 8 # #$ = *% % &@ & * ? Tracing Infections 2 2A 8 ( * Tracing Infections Causes in State 3 2 =08111 2 =:8111 20 2 * ( % # B * Search in Space 3 ? % -. Delta Debugging Delta Debugging first_loop_store_insn fld[1].rtx fld[1].rtx fld[3].rtx fld[1].rtx code == PLUS Search in Space 3 ? % -. Search in Space 3 CA D ? % -. Search in Time A CA D CA D Search in Time A CA D CA D link fld[0].rtx fld[0].rtx == link Search in Time A CA D CA D % A C% D Why Transitions? 2) 2% 2 2 . All GCC Transitions C " " " " " " E( F ;G D *+ =9HH *+ :414 I I .*+ 079 I3 JI I .*+ 0:0; . .*+ 0:0; F =0G & *+ ;K0H F =:G .*+ 0:0; I F 0G *. L *+ 0:0; M I F :G L *+ =:90 . F 1G *. F 1G *. F 0G *.* F 0G *.* combine.c if (GET_CODE (XEXP (x, 0)) == PLUS { x = apply_distributive_law (gen_binary (PLUS, mode, gen_binary (MULT, mode, XEXP (XEXP (x, 0), 0), XEXP : (x, 1)), ; ; 7 8 1 1 1 gen_binary (MULT, mode, XEXP (XEXP (x, 0), 1), XEXP (x, 1)))); } if (GET_CODE (x) != MULT) return x; copy_rtx() Implementations C Java / := ) 0 : " Python : Stability 3 ! ) C D , , , , , N , N > 3 E3 ) ! M :7 ) ; : 9 + , :H N N , 01 N N , :H N N , :H N N - M <init> add() add() isEmpty() ¬isEmpty() remove() 5( remove() The Traffic Principle & J $% & ' combine.c if (GET_CODE (XEXP (x, 0)) == PLUS { x = apply_distributive_law (gen_binary (PLUS, mode, gen_binary (MULT, mode, XEXP (XEXP (x, 0), 0), XEXP (x, 1)), gen_binary (MULT, mode, XEXP (XEXP (x, 0), 1), XEXP (x, 1)))); } if (GET_CODE (x) != MULT) return x; copy_rtx() - )3 3 . ( . B 3 5 3 * O B, ( N 5( ( B * O @ % $ ( 8 B B E B J& * A & . 2 2 ) 3 9 0P ( " import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.*; import org.eclipse.jdt.internal.compiler.ast.*; import org.eclipse.jdt.internal.compiler.util.*; ... import org.eclipse.pde.core.*; import org.eclipse.jface.wizard.*; import org.eclipse.ui.*; 0 =P ( > ( &( Q 2% " ) 3 ( import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.*; import org.eclipse.jdt.internal.compiler.ast.*; import org.eclipse.jdt.internal.compiler.util.*; ... import org.eclipse.pde.core.*; import org.eclipse.jface.wizard.*; import org.eclipse.ui.*; ( R; 1 1A & A H P ( 2 2 2 2 < < - " % ) E A % - " % ) E A % - " % ) E A % - % A $ 3 " ) ' E % - % $$5 5( ( . " ) A & ' E % - % $$% % " M &' ) E A % - " % ) E A % J ) Make this Actionable! ! ) 8* 5 8* $ ( ) 8 E A 8 - & 8 0 4 4 K ( ( 2 2 2 2 / / & & < < Locating Errors automatically Predicting bug density from failure history Multitude of automated and systematic debugging techniques Automated Assistance for Programmers % ( & *% + S S 8 H H 4 * S 8 ( 8 SS 0 * 1 8 4 = ; 1 H 8 *