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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
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)
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)
Beckman, N.E., Bierhoff, K., Aldrich, J.: Verifying correct usage of atomic blocks and typestate. In: OOPSLA 2008. ACM Press, New York (2008)
Bierhoff, K., Aldrich, J.: Modular typestate checking of aliased objects. In: OOPSLA 2007, pp. 301–320. ACM Press, New York (2007)
Bierhoff, K., Aldrich, J.: Lightweight object specification with typestates. In: ESEC-FSE 2005, pp. 217–226 (September 2005)
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)
DeLine, R., Fähndrich, M.: Enforcing high-level protocols in low-level software. SIGPLAN Not. 36(5), 59–69 (2001)
Dunfield, J., Pfenning, F.: Tridirectional typechecking. In: POPL 2004, pp. 281–292. ACM Press, New York (2004)
Fahndrich, M., Xia, S.: Establishing object invariants with delayed types. In: OOPSLA 2007, pp. 337–350. ACM Press, New York (2007)
Fairbanks, G., Garlan, D., Scherlis, W.: Design fragments make using frameworks easier. In: OOPSLA 2006, pp. 75–88. ACM Press, New York (2006)
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)
Foster, J.S., Johnson, R., Kodumal, J., Aiken, A.: Flow-insensitive type qualifiers. ACM Trans. Program. Lang. Syst. 28(6), 1035–1087 (2006)
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)
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)
Jaspan, C., Aldrich, J.: Checking framework interactions with relationships. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 27–51. Springer, Heidelberg (2009)
Joshi, P., Sen, K.: Predictive typestate checking of multithreaded Java programs. In: ASE 2008, pp. 288–296 (September 2008)
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)
Lam, P., Kuncak, V., Rinard, M.: Generalized typestate checking using set interfaces and pluggable analyses. SIGPLAN Not. 39(3), 46–55 (2004)
Naeem, N.A., Lhotak, O.: Typestate-like analysis of multiple interacting objects. In: OOPSLA 2008, pp. 347–366. ACM Press, New York (2008)
Pradel, M., Bichsel, P., Gross, T.R.: A framework for the evaluation of specification miners based on finite state machines. In: ICSM (2010)
Qi, X., Myers, A.C.: Masked types for sound object initialization. In: POPL 2009, pp. 53–65. ACM Press, New York (2009)
Strom, R.E., Yemini, S.: Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng. 12(1), 157–171 (1986)
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
Wasylkowski, A., Zeller, A., Lindig, C.: Detecting object usage anomalies. In: ESEC-FSE 2007, pp. 35–44. ACM Press, New York (2007)
Weimer, W., Necula, G.C.: Finding and preventing run-time error handling mistakes. SIGPLAN Not. 39(10), 419–431 (2004)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)