A Heuristic Approach for Computing Effects

  • Phillip Heidegger
  • Peter Thiemann
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6705)

Abstract

The effect of an operation on an object network can be described by the access paths along which the function reads or writes object properties. Abstracted to access path permissions, the effect can serve as part of the operation’s documentation, augmenting a type signature or a contract for the operation. Statically determining such an effect is a challenging problem, in particular in a dynamic language which represents objects by hash tables like the current breed of scripting languages.

In this work, we propose an analysis that computes access permissions describing the effect of an operation from a set of access paths obtained by running the program. The main ingredient of the analysis is a novel heuristic to abstract a set of access paths to a concise access permission.

Our analysis is implemented as part of JSConTest, a testing framework for JavaScript. It has been applied to a range of examples with encouraging results.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    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)CrossRefGoogle Scholar
  2. 2.
    Heidegger, P., Bieniusa, A., Thiemann, P.: Access permission contracts. Submitted for publication (2010), http://proglang.informatik.uni-freiburg.de/jscontest/
  3. 3.
    Fredkin, E.: Trie memory. Communications of the ACM 3, 490–499 (1960)CrossRefGoogle Scholar
  4. 4.
    Gifford, D., Lucassen, J.: Integrating functional and imperative programming. In: Proc. 1986 ACM Conf. on Lisp and Functional Programming, pp. 28–38 (1986)Google Scholar
  5. 5.
    Talpin, J.P., Jouvelot, P.: The type and effect discipline. Information and Computation 111(2), 245–296 (1994)MathSciNetCrossRefMATHGoogle Scholar
  6. 6.
    Tofte, M., Talpin, J.P.: Region-based memory management. Information and Computation 132(2), 109–176 (1997)MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    Birkedal, L., Tofte, M.: A constraint-based region inference algorithm. Theoretical Computer Science 58, 299–392 (2001)MathSciNetCrossRefMATHGoogle Scholar
  8. 8.
    Deutsch, A.: A storeless model of aliasing and its abstractions using finite representations of right-regular equivalence relations. In: Proc. IEEE International Conference on Computer Languages 1992, pp. 2–13. IEEE, CA (1992)CrossRefGoogle Scholar
  9. 9.
    Greenhouse, A., Boyland, J.: An object-oriented effects system. In: Liu, H. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 205–229. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  10. 10.
    Skalka, C.: Trace effects and object orientation. In: Proceedings of the ACM Conference on Principles and Practice of Declarative Programming, Lisbon, Portugal (2005)Google Scholar
  11. 11.
    Gold, E.M.: Language identification in the limit. Information and Control 10(5), 447–474 (1967)MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    Angluin, D.: Inductive inference of formal languages from positive data. Information and Control 45(2), 117–135 (1980)MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Denis, F.: Learning regular languages from simple positive examples. Machine Learning 44(1/2), 37–66 (2001)CrossRefMATHGoogle Scholar
  14. 14.
    Firoiu, L., Oates, T., Cohen, P.R.: Learning a deterministic finite automaton with a recurrent neural network. In: Honavar, V.G., Slutzki, G. (eds.) ICGI 1998. LNCS (LNAI), vol. 1433, pp. 90–101. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  15. 15.
    Maffeis, S., Mitchell, J.C., Taly, A.: Isolating javaScript with filters, rewriting, and wrappers. In: Backes, M., Ning, P. (eds.) ESORICS 2009. LNCS, vol. 5789, pp. 505–522. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  16. 16.
    Chugh, R., Meister, J.A., Jhala, R., Lerner, S.: Staged information flow for JavaScript. In: Proc. 2009 ACM Conf. PLDI, pp. 50–62. ACM Press, Ireland (2009)Google Scholar
  17. 17.
    Yu, D., Chander, A., Islam, N., Serikov, I.: JavaScript instrumentation for browser security. In: Felleisen, M. (ed.) Proc. 34th ACM Symp. POPL, pp. 237–249. ACM Press, France (2007)Google Scholar
  18. 18.
    Reis, C., Dunagan, J., Wang, H.J., Dubrovsky, O., Esmeir, S.: BrowserShield: Vulnerability-driven filtering of dynamic HTML. ACM Trans. Web 1(3), 11 (2007)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Phillip Heidegger
    • 1
  • Peter Thiemann
    • 1
  1. 1.University of FreiburgGermany

Personalised recommendations