Skip to main content

Debugging Meets Testing in Erlang

  • Conference paper
  • First Online:

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

Abstract

We propose a bidirectional collaboration between declarative debugging and testing for detecting errors in the sequential subset of the programming language Erlang. In our proposal, the information obtained from the user during a debugging session is stored in form of unit tests. These test cases can be employed afterwards to check, through testing, if the bug has been actually corrected. Moreover, the debugger employs already existing tests to determine the correctness of some subcomputations, helping the user to locate the error readily. The process, contrarily to usual debugger frameworks is cumulative: if later we find a new bug we have more information from the previous debugging and testing iterations that can contribute to find the error readily.

Research supported by the Comunidad de Madrid project N-Greens Software-CM (S2013/ICE-2731), by the MINECO Spanish projects StrongSoft (TIN2012-39391-C04-04), VIVAC (TIN2012-38137), CAVI-(ROSE/ART) (TIN2013-44742-C4-(1/3)-R), LOBASS (TIN2015-69175-C4-2-R), and TRACES (TIN2015-67522-C3-3-R), and by the European Union project POLCA (STREP FP7-ICT-2013.3.4 610686).

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

Buying options

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

Learn about institutional subscriptions

Notes

  1. 1.

    Erlang also supports test cases ?assert(...) with predicates. Our system can handle these test cases when their predicates involve equality or inequality operators, but we will focus only on ?assertEqual and ?assertNotEqual for simplicity in the presentation.

  2. 2.

    The positive test case, if exists, indicates that the initial symptom is wrong indicating also the expected value. This makes the addition of the negative test case redundant.

  3. 3.

    Nodes’ modules are not shown for the sake of clarity.

  4. 4.

    Notice that, as explained in Sect. 2, a negative test case ?assertNotEqual for the root qs(fun leq/2, [7,1]) is not generated as the test suite already contains a positive test for it (see line 21 in Fig. 2).

References

  1. Alexander, I.F., Maiden, N.: Scenarios, Stories, Use Cases: Through the Systems Development Life-cycle. Wiley, New York (2005)

    Google Scholar 

  2. Barr, E., Harman, M., McMinn, P., Shahbaz, M., Yoo, S.: The oracle problem in software testing: a survey. IEEE Trans. Softw. Eng. 41(5), 507–525 (2015)

    Article  Google Scholar 

  3. Caballero, R., Martin-Martin, E., Riesco, A., Tamarit, S.: EDD: a declarative debugger for sequential erlang programs. In: Ábrahám, E., Havelund, K. (eds.) TACAS 2014 (ETAPS). LNCS, vol. 8413, pp. 581–586. Springer, Heidelberg (2014)

    Chapter  Google Scholar 

  4. Caballero, R., Martin-Martin, E., Riesco, A., Tamarit, S.: A zoom-declarative debugger for sequential Erlang programs. Sci. Comput. Program. 110, 104–118 (2015)

    Article  Google Scholar 

  5. Carlsson, R., Rémond, M.: EUnit: a lightweight unit testing framework for Erlang. In: Proceedings of the 2006 ACM SIGPLAN Workshop on Erlang, ERLANG 2006, p. 1. ACM, New York (2006)

    Google Scholar 

  6. Cesarini, F., Thompson, S.: Programming Erlang: A Concurrent Approach to Software Development. O’Reilly Media Inc., Beijing (2009)

    MATH  Google Scholar 

  7. Hebert, F.: Learn You Some Erlang for Great Good!: A Beginner’s Guide. No Starch Press (2013). http://learnyousomeerlang.com

  8. Papadakis, M., Sagonas, K.: A PropEr integration of types and function specifications with property-based testing. In: Proceedings of the 2011 ACM SIGPLAN Erlang Workshop, pp. 39–50. ACM Press (2011)

    Google Scholar 

  9. Shapiro, E.Y.: Algorithmic Program Debugging. ACM Distinguished Dissertation. MIT Press, Cambridge (1983)

    Google Scholar 

  10. Silva, J.: A survey on algorithmic debugging strategies. Adv. Eng. Softw. 42(11), 976–991 (2011)

    Article  Google Scholar 

Download references

Acknowledgments

We thank the anonymous reviewer of a previous work published in the journal Science of Computer Programming for suggesting us this line of work.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rafael Caballero .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Tamarit, S., Riesco, A., Martin-Martin, E., Caballero, R. (2016). Debugging Meets Testing in Erlang. In: Aichernig, B., Furia, C. (eds) Tests and Proofs. TAP 2016. Lecture Notes in Computer Science(), vol 9762. Springer, Cham. https://doi.org/10.1007/978-3-319-41135-4_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-41135-4_10

  • Published:

  • Publisher Name: Springer, Cham

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

  • Online ISBN: 978-3-319-41135-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics