Abstract
Micro patterns are similar to design patterns, except that micro patterns are stand at a lower, closer to the implementation, level of abstraction. Micro patterns are also unique in that they are mechanically recognizable, since each such pattern can be expressed as a formal condition on the structure of a class.This paper presents a catalog of 27 micro-patterns defined on Java classes and interfaces. The catalog captures a wide spectrum of common programming practices, including a particular and (intentionally restricted) use of inheritance, immutability, data management and wrapping, restricted creation, and emulation of procedural-, modular-, and even functional- programming paradigms with object oriented constructs. Together, the patterns present a set of prototypes after which a large portion of all Java classes and interfaces are modeled. We provide empirical indication that this portion is as high as 75%.A statistical analysis of occurrences of micro patterns in a large software corpus, spanning some 70,000 Java classes drawn from a rich set of application domains, shows, with high confidence level that the use of these patterns is not random. These results indicate consciousness and discernible design decisions, which are sustained in the software evolution. With high confidence level, we can also show that the use of these patterns is tied to the specification, or the purpose, that the software realizes.The traceability, abundance and the statistical significance of micro pattern occurrence raise the hope of using the classification of software into these patterns for a more founded appreciation of its design and code quality.
- E. Agerbo and A. Cornils. How to preserve the benefits of design patterns. In Proc. of the 13th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'98), pages 134--143, Vancouver, British Columbia, Oct.18-22 1998. ACM SIGPLAN Notices. Google ScholarDigital Library
- J. Aldrich, V. Kostadinov, and C. Chambers. Alias annotations for program understanding. In Proc. of the 17th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'02), Seattle, Washington, Nov. 4--8 2002. ACM SIGPLAN Notices. Google ScholarDigital Library
- P. Arnold and J. Gosling. The Java Programming Language. The Java Series. Addison-Wesley, 1996. Google ScholarDigital Library
- K. Beck. Smalltalk: best practice patterns. Prentice-Hall, 1st edition, 1997. Google ScholarDigital Library
- K. Beck. JUnit Pocket Guide. O'Reilly, 2004.Google Scholar
- A. Blewitt, A. Bundy, and I. Stark. Automatic verification of Java design patterns. In Proc. of the 16th IEEE Conference on Automated Software Engineering (ASE'01), pages 324--327, San Diego, California, 2001. IEEE Comp. Google ScholarDigital Library
- J. Bloch. Effective Java Programming Language Guide. Addison-Wesley, 1st edition, June 2001. Google ScholarDigital Library
- G. Bracha and W. R. Cook. Mixin-based inheritance. In Proceedings of the Conference on Object-Oriented Programming: Systems, Languages, and Applications / Proceedings of the European Conference on Object-Oriented Programming (OOPSLA/ECOOP'90), pages 303--311, Ottawa, Canada, Oct. 21-25 1990. ACM SIGPLAN Notices. Google ScholarDigital Library
- K. Brown. Design Reverse-Engineering and Automated Design Pattern Detection in Smalltalk. Masters thesis, North Carolina State University, 1996.Google Scholar
- M. Campione, K. Walrath, and A. Huml. The Java Tutorial: A Short Course on the Basics. Addison-Wesley, 2000. Google ScholarDigital Library
- D. N. Card and R. L. Glass. Measuring software design quality. Prentice-Hall, 1990. Google ScholarDigital Library
- S. R. Chidamber and C. F. Kemerer. A metrics suite for object oriented design. IEEE Trans. Softw. Eng., 20(6):476--493, June 1994. Google ScholarDigital Library
- T. Cohen and J. Gil. Self-calibration of metrics of Java methods. In Proc. of the 37th International Conference on Technology of Object-Oriented Languages and Systems (TOOLS'00 Pacific Conference), pages 94--106, Sydney, Australia, Nov. 20-23 2000. Prentice-Hall.Google ScholarCross Ref
- T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms. MIT Press, 1st edition, June 1990. Google ScholarDigital Library
- B. Demsky and M. C. Rinard. Automatic detection and repair of errors in data structures. In Proc. of the 18th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'03), pages 78--95, Anaheim, California, USA, Oct. 2003. ACM Press. Google ScholarDigital Library
- A. H. Eden. Formal specification of object-oriented design. In Proc. of the International Conference on Multidisciplinary Design in Engineering (CSME-MDE'01), Montreal, Canada, Nov. 21-22 2001.Google Scholar
- A. H. Eden. A visual formalism for object-oriented architecture. In Proc. of the 6thIntegrated Design and Process Technology (IDPT'02), California, June 23-28 2002. Society for Design and Process Science.Google Scholar
- A. H. Eden and R. Kazman. Architecture, design, implementation. In Proc. of the 25th International Conference on Software Engineering (ICSE'03), pages 149--159, Portland, Oregon, May 3-10 2003. IEEE Comp. Google ScholarDigital Library
- S. G. Eick, J. L. Steffen, and E. E. J. Sumner. Seesoft-a tool for visualizing line oriented software statistics. IEEE Trans. on Soft. Eng., 18(11):957--968, Nov. 1992. Google ScholarDigital Library
- G. Florijn, M. Meijers, and P. van Winsen. Tool support for object-oriented patterns. In Proc. of the 11th European Conference on Object-Oriented Programming (ECOOP'97), pages 472--495, Jyväskylä, Finland, June 9-13 1997. Springer.Google ScholarCross Ref
- E. Gamma, R. Helm, R. E. Johnson, and J. M. Vlissides. Design patterns: Abstraction and reuse of object-oriented design. In Proc. of the 7th European Conference on Object-Oriented Programming (ECOOP'93), pages 406--431, Kaiserslautern, Germany, July 26-30 1993. Springer. Google ScholarDigital Library
- E. Gamma, R. Helm, R. E. Johnson, and J. M. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Professional Computing series. Addison-Wesley, 1995. Google ScholarDigital Library
- A. Goldberg. Smalltalk-80: The Interactive Programming Environment. Addison-Wesley, 1984. Google ScholarDigital Library
- M. Grand. Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with Uml,Volume 1. Wiley, 2002. Google ScholarDigital Library
- D. Heuzeroth, T. Holl, G. Höström, and W. Löwe. Automatic design pattern detection. In Proc. of the 11thInternational Workshop on Program Comprehension (IWPC'03), page 94, Portland, Oregon, USA, May 2003. co-located with ICSE'03. Google ScholarDigital Library
- M. Lanza and S. Ducasse. A categorization of classes based on the visualization of their internal structure: the class blueprint. In Proc. of the 16th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'01), pages 300--311, Tampa Bay, Florida, Oct. 14--18 2001. ACM SIGPLAN Notices. Google ScholarDigital Library
- A. Lauder and S. Kent. Precise visual specification of design patterns. In Proc. of the 12th European Conference on Object-Oriented Programming (ECOOP'98), Brussels, Belgium, July 20--24 1998. Springer. Google ScholarDigital Library
- M. Lorenz and J. Kidd. Object-Oriented Software Metrics: a practical guide. Prentice-Hall, 1994. Google ScholarDigital Library
- J. K. H. Mak, C. S. T. Choy, and D. P. K. Lun. Precise modeling of design patterns in UML. In Proc. of the 26th International Conference on Software Engineering (ICSE'04), pages 252--261, Edinburgh, Scotland, United Kingdom, May 23-28 2004. IEEE Computer Society. Google ScholarDigital Library
- B. Meyer. Object-Oriented Software Construction. International Series in Computer Science. Prentice-Hall, 1988. Google ScholarDigital Library
- T. Mikkonen. Formalizing design patterns. In Proc. of the 20th International Conference on Software Engineering (ICSE'98), pages 115--124, Kyoto, Japan, Apr. 19-25 1998. IEEE Comp. Google ScholarDigital Library
- N. H. Minsky. Law-governed Linda communication model. Technical Report LCSR-TR-221, Dept. of Comp. Sc.Lab. for Comp. Sc. ResearchThe State Univ. of New Jersey RUTGERS, Mar. 1994.Google Scholar
- N. H. Minsky. Towards alias-free pointers. In Proc. of the 10th European Conference on Object-Oriented Programming (ECOOP'96), pages 189--209, Linz, Austria, July 8--12 1996. Springer. Google ScholarDigital Library
- J. Noble and R. Biddle. Patterns as signs. In Proc. of the 16th European Conference on Object-Oriented Programming (ECOOP'02), Malaga, Spain, June 10--14 2002. Springer. Google ScholarDigital Library
- M. Odersky, P. Altherr, V. Cremet, B. Emir, S. Maneth, S. Micheloud, N. Mihaylov, M. Schinz, E. Stenman, and M. Zenger. An overview of the Scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland, 2004.Google Scholar
- L. Prechelt and C. Krämer. Functionality versus practicality: Employing existing tools for recovering structural design patterns. J.UCS: Journal of Universal Computer Science, 4(12):866--882, 1998.Google Scholar
- M. Reiser and N. Wirth. Programming in Oberon: steps beyond Pascal and Modula. Addison-Wesley, June 1992. Google Scholar
- N. Schärli, S. Ducasse, O. Nierstrasz, and A. Black. Traits: Composable units of behavior. In Proc. of the 17th European Conference on Object-Oriented Programming (ECOOP'03), Darmstadt, Germany, July 21--25 2003. Springer.Google Scholar
- J. M. Smith and D. Stotts. Elemental design patterns: A formal semantics for composition of OO software architecture. In Proc. of the 27th Annual NASA Goddard Software Engineering Workshop (SEW'02), pages 183--190, Greenbelt, Maryland, Digital Equipment Corporation 5-6 2002. IEEE Comp. Soc. Press. Google ScholarDigital Library
- E. Soloway, J. Bonar, and K. Ehrlich. Cognitive strategies and looping constructs: An empirical study. Commun. ACM, 26(11):853--860, 1983. Google ScholarDigital Library
- J. T. Stasko. Tango: A framework and system for algorithm animation. Computer, 23(9):27--39, 1990. Google ScholarDigital Library
- M. D. Storey and H. A. Müller. Manipulating and documenting software structures using SHriMP views. In Proc. of the 11th International Conference on Software Maintenance (ICSM'95), page 275, Opio (Nice), France, Oct. 1995. IEEE Comp. Soc. Press. Google ScholarDigital Library
- B. Stroustrup. The C++ Programming Language. Addison-Wesley, 3rd edition, 1997. Google ScholarDigital Library
- S. T. Taft and R. A. Duff, editors. Ada 95 Reference Manual, Language and Standard Libraries, International Standard ISO/IEC 8652: 1995(E), volume 1246 of LNCS. Springer, 1997.Google Scholar
- P. E. van Emde Boas. Resistance is futile; formal linguistic observations on design patterns. Technical Report ILLC-CT-1997-03, The Institute For Logic, Language, and Computation (ILLC), University of Amsterdam, Feb. 1997.Google Scholar
- N. Wirth. The programming language Pascal. Acta Informatica, 1:35--63, 1971.Google ScholarDigital Library
- I. H. Witten and E. Frank. Data mining: practical machine learning tools and techniques with Java implementations. Morgan Kaufmann, 2000. Google ScholarDigital Library
Index Terms
- Micro patterns in Java code
Recommendations
Micro patterns in Java code
OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applicationsMicro patterns are similar to design patterns, except that micro patterns are stand at a lower, closer to the implementation, level of abstraction. Micro patterns are also unique in that they are mechanically recognizable, since each such pattern can be ...
An analysis of anti-micro-patterns effects on fault-proneness in large Java systems
SAC '12: Proceedings of the 27th Annual ACM Symposium on Applied ComputingMicro patterns are similar to design patterns, but are at a lower level of abstraction, closer to the implementation. Anti patterns are micro patterns not respecting the prescriptions of good Object Oriented programming practices. In this paper, we use ...
Java nano patterns: a set of reusable objects
ACM SE '10: Proceedings of the 48th Annual Southeast Regional ConferenceSoftware patterns are used in many applications and domains. They reduce time, effort and cost as they increase reliability, reusability and testability when used for developing software systems. Although they have been criticized for their high level ...
Comments