SZZ – An overview David Bowes University of Hertfordshire
Investigating the crime scene reports 1.On Jan 1 st, David modifies methods A,C and D 2.On Jan 5 th, Jean modified method D 3.On Feb 1 st,Tracy reports a bug 4.On Feb 2 nd,Steve makes a change to method C and commits 5.On Feb 5 th, Thomas modifies A,C and D and commits 6.On Feb 6 th, Thomas marks the bug as fixed. Who fixed the fault the fault? Who inserted the fault?
Overview Overview of: J. Śliwerski, T. Zimmermann, and A. Zeller, “When do changes induce fixes? (On Fridays)” in Proceedings of the 2005 international workshop on Mining software repositories, ser. MSR ’05. New York, NY, USA: ACM, 2005, pp. 1–5. – Bug linking – Fault insertion point
Bug Linking Find a bug report in a bug tracking system: – Bugid: [compiler][null] NPE: Method without return value – Extract the bugid Find all version control commit messages which include: – Bugid – Other words : fix… Compute a match score using above. Choose the latest highest commit as the point which fixes the bugid
e.g. Commit: [compiler][null] NPE: Method without return value Commit: [compiler][null] NPE: Method without return value Signed-off-by: Shankha Banerjee Files modified: org.eclipse.jdt.core.tests.compiler/src/org/eclips e/jdt/core/tests/compiler/regression/NullAnnot ationTest.java org.eclipse.jdt.core/compiler/org/eclipse/jdt/int ernal/compiler/lookup/MethodBinding.java
Finding the insertion point Remember the date of the initial bug report Blame the files which were changed… *Stephan He :27:24if (added) *Stephan He :27:24this.tagBits |= TagBits.HasParameterAnnotations; Stephan He :17:38if (this.returnType != null) { Stephan He :17:38if (!this.returnType.isBaseType() ) == 0) { Stephan He :17:38this.returnType = env.createAnnotatedType(this.returnType, new AnnotationBinding[]{env.getNonNullAnnotation()}); Stephan He :17:38} else if (sourceMethod != null && (this.returnType.tagBits & TagBits.AnnotationNonNull) != 0) { Stephan He :17:38 sourceMethod.scope.problemReporter().nullAnnotationIsRedundant(sourceMethod, -1/*signifies method return*/); Stephan He :17:38} *Stephan He :27:24}
Identify where these lines were changed Find previous lines which were replaced/inserted between AND were before the bug report date
Job done…(?) Problems: – Bird identified the linking rules by SZZ were severe (only 50% of bugs were linked to a commit) – Identifies more than one commit (?) – Blame relies on diff between versions: Move a method: – Diff thinks code has been deleted and inserted elsewhere White space – Branching and merging in version control? – Replication/Validation? – Are there better ways?