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.
- John Carmack. 1998. John Carmack Archive - .plan. http://fd.fabiensanglard.net/doom3/pdfs/johnc-plan_1998.pdf . (1998).Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- Conal Elliott and Paul Hudak. 1997. Functional Reactive Animation. In International Conference on Functional Programming. 163–173. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarCross Ref
- 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 Scholar
- Jason Gregory. 2014. Game Engine Architecture, Second Edition (2nd ed.). A. K. Peters, Ltd., Natick, MA, USA.Google Scholar
- 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 ScholarCross Ref
- John Hughes. 2000a. Generalising monads to arrows. Science of computer programming 37, 1 (2000), 67–111.Google Scholar
- John Hughes. 2000b. Generalising monads to arrows. Science of computer programming 37, 1 (2000), 67–111. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Gergely Patai. 2009. Eventless reactivity from scratch. Draft Proceedings of Implementation and Application of Functional Languages (IFL’09) (2009), 126–140.Google Scholar
- Ross Paterson. 2001. A new notation for arrows. ACM SIGPLAN Notices 36, 10 (2001), 229–240. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Amir Pnueli. 1977. The temporal logic of programs. In Foundations of Computer Science, 1977., 18th Annual Symposium on. IEEE, 46–57. Google ScholarDigital Library
- Arthur N Prior. 1967. Past, present and future. Vol. 154. Oxford University Press.Google Scholar
- Michiel Ronsse, Koen De Bosschere, and Jacques Chassin De Kergommeaux. 2000. Execution replay and debugging. arXiv preprint cs/0011006 (2000).Google Scholar
- Neil Sculthorpe. 2011. Towards safe and efficient functional reactive programming. Ph.D. Dissertation. University of Nottingham.Google Scholar
- 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 ScholarCross Ref
- J. A. Whittaker. 2000. What is software testing? And why is it so hard? IEEE Software 17, 1 (Jan 2000), 70–79. Google ScholarDigital Library
- Sergei Winitzki. 2014. Temporal Logic and Functional Reactive Programming. https://github.com/winitzki/talks/tree/master/ frp . (2014).Google Scholar
Index Terms
- Testing and debugging functional reactive programming
Recommendations
Functional reactive programming, refactored
Haskell 2016: Proceedings of the 9th International Symposium on HaskellFunctional Reactive Programming (FRP) has come to mean many things. Yet, scratch the surface of the multitude of realisations, and there is great commonality between them. This paper investigates this commonality, turning it into a mathematically ...
Functional reactive programming, refactored
Haskell '16Functional Reactive Programming (FRP) has come to mean many things. Yet, scratch the surface of the multitude of realisations, and there is great commonality between them. This paper investigates this commonality, turning it into a mathematically ...
Functional reactive types
CSL-LICS '14: 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)Functional Reactive Programming (FRP) is an approach to streaming data with a pure functional semantics as time-indexed values. In previous work, we showed that Linear-time Temporal Logic (LTL) can be used as a type system for discrete-time FRP, and ...
Comments