skip to main content
research-article
Open Access

A theory of contracts for Web services

Published:03 July 2009Publication History
Skip Abstract Section

Abstract

Contracts are behavioral descriptions of Web services. We devise a theory of contracts that formalizes the compatibility of a client with a service, and the safe replacement of a service with another service. The use of contracts statically ensures the successful completion of every possible interaction between compatible clients and services.

The technical device that underlies the theory is the filter, which is an explicit coercion preventing some possible behaviors of services and, in doing so, make services compatible with different usage scenarios. We show that filters can be seen as proofs of a sound and complete subcontracting deduction system which simultaneously refines and extends Hennessy's classical axiomatization of the must testing preorder. The relation is decidable, and the decision algorithm is obtained via a cut-elimination process that proves the coherence of subcontracting as a logical system.

Despite the richness of the technical development, the resulting approach is based on simple ideas and basic intuitions. Remarkably, its application is mostly independent of the language used to program the services or the clients. We outline the practical aspects of our theory by studying two different concrete syntaxes for contracts and applying each of them to Web services languages. We also explore implementation issues of filters and discuss the perspectives of future research this work opens.

References

  1. ]]Alves, A., Arkin, A., Askary, S., Barreto, C., et al. 2007. Web Services Business Process Execution Language Version 2.0. OASIS Standard, http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html.Google ScholarGoogle Scholar
  2. ]]Baeten, J. C. M., Corradini, F., and Grabmayer, C. A. 2007. A characterization of regular expressions under bisimulation. J. ACM 54, 2, 6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. ]]Banerji, A., Bartolini, C., Beringer, D., Chopella, V., et al. 2002. Web services conversation language (wscl) 1.0. W3C Note, http://www.w3.org/TR/2002/NOTE-wscl10-20020314.Google ScholarGoogle Scholar
  4. ]]Bellwood, T., Capell, S., Clement, L., Colgrave, J., et al. 2005. UDDI Version 3.0.2. OASIS Standard, http://uddi.org/pubs/uddi-v3.0.2-20041019.htm.Google ScholarGoogle Scholar
  5. ]]Berardi, D., Calvanese, D., De Giacomo, G., Lenzerini, M., and Mecella, M. 2003. Automatic composition of e-services that export their behavior. In Proceedings of the 1st International Conference on Service Oriented Computing (ICSOC), Lecture Notes in Computer Science, vol. 2910, Springer, 43--58.Google ScholarGoogle Scholar
  6. ]]Bernardi, G., Bugliesi, M., Macedonio, D., and Rossi, S. 2008. A theory of adaptable contract-based service composition. In Proceedings of Workshop on Global Computing Models and Technologies (GlobalComp'08). IEEE Computer Society Press.Google ScholarGoogle Scholar
  7. ]]Bravetti, M. and Zavattaro, G. 2007. Towards a unifying theory for choreography conformance and contract compliance. In Proceedings of the 6th International Symposium on Software Composition. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. ]]Brinksma, E., Scollo, G., and Steenbergen, C. 1995. Lotos specifications, their implementations and their tests. In Conformance Testing Methodologies and Architectures for OSI Protocols. IEEE Computer Society Press, 468--479. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. ]]Bruce, K. and Longo, G. 1990. A modest model of records, inheritance and bounded quantification. Inform. Comput. 87, 1/2, 196--240. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. ]]Carbone, M., Honda, K., and Yoshida, N. 2007a. A calculus of global interaction based on session types. Electron. Notes Theor. Comput. Sci. 171, 3, 127--151. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. ]]Carbone, M., Honda, K., and Yoshida, N. 2007b. Structured communication-centred programming for Web services. In Proceedings of the 16th European Symposium on Programming (ESOP'07). Lecture Notes in Computer Science, vol. 4421. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. ]]Cardelli, L. 1988. A semantics of multiple inheritance. Inform. Comput. 76, 138--164. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. ]]Carpineti, S., Castagna, G., Laneve, C., and Padovani, L. 2006. A formal account of contracts for Web Services. In Proceedings of the 3rd International Workshop on Web Services and Formal Methods. Lecture Notes in Computer Science, vol. 4184. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. ]]Castagna, G., Dezani-Ciancaglini, M., Giachino, E., and Padovani, L. 2008. General session types. Tech. rep. id.: hal-00334435, CNRS - PPS, University Paris 7. http://hal.archives-ouvertes.fr/hal-00334435.Google ScholarGoogle Scholar
  15. ]]Castagna, G. and Frisch, A. 2005. A gentle introduction to semantic subtyping. In Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (Summary in ICALP'05). (PPDP'05). Lecture Notes in Computer Science, vol. 3580, Springer, 30--34. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. ]]Castagna, G., Gesbert, N., and Padovani, L. 2007. A theory of contracts for Web services. In Proceedings of the 5th ACM-SIGPLAN Workshop on Programming Language Technologies for XML (PLAN-X'07). Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. ]]Castagna, G., Gesbert, N., and Padovani, L. 2008. A theory of contracts for Web services. In Proceedings of the 35th ACM Symposium on Principles of Programming Languages (POPL'08). 261--272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. ]]Chen, G. 2004. Soundness of coercion in the calculus of constructions. J. Logic Comput. 14, 3, 405--427. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. ]]Chinnici, R., Haas, H., Lewis, A.-A., Moreau, J.-J., Orchard, D., and Weerawarana, S. 2007a. Web services description language (wsdl) version 2.0 Part 2: Adjuncts. W3C Recommendation, http://www.w3.org/TR/wsdl20-adjuncts/.Google ScholarGoogle Scholar
  20. ]]Chinnici, R., Moreau, J.-J., Ryman, A., and Weerawarana, S. 2007b. Web services description language (wsdl) version 2.0 Part 1: Core language. W3C Recommendation, http://www.w3.org/TR/wsdl20/.Google ScholarGoogle Scholar
  21. ]]Courcelle, B. 1983. Fundamental properties of infinite trees. Theor. Comput. Sci. 25, 95--169.Google ScholarGoogle ScholarCross RefCross Ref
  22. ]]De Giacomo, G. and Sardiña, S. 2007. Automatic synthesis of new behaviors from a library of available behaviors. In Proceedings of the International Joint Conference on Artificial Intelligence. 1866--1871. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. ]]De Nicola, R. and Hennessy, M. 1984. Testing equivalences for processes. Theor. Comput. Sci. 34, 83--133.Google ScholarGoogle ScholarCross RefCross Ref
  24. ]]De Nicola, R. and Hennessy, M. 1987. CCS without τ's. In Procedings of the Colloquium on Trees and Algebra in Programming (TAPSOFT/CAAP'87). Lecture Notes in Computer Science, vol. 249. Springer, 138--152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. ]]De Nicola, R. and Labella, A. 2003. Nondeterministic regular expressions as solutions of equational systems. Theor. Comput. Sci. 302, 1--3, 179--189. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. ]]Derrick, J., Bowman, H., Boiten, E., and Steen, M. 1996. Comparing LOTOS and Z refinement relations. In Proceedings of the Joint International Conference on Formal Description Techniques and Protocol Specification Testing and Verification (FORTE/PSTV'96). Chapman & Hall, 501--516. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. ]]Di Cosmo, R. 1995. Isomorphisms of Types: From Lambda Calculus to Information Retrieval and Language Design. Birkhäuser. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. ]]Fallside, D. C. and Walmsley, P. 2004. XML Schema part 0: Primer second edition. W3C Recommendation, http://www.w3.org/TR/xmlschema-0/.Google ScholarGoogle Scholar
  29. ]]Fournet, C. and Gonthier, G. 1996. The reflexive chemical abstract machine and the join-calculus. In Proceedings of the 23rd ACM Symposium on Principles of Programming Languages. ACM, 372--385. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. ]]Fournet, C., Gonthier, G., Lévy, J.-J., Maranget, L., and Rémy, D. 1996. A calculus of mobile agents. In Proceedings of the International Conference on Concurrency Theory. Lecture Notes in Computer Science, vol. 1119. Springer, 406--421. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. ]]Fournet, C., Hoare, C. A. R., Rajamani, S. K., and Rehof, J. 2004. Stuck-free conformance. In Proceedings of the International Conference on Computer-aided Verification (CAV'04). Lecture Notes in Computer Science, vol. 3114. Springer.Google ScholarGoogle Scholar
  32. ]]Frisch, A., Castagna, G., and Benzaken, V. 2008. Semantic subtyping: Dealing set-theoretically with function, union, intersection, and negation types. J. ACM 55, 4, 1--64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. ]]Gay, S. and Hole, M. 2005. Subtyping for session types in the π-calculus. Acta Informatica 42, 2--3, 191--225.Google ScholarGoogle ScholarCross RefCross Ref
  34. ]]Hennessy, M. 1985. Acceptance trees. J. ACM 32, 4, 896--928. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. ]]Hennessy, M. 1988. Algebraic Theory of Processes. Foundation of Computing. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. ]]Honda, K. 1993. Types for dyadic interaction. In Proceedings of the International Conference on Concurrency Theory (CONCUR'93). Lecture Notes in Computer Science, vol. 715. Springer, 509--523. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. ]]Honda, K., Vasconcelos, V. T., and Kubo, M. 1998. Language primitives and type discipline for structured communication-based programming. In Proceedings of the European Symposium on Programming. Lecture Notes in Computer Science, vol. 1381. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. ]]Hull, R., Benedikt, M., Christophides, V., and Su, J. 2003. E-services: A look behind the curtain. In Proceedings of the 22nd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS'03). ACM, New York, 1--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. ]]Laneve, C. and Padovani, L. 2006. Smooth orchestrators. In Proceedings of the Internatiomal Conference on Foundations of Software Science and Computation Structures, L. Aceto and A. Ingólfsdóttir, Eds. Lecture Notes in Computer Science, vol. 3921. Springer, 32--46. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. ]]Laneve, C. and Padovani, L. 2007. The must preorder revisited: An algebraic theory for Web services contracts. In Proceedings of the 18th International Conference on Concurrency Theory. Lecture Notes in Computer Science, vol. 4703, Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. ]]Laneve, C. and Padovani, L. 2008. The pairing of contracts and session types. In Proceedings of the Colloquium in Honour of Ugo Montinari. Lecture Notes in Computer Science, vol. 5065. Springer, 681--700. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. ]]Milner, R. 1982. A Calculus of Communicating Systems. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. ]]Padovani, L. 2008. Contract-directed synthesis of simple orchestrators. Proceedings of the 19th International Conference on Concurrency Theory. Lecture Notes in Computer Science, vol. 5201. Springer, 131--146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. ]]Pistore, M., Traverso, P., Bertoli, P., and Marconi, A. 2005. Automated synthesis of composite bpel4ws Web services. In Proceedings of the IEEE International Conference on Web Services (ICWS '05). IEEE Computer Society, 293--301. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. ]]Rittri, M. 1993. Retrieving library functions by unifying types modulo linear isomorphism. RAIRO Theor. Informat. Appl. 27, 6, 523--540.Google ScholarGoogle ScholarCross RefCross Ref
  46. ]]Soloviev, S., Jones, A., and Luo, Z. 1996. Some algorithmic and proof-theoretical aspects of coercive subtyping. Lecture Notes in Computer Science, vol. 1512, Springer, 173--196. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. ]]Takeuchi, K., Honda, K., and Kubo, M. 1994. An interaction-based language and its typing system. In Proceedings of the Parallel Architectures and Languages Europe. 398--413. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. ]]Traverso, P. and Pistore, M. 2004. Automated composition of semantic Web services into executable processes. In Proceedings of the International Semantic Web Conference. 380--394.Google ScholarGoogle Scholar

