Skip to main content

Testing Erlang Refactorings with QuickCheck

  • Conference paper
Implementation and Application of Functional Languages (IFL 2007)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5083))

Included in the following conference series:

Abstract

Refactoring is a technique for improving the design of existing programs without changing their behaviour. Wrangler is a tool built at the University of Kent to support Erlang program refactoring; the Wrangler tool is written in Erlang.

In this paper we present the use of a novel testing tool, Quviq QuickCheck, for testing the implementation of Wrangler. QuickCheck is a specification-based testing tool for Erlang. With QuickCheck, programs are tested by writing properties in a restricted logic, and using the tool these properties are tested in randomly generated test cases.

This paper first gives overviews of Wrangler and Quviq QuickCheck, then discusses the various ways in which refactorings can be validated, and finally shows how QuickCheck can be used to test the correctness of refactorings in an efficient way.

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 74.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.00
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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent Programming in Erlang. 2nd edn. Prentice-Hall, Englewood Cliffs (1996)

    Google Scholar 

  2. Arts, T., Hughes, J., Johansson, J., Wiger, U.: Testing Telecoms Software with Quviq QuickCheck. In: Trinder, P. (ed.) Proceedings of the Fifth ACM SIGPLAN Erlang Workshop. ACM Press, New York (2006)

    Google Scholar 

  3. Carlsson, R., Rémond, M.: Eunit: a lightweight unit testing framework for erlang. In: ERLANG 2006: Proceedings of the 2006 ACM SIGPLAN workshop on Erlang, p. 1. ACM Press, New York (2006)

    Chapter  Google Scholar 

  4. Claessen, K., Hughes, J.: QuickCheck: a Lightweight Tool for Random Testing of Haskell Programs. ACM SIGPLAN Notices 35(9), 268–279 (2000)

    Article  Google Scholar 

  5. Daniel, B., Dig, D., Garcia, K., Marinov, D.: Automated testing of refactoring engines. In: ESEC/FSE 2007: Proceedings of the ACM SIGSOFT Symposium on the Foundations of Software Engineering, September 2007. ACM Press, New York (2007)

    Google Scholar 

  6. FORSE. Formally-Based Tool Support for Erlang Development, http://www.cs.kent.ac.uk/projects/forse/

  7. Fowler, M.: Refactoring Home Page, http://www.refactoring.com

  8. Hughes, J.: QuickCheck Testing for Fun and Profit. In: Hanus, M. (ed.) PADL 2007. LNCS, vol. 4354, pp. 1–32. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  9. Li, H.: Refactoring Haskell Programs. PhD thesis, Computing Laboratory, University of Kent, Canterbury, Kent, UK (September 2006)

    Google Scholar 

  10. Li, H., Reinke, C., Thompson, S.: Tool Support for Refactoring Functional Programs. In: Jeuring, J. (ed.) ACM SIGPLAN Haskell Workshop, Uppsala, Sweden (August 2003)

    Google Scholar 

  11. Li, H., Thompson, S.: A Comparative Study of Refactoring Haskell and Erlang Programs. In: Di Penta, M., Moonen, L. (eds.) Sixth IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2006), September 2006, pp. 197–206. IEEE, Los Alamitos (2006)

    Chapter  Google Scholar 

  12. Li, H., Thompson, S., Lövei, L., Horváth, Z., Kozsik, T., Víg, A., Nagy, T.: Refactoring Erlang Programs. In: The Proceedings of 12th International Erlang/OTP User Conference, Stockholm, Sweden (November 2006)

    Google Scholar 

  13. Gorrie, L.: Distel: Distributed Emacs Lisp (for Erlang). In: Eighth International Erlang/OTP User Conference

    Google Scholar 

  14. Carlsson, R.: Erlang Syntax Tools, http://www.erlang.org/doc/doc-5.4.12/lib/syntax_tools-1.4.3

  15. Sultana, N.: Verification of Refactorings in Isabelle/HOL. Master’s thesis, Computing Laboratory, University of Kent, UK (September 2007)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Olaf Chitil Zoltán Horváth Viktória Zsók

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Li, H., Thompson, S. (2008). Testing Erlang Refactorings with QuickCheck. In: Chitil, O., Horváth, Z., Zsók, V. (eds) Implementation and Application of Functional Languages. IFL 2007. Lecture Notes in Computer Science, vol 5083. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-85373-2_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-85373-2_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-85372-5

  • Online ISBN: 978-3-540-85373-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics