Lecture 5 - Debugging (1)
Lecture 5 - Debugging (1)
• Break!
Investigate
14%
28% 28%
50% 12% 86% 11%
Reproduce 5% 3%
Debug 40% Compile 20% 22%Test
6% 6% Edit 5% 4%
50% 33% 16% 29%
55% 11%
32% 22% 67%
20%
18%
86%
11%
3%
Reuse
11%
5
LaToza and Myers. Developers ask reachability ques%ons. ICSE 2010.
Debugging process model
L. Layman, M. Diep, M. Nagappan, J. Singer, R. Deline and G. Venolia, "Debugging Revisited: Toward Understanding the Debugging Needs of Contemporary Software Developers," 2013 ACM / IEEE
International Symposium on Empirical Software Engineering and Measurement, Baltimore, MD, 2013, pp. 383-392.
6
Formulate & test hypotheses
• Use knowledge & data so far to formulate hypothesis
about why bug happened
cogitation, meditation, observation, inspection,
contemplation, hand-simulation,
gestation, rumination, dedication, inspiration,
articulation
• Recognize cliche
seen a similar bug before
Eisenstadt, M. Tales of Debugging from the Front Lines. Proc. Empirical Studies of Programmers, Ablex Publishing, Norwood, NJ,
1993, 86-112.
L. Layman, M. Diep, M. Nagappan, J. Singer, R. Deline and G. Venolia, "Debugging Revisited: Toward Understanding the Debugging Needs of Contemporary Software Developers," 2013 ACM / IEEE
International Symposium on Empirical Software Engineering and Measurement, Baltimore, MD, 2013, pp. 383-392.
L. Layman, M. Diep, M. Nagappan, J. Singer, R. Deline and G. Venolia, "Debugging Revisited: Toward Understanding the Debugging Needs of Contemporary Software Developers," 2013 ACM / IEEE
International Symposium on Empirical Software Engineering and Measurement, Baltimore, MD, 2013, pp. 383-392.
WhyLine
directly supports all 3 questions
in some situations
[1] Liblit, B., Aiken, A., Zheng, A. X., and Jordan, M. I. 2003. Bug isolation via remote program sampling. In
Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation.
Andrew J. Ko, Robert DeLine, and Gina Venolia. 2007. Information Needs in Collocated Software Development Teams. In Proceedings of the 29th international conference on
Software Engineering (ICSE '07). IEEE Computer Society, Washington, DC, USA, 344-353. DOI: https://doi.org/10.1109/ICSE.2007.45
14
Activity
• What's the hardest debugging bug you've ever
debugged?
• What made it hard?
L. Layman, M. Diep, M. Nagappan, J. Singer, R. Deline and G. Venolia, "Debugging Revisited: Toward Understanding the Debugging Needs of Contemporary Software Developers," 2013 ACM / IEEE
International Symposium on Empirical Software Engineering and Measurement, Baltimore, MD, 2013, pp. 383-392.
Eisenstadt, M. Tales of Debugging from the Front Lines. Proc. Empirical Studies of Programmers, Ablex Publishing, Norwood, NJ,
1993, 86-112.
Eisenstadt, M. Tales of Debugging from the Front Lines. Proc. Empirical Studies of Programmers, Ablex Publishing, Norwood, NJ,
1993, 86-112.
Demo: http://web.media.mit.edu/
~lieber/Lieberary/ZStep/ZStep.mov
Henry Lieberman and Christopher Fry. 1995. Bridging the gulf between code and behavior in programming. In Proceedings of the
SIGCHI conference on Human factors in computing systems (CHI '95), 480-486.
Bill Lewis. Debugging backwards in time. In Proceedings of the Fifth International Workshop on Automated Debugging
(AADEBUG 2003), October 2003.
Brian Burg, Andrew J. Ko, and Michael D. Ernst. 2015. Explaining Visual Changes in Web Interfaces. In Proceedings of the 28th Annual ACM Symposium on User Interface Software &
Technology (UIST '15). ACM, New York, NY, USA, 259-268. DOI: https://doi.org/10.1145/2807442.2807473
LaToza GMU SWE 795 Fall 2019 27
Find part of the program that caused
incorrect output
• Slice
• Subset of the program that is responsible for
computing the value of a variable at a program
point
• Backwards slice
• Transitive closure of all statements that have a
control or data dependency
Mark Weiser. 1982. Programmers use slices when debugging. Commun. ACM 25, 7 (July 1982), 446-452.
LaToza GMU SWE 795 Fall 2019 29
Slicers debug faster
• Students debugging 100 LOC C++ programs
• Students given
Programming environment
Hardcopy input, wrong output, correct output
Files with program & input
• Compared students instructed to slice against everyone
else
Excluding students who naturally use slicing strategy
Francel M. A. and S. Rugaber (2001). The Value of Slicing While Debugging, Science of Computer Programming, 40(2-3), 151-
169.
Andreas Zeller and Ralf Hildebrandt. Simplifying and Isolating Failure-Inducing Input. IEEE Transactions on Software Engineering
28(2), February 2002, pp. 183-200.
LaToza GMU SWE 795 Fall 2019 35
Find shortest repro steps
• ddmin algorithm sketch:
• 1. Decompose input into pieces
2. Run tests on pieces
3. If there’s a piece that still fails, go back to 1 on
piece
Otherwise, found locally minimal smallest input
Andreas Zeller and Ralf Hildebrandt. Simplifying and Isolating Failure-Inducing Input. IEEE Transactions on Software Engineering
28(2), February 2002, pp. 183-200.