Index Terms

  1. A theory of contracts for Web services

              Recommendations

              Reviews

              Wolfgang Schreiner

              In Web-based computing, services and clients must agree on their contract-the order of the messages to be exchanged-in order to have a successful conversation. In particular, it must be possible to decide whether the contract offered by a service is compatible with the contract accepted by a client, or whether one service can be safely replaced by another service that has a different contract. This paper addresses these problems by introducing a subcontract relation between contracts ? and ?, so that every client that complies with the services of ? also complies with the services of ?. One might be tempted to immediately consider every service of ? as a service of ?, but the authors realize that this view leads to a dead end: central properties such as the transitivity of the subcontract relation cannot be established. Therefore, the authors adopt an idea from type theory: a process of ? can be coerced to a process of ? by a filter that removes behaviors not visible in ?. The authors elaborate this idea into a complete theory. Their deduction system yields a subcontract checker that generates a filter between contracts or proves that no filter exists. This enjoyable paper explains the basic intuitive ideas that set the stage for the formal presentations. Although the authors do not elaborate on certain aspects, such as contracts for infinite behaviors, the theory presented in this paper builds a strong basis for further research. Online Computing Reviews Service

              Access critical reviews of Computing literature here

              Become a reviewer for Computing Reviews.

              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 ACM Transactions on Programming Languages and Systems
                ACM Transactions on Programming Languages and Systems  Volume 31, Issue 5
                June 2009
                152 pages
                ISSN:0164-0925
                EISSN:1558-4593
                DOI:10.1145/1538917
                Issue’s Table of Contents

                Copyright © 2009 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 3 July 2009
                • Accepted: 1 January 2009
                • Revised: 1 November 2008
                • Received: 1 May 2008
                Published in toplas Volume 31, Issue 5

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article
                • Research
                • Refereed

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader