Skip to main content

An Empirical Study of Object Protocols in the Wild

  • Conference paper
ECOOP 2011 – Object-Oriented Programming (ECOOP 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6813))

Included in the following conference series:

Abstract

An active area of research in computer science is the prevention of violations of object protocols, i.e., restrictions on temporal orderings of method calls on an object. However, little is understood about object protocols in practice. This paper describes an empirical study of object protocols in some popular open-source Java programs. In our study, we have attempted to determine how often object protocols are defined, and how often they are used, while also developing a taxonomy of similar protocols. In the open-source projects in our study, comprising almost two million lines of code, approximately 7.2% of all types defined protocols, while 13% of classes were clients of types defining protocols. (For comparison, 2.5% of the types in the Java library define type parameters using Java Generics.) This suggests that protocol checking tools are widely applicable.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Acharya, M., Xie, T., Pei, J., Xu, J.: Mining API patterns as partial orders from source code: from usage scenarios to specifications. In: ESEC-FSE 2007, pp. 25–34. ACM Press, New York (2007)

    Google Scholar 

  2. Alur, R., Černý, P., Madhusudan, P., Nam, W.: Synthesis of interface specifications for java classes. In: POPL 2005, pp. 98–109. ACM Press, New York (2005)

    Google Scholar 

  3. Ball, T., Rajamani, S.K.: Automatically validating temporal safety properties of interfaces. In: Dwyer, M.B. (ed.) SPIN 2001. LNCS, vol. 2057, pp. 103–122. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  4. Beckman, N.E., Bierhoff, K., Aldrich, J.: Verifying correct usage of atomic blocks and typestate. In: OOPSLA 2008. ACM Press, New York (2008)

    Google Scholar 

  5. Bierhoff, K., Aldrich, J.: Modular typestate checking of aliased objects. In: OOPSLA 2007, pp. 301–320. ACM Press, New York (2007)

    Google Scholar 

  6. Bierhoff, K., Aldrich, J.: Lightweight object specification with typestates. In: ESEC-FSE 2005, pp. 217–226 (September 2005)

    Google Scholar 

  7. Bierhoff, K., Beckman, N.E., Aldrich, J.: Practical API protocol checking with access permissions. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 195–219. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  8. DeLine, R., Fähndrich, M.: Enforcing high-level protocols in low-level software. SIGPLAN Not. 36(5), 59–69 (2001)

    Article  Google Scholar 

  9. Dunfield, J., Pfenning, F.: Tridirectional typechecking. In: POPL 2004, pp. 281–292. ACM Press, New York (2004)

    Google Scholar 

  10. Fahndrich, M., Xia, S.: Establishing object invariants with delayed types. In: OOPSLA 2007, pp. 337–350. ACM Press, New York (2007)

    Google Scholar 

  11. Fairbanks, G., Garlan, D., Scherlis, W.: Design fragments make using frameworks easier. In: OOPSLA 2006, pp. 75–88. ACM Press, New York (2006)

    Google Scholar 

  12. Fink, S.J., Yahav, E., Dor, N., Ramalingam, G., Geay, E.: Effective typestate verification in the presence of aliasing. ACM Trans. Softw. Eng. Methodol. 17(2), 1–34 (2008)

    Article  Google Scholar 

  13. Foster, J.S., Johnson, R., Kodumal, J., Aiken, A.: Flow-insensitive type qualifiers. ACM Trans. Program. Lang. Syst. 28(6), 1035–1087 (2006)

    Article  Google Scholar 

  14. Gopinathan, M., Rajamani, S.K.: Enforcing object protocols by combining static and runtime analysis. In: OOPSLA 2008, pp. 245–260. ACM Press, New York (2008)

    Google Scholar 

  15. Heydarnoori, A., Czarnecki, K., Bartolomei, T.T.: Supporting framework use via automatically extracted concept-implementation templates. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 344–368. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  16. Jaspan, C., Aldrich, J.: Checking framework interactions with relationships. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 27–51. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  17. Joshi, P., Sen, K.: Predictive typestate checking of multithreaded Java programs. In: ASE 2008, pp. 288–296 (September 2008)

    Google Scholar 

  18. Kim, D.: An empirical study on the frequency and classification of object protocols in Java. Master’s thesis, Korea Advanced Institute of Science and Technology (2010)

    Google Scholar 

  19. Lam, P., Kuncak, V., Rinard, M.: Generalized typestate checking using set interfaces and pluggable analyses. SIGPLAN Not. 39(3), 46–55 (2004)

    Article  Google Scholar 

  20. Naeem, N.A., Lhotak, O.: Typestate-like analysis of multiple interacting objects. In: OOPSLA 2008, pp. 347–366. ACM Press, New York (2008)

    Google Scholar 

  21. Pradel, M., Bichsel, P., Gross, T.R.: A framework for the evaluation of specification miners based on finite state machines. In: ICSM (2010)

    Google Scholar 

  22. Qi, X., Myers, A.C.: Masked types for sound object initialization. In: POPL 2009, pp. 53–65. ACM Press, New York (2009)

    Google Scholar 

  23. Strom, R.E., Yemini, S.: Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng. 12(1), 157–171 (1986)

    Article  MATH  Google Scholar 

  24. Tempero, E., Anslow, C., Dietrich, J., Han, T., Li, J., Lumpe, M., Melton, H., Noble, J.: Qualitas corpus: A curated collection of Java code for empirical studies. In: 2010 Asia Pacific Software Engineering Conference (APSEC 2010) (December 2010) Corpus version 20090202r

    Google Scholar 

  25. Wasylkowski, A., Zeller, A., Lindig, C.: Detecting object usage anomalies. In: ESEC-FSE 2007, pp. 35–44. ACM Press, New York (2007)

    Google Scholar 

  26. Weimer, W., Necula, G.C.: Finding and preventing run-time error handling mistakes. SIGPLAN Not. 39(10), 419–431 (2004)

    Article  Google Scholar 

  27. Whaley, J., Martin, M.C., Lam, M.S.: Automatic extraction of object-oriented component interfaces. In: ISSTA 2002, pp. 218–228. ACM Press, New York (2002)

    Google Scholar 

  28. Zhong, H., Xie, T., Zhang, L., Pei, J., Mei, H.: MAPO: Mining and recommending API usage patterns. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 318–343. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Beckman, N.E., Kim, D., Aldrich, J. (2011). An Empirical Study of Object Protocols in the Wild. In: Mezini, M. (eds) ECOOP 2011 – Object-Oriented Programming. ECOOP 2011. Lecture Notes in Computer Science, vol 6813. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22655-7_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22655-7_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22654-0

  • Online ISBN: 978-3-642-22655-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics