Skip to main content

A Sketching-Based Approach for Debugging Using Test Cases

  • Conference paper
  • First Online:
Automated Technology for Verification and Analysis (ATVA 2016)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9938))

Abstract

Manually locating and removing bugs in faulty code is often tedious and error-prone. Despite much progress in automated debugging, developing effective debugging techniques remains a challenge. This paper introduces a novel approach that uses a well-known program synthesis technique to automate debugging. As inputs, our approach takes a program and a test suite (with some passing and some failing tests), similar to various other recent techniques. Our key insight is to reduce the problem of finding a fix to the problem of program sketching. We translate the faulty program into a sketch of the correct program, and use off-the-shelf sketching technology to create a program that is correct with respect to the given test cases. The experimental evaluation using a suite of small, yet complex programs shows that our prototype embodiment of our approach is more effective than previous state-of-the-art.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. The Sketch Programmers Manual. https://people.csail.mit.edu/asolar/manual.pdf. Accessed 07 05 2016

  2. Boyapati, C., Khurshid, S., Marinov, D.: Korat: automated testing based on Java predicates. In: ISSTA, pp. 123–133 (2002)

    Google Scholar 

  3. Chandra, S., Torlak, E., Barman, S., Bodík, R.: Angelic debugging. In: ICSE (2011)

    Google Scholar 

  4. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  5. Debroy, V., Wong, W.E.: Using mutation to automatically suggest fixes for faulty programs. ICST 2010, 65–74 (2010)

    Google Scholar 

  6. Demsky, B., Ernst, M.D., Guo, P.J., McCamant, S., Perkins, J.H., Rinard, M.C.: Inference and enforcement of data structure consistency specifications. ISSTA 2006, 233–244 (2006)

    Article  Google Scholar 

  7. Feser, J.K., Chaudhuri, S., Dillig, I.: Synthesizing data structure transformations from input-output examples. PLDI 2015, 229–239 (2015)

    Google Scholar 

  8. Gopinath, D.: Systematic techniques for more effective fault localization and program repair. Ph.D. thesis, University of Texas at Austin (2015)

    Google Scholar 

  9. Gopinath, D., Khurshid, S., Saha, D., Chandra, S.: Data-guided repair of selection statements. ICSE 2014, 243–253 (2014)

    Google Scholar 

  10. Gopinath, D., Malik, M.Z., Khurshid, S.: Specification-based program repair using SAT. TACAS 2011, 173–188 (2011)

    MATH  Google Scholar 

  11. Jeon, J., Qiu, X., Foster, J.S., Solar-Lezama, A.: JSketch: sketching for Java. ESEC/FSE 2015, 934–937 (2015)

    Google Scholar 

  12. Jha, S., Gulwani, S., Seshia, S.A., Tiwari, A.: Oracle-guided component-based program synthesis. ICSE 2010, 215–224 (2010)

    Google Scholar 

  13. Jones, J.A., Harrold, M.J.: Empirical evaluation of the tarantula automatic fault-localization technique. In: (ASE 2005), pp. 273–282 (2005)

    Google Scholar 

  14. Kim, D., Nam, J., Song, J., Kim, S.: Automatic patch generation learned from human-written patches. ICSE 2013, 802–811 (2013)

    Google Scholar 

  15. Kneuss, E., Koukoutos, M., Kuncak, V.: Deductive program repair. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9207, pp. 217–233. Springer, Heidelberg (2015)

    Chapter  Google Scholar 

  16. Le Goues, C., Nguyen, T., Forrest, S., Weimer, W.: GenProg: a generic method for automatic software repair. IEEE Trans. Softw. Eng. 38(1), 54–72 (2012)

    Article  Google Scholar 

  17. Long, F., Rinard, M.: Staged program repair with condition synthesis. ESEC/FSE 2015, 166–178 (2015)

    Google Scholar 

  18. Malik, M.Z., Ghori, K., Elkarablieh, B., Khurshid, S.: A case for automated debugging using data structure repair. In: ASE, pp. 620–624 (2009)

    Google Scholar 

  19. Mechtaev, S., Yi, J., Roychoudhury, A.: Angelix: scalable multiline program patch synthesis via symbolic analysis. In: ICSE 2016 (2016)

    Google Scholar 

  20. Nguyen, H.D.T., Qi, D., Roychoudhury, A., Chandra, S.: SemFix: program repair via semantic analysis. ICSE 2013, 772–781 (2013)

    Google Scholar 

  21. Pei, Y., Furia, C.A., Nordio, M., Wei, Y., Meyer, B., Zeller, A.: Automated fixing of programs with contracts. IEEE Trans. Softw. Eng. 40(5), 427–449 (2014)

    Article  Google Scholar 

  22. Qi, Z., Long, F., Achour, S., Rinard, M.C.: An analysis of patch plausibility and correctness for generate-and-validate patch generation systems. In: ISSTA (2015)

    Google Scholar 

  23. Saha, R.K., Lease, M., Khurshid, S., Perry, D.E.: Improving bug localization using structured information retrieval. ASE 2013, 345–355 (2013)

    Google Scholar 

  24. Singh, R., Gulwani, S., Solar-Lezama, A.: Automated feedback generation for introductory programming assignments. In: PLDI 2013, pp. 15–26 (2013)

    Google Scholar 

  25. Smith, E.K., Barr, E.T., Le Goues, C., Brun, Y.: Is the cure worse than the disease? overfitting in automated program repair. ESEC/FSE 2015, 532–543 (2015)

    Google Scholar 

  26. Solar-Lezama, A.: Program sketching. STTT 15(5–6), 475–495 (2013)

    Article  Google Scholar 

Download references

Ackowlegement

We thank Armando Solar-Lezama and Rishabh Singh for helpful comments and encouragement. This work was funded in part by the National Science Foundation (NSF Grant No. CCF-1319688).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jinru Hua .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing AG

About this paper

Cite this paper

Hua, J., Khurshid, S. (2016). A Sketching-Based Approach for Debugging Using Test Cases. In: Artho, C., Legay, A., Peled, D. (eds) Automated Technology for Verification and Analysis. ATVA 2016. Lecture Notes in Computer Science(), vol 9938. Springer, Cham. https://doi.org/10.1007/978-3-319-46520-3_29

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-46520-3_29

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-46519-7

  • Online ISBN: 978-3-319-46520-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics