Abstract
Contract programming is one of the most promising ways of enhancing the reliability of Python, which becomes increasingly desired. Higher-order contract systems that support fully specifying the behaviors of iterators and functions are desirable for Python but have not been presented yet. Besides, even with them, debugging with contracts in Python would still be burdensome because of delayed contract checking. To resolve this problem, we present PyBlame, a higher-order contract system in Python, and ccdb, a source-level debugger equipped with features dedicated to debugging with delayed contract checking. PyBlame and ccdb are designed on the basis of the standard of Python and thus friendly to many Python programmers. We have experimentally confirmed the advantage and the efficacy of PyBlame and ccdb through the web framework Bottle.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
References
D12.1: High-level backends and interpreter feature prototypes. PyPy EU-Report (2007)
Carrillo-Castellon, M., Garcia-Molina, J., Pimentel, E., Repiso, I.: Design by contract in smalltalk. J. Object-Oriented Program 7(9), 23–28 (1996)
Chiş, A., Gîrba, T., Nierstrasz, O.: The moldable debugger: a framework for developing domain-specific debuggers. In: Proceedings of the 2015 ACM SIGPLAN International Conference on Software Language Engineering, SLE 2014, pp. 102–121. ACM (2014)
Chitil, O.: Practical typed lazy contracts. In: Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming, ICFP 2012, pp. 67–76. ACM (2012)
Chugh, R., Herman, D., Jhala, R.: Dependent types for JavaScript. In: Proceedings of the 2012 ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2012, pp. 587–606. ACM (2012)
Chugh, R., Rondon, P.M., Jhala, R.: Nested refinements: a logic for duck typing. In: Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, pp. 231–244. ACM (2012)
Dimoulas, C., Findler, R.B., Felleisen, M.: Option contracts. In: Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2013, pp. 475–494. ACM (2013)
Eby, P.J.: PEP 3333 - Python Web Server Gateway Interface v1.0.1 (2010). https://www.python.org/dev/peps/pep-3333/
Fähndrich, M., Barnett, M., Leijen, D., Logozzo, F.: Integrating a set of contract checking tools into visual studio. In: Proceedings of the Second International Workshop on Developing Tools as Plug-Ins, TOPI 2012, pp. 43–48. IEEE (2012)
Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming, ICFP 2002, pp. 48–59. ACM (2002)
Flanagan, C.: Hybrid type checking. In: Conference Record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2006, pp. 245–256. ACM (2006)
Heidegger, P., Bieniusa, A., Thiemann, P.: Access permission contracts for scripting languages. In: Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, pp. 111–122. ACM (2012)
Heidegger, P., Thiemann, P.: Contract-driven testing of JavaScript code. In: Vitek, J. (ed.) TOOLS 2010. LNCS, vol. 6141, pp. 154–172. Springer, Heidelberg (2010). doi:10.1007/978-3-642-13953-6_9
Keil, M., Thiemann, P.: Blame assignment for higher-order contracts with intersection and union. In: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming, ICFP 2015, pp. 375–386. ACM (2015)
Klein, C., Flatt, M., Findler, R.B.: Random testing for higher-order, stateful programs. In: Proceedings of the 2010 ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2010, pp. 555–566. ACM (2010)
Knowles, K., Flanagan, C.: Hybrid type checking. ACM Trans. Program. Lang. Syst. 32(2), 6:1–6:34 (2010)
Meyer, B.: Applying “Design by Contract”. Computer 25(10), 40–51 (1992)
Plösch, R.: Design by contract for Python. In: Proceedings of the Fourth Asia-Pacific Software Engineering and International Computer Science Conference, APSEC 1997, pp. 213–219. IEEE (1997)
van Rossum, G., Lehtosalo, J., Langa, Ł.: PEP 484 - Type Hints (2014). https://www.python.org/dev/peps/pep-0484/
Siek, J.G., Taha, W.: Gradual typing for functional languages. In: Scheme and Functional Programming 2006. TR-2006-06, University of Chicago (2006)
Strickland, T.S., Dimoulas, C., Takikawa, A., Felleisen, M.: Contracts for first-class classes. ACM Trans. Program. Lang. Syst. 35(3), 11:1–11:58 (2013)
Strickland, T.S., Felleisen, M.: Contracts for first-class classes. In: Proceedings of the 6th Symposium on Dynamic Languages, DLS 2010, pp. 97–112. ACM (2010)
Strickland, T.S., Tobin-Hochstadt, S., Findler, R.B., Flatt, M.: Chaperones and impersonators: run-time support for reasonable interposition. In: Proceedings of the 2012 ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2012, pp. 943–962. ACM (2012)
Vitousek, M.M., Kent, A.M., Siek, J.G., Baker, J.: Design and evaluation of gradual typing for Python. In: Proceedings of the 10th ACM Symposium on Dynamic Languages, DLS 2014, pp. 45–56. ACM (2014)
Wei, Y., Pei, Y., Furia, C.A., Silva, L.S., Buchholz, S., Meyer, B., Zeller, A.: Automated fixing of programs with contracts. In: Proceedings of the 19th International Symposium on Software Testing and Analysis, ISSTA 2010, pp. 61–72. ACM (2010)
Zhang, C., Yan, D., Zhao, J., Chen, Y., Yang, S.: BPGen: an automated breakpoint generator for debugging. In: Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering, ICSE 2010, vol. 2, pp. 271–274. ACM (2010)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing AG
About this paper
Cite this paper
Arai, R., Sato, S., Iwasaki, H. (2016). A Debugger-Cooperative Higher-Order Contract System in Python. In: Igarashi, A. (eds) Programming Languages and Systems. APLAS 2016. Lecture Notes in Computer Science(), vol 10017. Springer, Cham. https://doi.org/10.1007/978-3-319-47958-3_9
Download citation
DOI: https://doi.org/10.1007/978-3-319-47958-3_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-47957-6
Online ISBN: 978-3-319-47958-3
eBook Packages: Computer ScienceComputer Science (R0)