skip to main content
research-article
Open Access

Testing and debugging functional reactive programming

Published:29 August 2017Publication History
Skip Abstract Section

Abstract

Many types of interactive applications, including video games, raise particular challenges when it comes to testing and debugging. Reasons include de-facto lack of reproducibility and difficulties of automatically generating suitable test data. This paper demonstrates that certain variants of Functional Reactive Programming (FRP) implemented in pure functional languages can mitigate such difficulties by offering referential transparency at the level of whole programs. This opens up for a multi-pronged approach for assisting with testing and debugging that works across platforms, including assertions based on temporal logic, recording and replaying of runs (also from deployed code), and automated random testing using QuickCheck. The approach has been validated on real, non-trivial games implemented in the FRP system Yampa through a tool providing a convenient Graphical User Interface that allows the execution of the code under scrutiny to be controlled, moving along the execution time line, and pin-pointing of violations of assertions on PCs as well as mobile platforms.

References

  1. John Carmack. 1998. John Carmack Archive - .plan. http://fd.fabiensanglard.net/doom3/pdfs/johnc-plan_1998.pdf . (1998).Google ScholarGoogle Scholar
  2. Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP ’00) . ACM, New York, NY, USA, 268–279. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. F. Cornelis, Andy Georges, M. Christiaens, Michiel Ronsse, T. Ghesquiere, and K. De Bosschere. 2003. A taxonomy of execution replay systems. Proceedings of International Conference on Advances in Infrastructure for Electronic Business, Education, Science, Medicine, and Mobile Technologies on the Internet (2003).Google ScholarGoogle Scholar
  4. Antony Courtney, Henrik Nilsson, and John Peterson. 2003. The Yampa Arcade. In Proceedings of the 2003 ACM SIGPLAN Workshop on Haskell (Haskell ’03) . ACM, New York, NY, USA, 7–18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Conal Elliott and Paul Hudak. 1997. Functional Reactive Animation. In International Conference on Functional Programming. 163–173. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Allen Emerson. 1990. Handbook of Theoretical Computer Science (Vol. B). MIT Press, Cambridge, MA, USA, Chapter Temporal and Modal Logic, 995–1072. http://dl.acm.org/citation.cfm?id=114891.114907Google ScholarGoogle Scholar
  7. D. Giannakopoulou and K. Havelund. 2001. Automata-based verification of temporal properties on running programs. In Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001). 412–416. Google ScholarGoogle ScholarCross RefCross Ref
  8. Jim Gray. 1986. Why Do Computers Stop and What Can Be Done About It?. In Symposium on Reliability in Distributed Software and Database Systems . 3–12.Google ScholarGoogle Scholar
  9. Jason Gregory. 2014. Game Engine Architecture, Second Edition (2nd ed.). A. K. Peters, Ltd., Natick, MA, USA.Google ScholarGoogle Scholar
  10. Klaus Havelund and Grigore Rosu. 2001. Monitoring programs using rewriting. In Automated Software Engineering, 2001.(ASE 2001). Proceedings. 16th Annual International Conference on . IEEE, 135–143. Google ScholarGoogle ScholarCross RefCross Ref
  11. John Hughes. 2000a. Generalising monads to arrows. Science of computer programming 37, 1 (2000), 67–111.Google ScholarGoogle Scholar
  12. John Hughes. 2000b. Generalising monads to arrows. Science of computer programming 37, 1 (2000), 67–111. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. John Hughes, Ulf Norell, and Jérôme Sautret. 2010. Using temporal relations to specify and test an instant messaging server. In The 5th Workshop on Automation of Software Test, AST 2010, May 3-4, 2010, Cape Town, South Africa. 95–102. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Alan Jeffrey. 2012. LTL Types FRP: Linear-time Temporal Logic Propositions As Types, Proofs As Functional Reactive Programs. In Proceedings of the Sixth Workshop on Programming Languages Meets Program Verification (PLPV ’12). ACM, New York, NY, USA, 49–60. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Alan Jeffrey. 2014. Functional Reactive Types. In Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS) (CSL-LICS ’14) . ACM, New York, NY, USA, Article 54, 9 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Wolfgang Jeltsch. 2012. Towards a Common Categorical Semantics for Linear-Time Temporal Logic and Functional Reactive Programming. Electron. Notes Theor. Comput. Sci. 286 (Sept. 2012), 229–242. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Wolfgang Jeltsch. 2013. Temporal Logic with "Until", Functional Reactive Programming with Processes, and Concrete Process Categories. In Proceedings of the 7th Workshop on Programming Languages Meets Program Verification (PLPV ’13). ACM, New York, NY, USA, 69–78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Chris Lewis, Jim Whitehead, and Noah Wardrip-Fruin. 2010. What Went Wrong: A Taxonomy of Video Game Bugs. In Proceedings of the Fifth International Conference on the Foundations of Digital Games (FDG ’10) . ACM, New York, NY, USA, 108–115. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Shiva Nejati, Arie Gurfinkel, and Marsha Chechik. 2005. Stuttering abstraction for model checking. In Software Engineering and Formal Methods, 2005. SEFM 2005. Third IEEE International Conference on . IEEE, 311–320. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Henrik Nilsson, Antony Courtney, and John Peterson. 2002. Functional Reactive Programming, Continued. In Proceedings of the 2002 ACM SIGPLAN workshop on Haskell . ACM, 51–64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Gergely Patai. 2009. Eventless reactivity from scratch. Draft Proceedings of Implementation and Application of Functional Languages (IFL’09) (2009), 126–140.Google ScholarGoogle Scholar
  22. Ross Paterson. 2001. A new notation for arrows. ACM SIGPLAN Notices 36, 10 (2001), 229–240. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Ivan Perez. 2017. Back to the Future: Time Travel in FRP. In Proceedings of the 10th ACM SIGPLAN International Haskell Symposium (Haskell 2017) . ACM, New York, NY, USA, 12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ivan Perez, Manuel Bärenz, and Henrik Nilsson. 2016. Functional Reactive Programming, Refactored. In Proceedings of the 9th International Symposium on Haskell (Haskell 2016) . ACM, New York, NY, USA, 33–44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ivan Perez and Henrik Nilsson. 2015. Bridging the GUI Gap with Reactive Values and Relations. In Proceedings of the 2015 ACM SIGPLAN Symposium on Haskell (Haskell ’15) . ACM, New York, NY, USA, 47–58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Amir Pnueli. 1977. The temporal logic of programs. In Foundations of Computer Science, 1977., 18th Annual Symposium on. IEEE, 46–57. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Arthur N Prior. 1967. Past, present and future. Vol. 154. Oxford University Press.Google ScholarGoogle Scholar
  28. Michiel Ronsse, Koen De Bosschere, and Jacques Chassin De Kergommeaux. 2000. Execution replay and debugging. arXiv preprint cs/0011006 (2000).Google ScholarGoogle Scholar
  29. Neil Sculthorpe. 2011. Towards safe and efficient functional reactive programming. Ph.D. Dissertation. University of Nottingham.Google ScholarGoogle Scholar
  30. Li Tan, Oleg Sokolsky, and Insup Lee. 2004. Specification-based testing with linear temporal logic. In Information Reuse and Integration, 2004. IRI 2004. Proceedings of the 2004 IEEE International Conference on . IEEE, 493–498.Google ScholarGoogle ScholarCross RefCross Ref
  31. J. A. Whittaker. 2000. What is software testing? And why is it so hard? IEEE Software 17, 1 (Jan 2000), 70–79. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Sergei Winitzki. 2014. Temporal Logic and Functional Reactive Programming. https://github.com/winitzki/talks/tree/master/ frp . (2014).Google ScholarGoogle Scholar

Index Terms

  1. Testing and debugging functional reactive programming

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image Proceedings of the ACM on Programming Languages
          Proceedings of the ACM on Programming Languages  Volume 1, Issue ICFP
          September 2017
          1173 pages
          EISSN:2475-1421
          DOI:10.1145/3136534
          Issue’s Table of Contents

          Copyright © 2017 Owner/Author

          This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs International 4.0 License.

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 August 2017
          Published in pacmpl Volume 1, Issue ICFP

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader