Abstract
When testing a program, there are usually some parts that are rarely executed and hence more difficult to test. Finding inputs that guarantee that such parts are executed is an example of a reach problem, which in general seeks to ensure that targeted parts of a program are always executed. In previous work, Naylor and Runciman have developed a reachability solver for Haskell, based on the use of lazy narrowing from functional logic programming. Their work was focused on practical issues concerning implementation and performance. In this paper, we lay the groundwork for an underlying theory of such a system, by formally establishing the correctness of a simple reach solver.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Albert, E., Hanus, M., Frank, H., Oliver, J., Germán, V.: Operational semantics for declarative multi-paradigm languages. J. Symbolic Comput. 40(1), 795–829 (2005)
Antoy, S., Echahed, R., Hanus, M.: A needed narrowing strategy. J. ACM 47(4), 776–822 (2000)
Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of haskell programs. In: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (2000)
Fowler, J.: Towards a Theory of Reach - Agda Proof (2015). https://github.com/JonFowler/theoryofreach
Gill, A., Runciman, C.: Haskell program coverage. In: Proceedings of the ACM SIGPLAN Workshop on Haskell (2007)
Hackett, J., Hutton, G.: Worker/Wrapper/Makes It/Faster. In: Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming (2014)
Hanus, M.: A unified computation model for functional and logic programming. In: Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (1997)
Hinze, R.: A new approach to generic functional programming. In: Proceedings of the 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2000)
Hughes, J.: QuickCheck: an automatic testing tool for Haskell (QuickCheck manual). http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.html
Lindblad, F.: Property directed generation of first-order test data. In: Proceedings of the Eighth Symposium on the Trends in Functional Programming (2007)
Moran, A., Sands, D.: Improvement in a lazy context: an operational theory for call-by-need. In: Proceedings of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (1999)
Naylor, M., Runciman, C.: Finding inputs that reach a target expression. In: Proceedings of the 7th IEEE International Working Conference on Source Code Analysis and Manipulation (2007)
Naylor, M.F.: Hardware-Assisted and Target-Directed Evaluation of Functional Programs. Ph.D. thesis, University of York (2008)
Norell, U.: Towards a Practical Programming Language Based on Dependent Type Theory. Ph.D. thesis, Goteborg University (2007)
Reich, J.S., Naylor, M., Runciman, C.: Advances in lazy SmallCheck. In: Hinze, R. (ed.) IFL 2012. LNCS, vol. 8241, pp. 53–70. Springer, Heidelberg (2013)
Runciman, C., Naylor, M., Lindblad, F.: SmallCheck and lazy SmallCheck automatic exhaustive testing for small values. In: Proceedings of the First ACM SIGPLAN Symposium on Haskell (2008)
Acknowledgements
We would like to thank members of the FP Lab in Nottingham and the anonymous referees for useful comments and suggestions regarding this work.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Fowler, J., Huttom, G. (2016). Towards a Theory of Reach. In: Serrano, M., Hage, J. (eds) Trends in Functional Programming. TFP 2015. Lecture Notes in Computer Science(), vol 9547. Springer, Cham. https://doi.org/10.1007/978-3-319-39110-6_2
Download citation
DOI: https://doi.org/10.1007/978-3-319-39110-6_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-39109-0
Online ISBN: 978-3-319-39110-6
eBook Packages: Computer ScienceComputer Science (R0)