Abstract
Object-orientation relies on polymorphism to express behavioral variants. As opposed to traditional procedural design, explicit type-based conditionals should be avoided. This message is conveyed in introductory material on object orientation, as well as in object-oriented reengineering patterns. Is this principle followed in practice? In other words, are type predicates actually used in object-oriented software, and if so, to which extent?
Answering these questions will assist practitioners and researchers with providing information about the state of the practice, and informing the active research program of retrofitting type systems, clarifying whether complex flow-sensitive typing approaches are necessary. Other areas, such as refactoring and teaching object orientation, can also benefit from empirical evidence on the matter.
We report on a study of the use of type predicates in a large base of over 4 million lines of Smalltalk code. Our study shows that type predicates are in fact widely used to do explicit type dispatch, suggesting that flow-sensitive typing approaches are necessary for a type system retrofitted for a dynamic object-oriented language.
- J. Aldrich, J. Sunshine, D. Saini, and Z. Sparks. Typestate-oriented programming. In Proceedings of Onward!, pages 1015--1022. ACM, 2009. Google Scholar
Digital Library
- N. E. Beckman, D. Kim, and J. Aldrich. An empirical study of object protocols in the wild. In Mezini {17}, pages 2--26. Google Scholar
Digital Library
- K. Bierhoff and J. Aldrich. Modular typestate checking of aliased objects. In Proceedings of the 22nd ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2007), pages 301--320, Montreal, Canada, Oct. 2007. ACM Press. ACM SIGPLAN Notices, 42(10). Google Scholar
Digital Library
- J. Bloch. Effective Java, 2nd Edition. Addison-Wesley, 2008. Google Scholar
Digital Library
- O. Callau, R. Robbes, E. Tanter, and D. Rothlisberger. How (and why) developers use the dynamic features of programming languages: the case of Smalltalk. Empirical Software Engineering, 2012. Online First. Google Scholar
Digital Library
- P. Chalin and P. R. James. Non-null references by default in java: Alleviating the nullity annotation burden. In ECOOP 2007: Proceedings of the 21st European Conference on Object-Oriented Programming, pages 227--247, 2007. Google Scholar
Digital Library
- W. R. Cook. On understanding data abstraction, revisited. ACM SIGPLAN Notices, 44(10):557--572, 2009. Google Scholar
Digital Library
- R. DeLine and M. Fahndrich. Typestates for objects. In M. Odersky, editor, Proceedings of the 18th European Conference on Object-Oriented Programming (ECOOP 2004), number 3086 in Lecture Notes in Computer Science, pages 465--490, Oslo, Norway, June 2004. Springer-Verlag.Google Scholar
Cross Ref
- M. Fahndrich and K. R. M. Leino. Declaring and checking non-null types in an object-oriented language. In R. Crocker and G. L. Steele, Jr., editors, Proceedings of the 18th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2003), pages 302--312, Anaheim, CA, USA, Oct. 2003. ACM Press. ACM SIGPLAN Notices, 38(11). Google Scholar
Digital Library
- M. Fowler. Refactoring: improving the design of existing code. Addison-Wesley Professional, 1999. Google Scholar
Digital Library
- A. Guha, C. Saftoiu, and S. Krishnamurthi. Typing local control and state using flow analysis. In G. Barthe, editor, Proceedings of the 20th European Symposium on Programming (ESOP 2011), volume 6602 of Lecture Notes in Computer Science, pages 256--275. Springer-Verlag, 2011. Google Scholar
Digital Library
- S. Krishnamurthi, M. Felleisen, and D. P. Friedman. Synthesizing object-oriented and functional design to promote re-use. In Proceedings of the 12th European Conference on Object-Oriented Programming, ECOOP '98, pages 91--113, London, UK, UK, 1998. Springer-Verlag. ISBN 3-540-64737-6. Google Scholar
Digital Library
- G. Laforge. Whats new in Groovy 2.0? http://www.infoq.com/articles/new-groovy-20, 2012.Google Scholar
- M. Lungu, R. Robbes, and M. Lanza. Recovering inter-project dependencies in software ecosystems. In ASE'10: Proceedings of the 25th IEEE/ACM international conference on Automated Software Engineering, ASE '10, pages 309--312, 2010. Google Scholar
Digital Library
- D. Malayeri and J. Aldrich. Is structural subtyping useful? an empirical study. In G. Castagna, editor, Proceedings of the 18th European Symposium on Programming (ESOP 2009), volume 5502 of Lecture Notes in Computer Science, pages 95--111. Springer-Verlag, 2009. Google Scholar
Digital Library
- S. Meyers. Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition). Addison-Wesley, 2005. Google Scholar
Digital Library
- M. Mezini, editor. Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP 2011), volume 6813 of Lecture Notes in Computer Science, Lancaster, UK, July 2011. Springer-Verlag. Google Scholar
Digital Library
- O. Nierstrasz, S. Ducasse, and S. Demeyer. Object-Oriented Reengineering Patterns. Square Bracket Associates, 2009. Google Scholar
Digital Library
- B. C. Oliveira. Modular visitor components. In Proceedings of the 23rd European Conference on ECOOP 2009 -- Object-Oriented Programming, Genoa, pages 269--293, Berlin, Heidelberg, 2009. Springer-Verlag. ISBN 978-3-642-03012-3. Google Scholar
Digital Library
- C. Parnin, C. Bird, and E. R. Murphy-Hill. Java generics adoption: how new features are introduced, championed, or ignored. In MSR 2011: Proceedings of the 8th International Working Conference on Mining Software Repositories, pages 3--12, 2011. Google Scholar
Digital Library
- D. Pearce. Sound and complete flow typing with unions, intersections and negations. In R. Giacobazzi, J. Berdine, and I. Mastroeni, editors, Verification, Model Checking, and Abstract Interpretation, volume 7737 of Lecture Notes in Computer Science, pages 335--354. Springer Berlin Heidelberg, 2013.Google Scholar
- D. J. Pearce. A calculus for constraint-based flow typing. In Proceedings of the 15th Workshop on Formal Techniques for Java-like Programs, FTfJP '13, pages 7:1--7:7, 2013. ISBN 978-1-4503-2042-9. Google Scholar
Digital Library
- D. J. Pearce and J. Noble. Implementing a language with flow-sensitive and structural typing on the JVM. Electronic Notes in Theoretical Computer Science, 279(1):47 -- 59, 2011. ISSN 1571-0661. Proceedings of the Bytecode 2011 workshop, the Sixth Workshop on Bytecode Semantics, Verification, Analysis and Transformation. Google Scholar
Digital Library
- D. Posnett, V. Filkov, and P. Devanbu. Ecological inference in empirical software engineering. In Proceedings of the 26th ACM/IEEE International Conference on Automated Software Engineering (ASE 2011), pages 362--371, 2011. Google Scholar
Digital Library
- R. Robbes, D. Rothlisberger, and E. Tanter. Extensions during software evolution: Do objects meet their promise? In J. Noble, editor, Proceedings of the 26th European Conference on Object-oriented Programming (ECOOP 2012), Lecture Notes in Computer Science, pages 28--52, Beijing, China, June 2012. Springer-Verlag. Google Scholar
Digital Library
- D. Roberts, J. Brant, and R. Johnson. A refactoring tool for smalltalk. Theor. Pract. Object Syst., 3(4):253--263, Oct. 1997. ISSN 1074-3227. Google Scholar
Digital Library
- R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Transactions on Software Engineering, 12(1):157--171, 1986. Google Scholar
Digital Library
- E. D. Tempero, C. Anslow, J. Dietrich, T. Han, J. Li, M. Lumpe, H. Melton, and J. Noble. The qualitas corpus: A curated collection of java code for empirical studies. In APSEC 2010: Proceedings of the 17th Asia Pacific Software Engineering Conference, pages 336--345, 2010. Google Scholar
Digital Library
- A. Thies and E. Bodden. Refaflex: Safer refactorings for reflective java programs. In Proceedings of the 2012 International Symposium on Software Testing and Analysis, ISSTA 2012, pages 1--11, 2012. ISBN 978-1-4503-1454-1. Google Scholar
Digital Library
- S. Tobin-Hochstadt. Typed Scheme: From Scripts to Programs. PhD thesis, Northeastern University, Jan. 2010.Google Scholar
- S. Tobin-Hochstadt and M. Felleisen. The design and implementation of Typed Scheme. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2008), pages 395--406, San Francisco, CA, USA, Jan. 2008. ACM Press. Google Scholar
Digital Library
- S. Tobin-Hochstadt and M. Felleisen. Logical types for untyped languages. In Proceedings of the 15th ACM SIGPLAN Conference on Functional Programming (ICFP 2010), pages 117--128, Baltimore, Maryland, USA, Sept. 2010. ACM Press. Google Scholar
Digital Library
- M. Torgersen. The expression problem revisited four new solutions using generics. In In Proceedings of the 18th European Conference on Object-Oriented Programming, pages 123--143. Springer-Verlag, 2004.Google Scholar
- J. Winther. Guarded type promotion: Eliminating redundant casts in Java. In Proceedings of the 13th Workshop on Formal Techniques for Java-Like Programs, FTfJP '11, pages 6:1--6:8, 2011. ISBN 978-1- 4503-0893-9. Google Scholar
Digital Library
- R. Wolff, R. Garcia, E. Tanter, and J. Aldrich. Gradual typestate. In Mezini {17}, pages 459--483. Google Scholar
Digital Library
- M. Zenger and M. Odersky. Independently extensible solutions to the expression problem. In In Proc. FOOL 12, 2005.Google Scholar
Index Terms
On the use of type predicates in object-oriented software: the case of smalltalk
Recommendations
On the use of type predicates in object-oriented software: the case of smalltalk
DLS '14: Proceedings of the 10th ACM Symposium on Dynamic languagesObject-orientation relies on polymorphism to express behavioral variants. As opposed to traditional procedural design, explicit type-based conditionals should be avoided. This message is conveyed in introductory material on object orientation, as well ...
The Object-Oriented Functional Data Language
The object-oriented functional data language (O/sup 2/FDL) is an interactive strongly typed database programming language that integrates the object-oriented and functional programming paradigms. It was designed for advanced applications that require a ...
A comparison of object-oriented languages in software engineering
Object-oriented programming is still a relatively new technology in the world of web development. Object-oriented programming languages directly support the object notions of classes, inheritance, information hiding, and dynamic binding. In Object-...







Comments