Affiliation:
1. University of Freiburg, Freiburg, Germany
2. INRIA Paris-Rocquencourt and LIP6, Paris, France
Abstract
The ideal software contract fully specifies the behavior of an operation. Often, in particular in the context of scripting languages, a full specification may be cumbersome to state and may not even be desired. In such cases, a partial specification, which describes selected aspects of the behavior, may be used to raise the confidence in an implementation of the operation to a reasonable level.
We propose a novel kind of contract for object-based languages that specifies the side effects of an operation with
access permissions
. An access permission contract uses sets of access paths to express read and write permissions for the properties of the objects accessible from the operation.
We specify a monitoring semantics for access permission contracts and implement this semantics in a contract system for JavaScript. We prove soundness and stability of violation under increasing aliasing for our semantics.
Applications of access permission contracts include enforcing modularity, test-driven development, program understanding, and regression testing. With respect to testing and understanding, we find that adding access permissions to contracts increases the effectiveness of error detection through contract monitoring by 6-13%.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Fine-grained, dynamic access control for database-backed applications;Conference Companion of the 2nd International Conference on Art, Science, and Engineering of Programming;2018-04-09
2. Computational contracts;Science of Computer Programming;2015-02
3. Efficient dynamic access analysis using JavaScript proxies;Proceedings of the 9th symposium on Dynamic languages - DLS '13;2013