skip to main content
article

Micro patterns in Java code

Published:12 October 2005Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. P. Arnold and J. Gosling. The Java Programming Language. The Java Series. Addison-Wesley, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. K. Beck. Smalltalk: best practice patterns. Prentice-Hall, 1st edition, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. Beck. JUnit Pocket Guide. O'Reilly, 2004.Google ScholarGoogle Scholar
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Bloch. Effective Java Programming Language Guide. Addison-Wesley, 1st edition, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. K. Brown. Design Reverse-Engineering and Automated Design Pattern Detection in Smalltalk. Masters thesis, North Carolina State University, 1996.Google ScholarGoogle Scholar
  10. M. Campione, K. Walrath, and A. Huml. The Java Tutorial: A Short Course on the Basics. Addison-Wesley, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. N. Card and R. L. Glass. Measuring software design quality. Prentice-Hall, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms. MIT Press, 1st edition, June 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarCross RefCross Ref
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. Goldberg. Smalltalk-80: The Interactive Programming Environment. Addison-Wesley, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Grand. Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with Uml,Volume 1. Wiley, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Lorenz and J. Kidd. Object-Oriented Software Metrics: a practical guide. Prentice-Hall, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. B. Meyer. Object-Oriented Software Construction. International Series in Computer Science. Prentice-Hall, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  35. 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 ScholarGoogle Scholar
  36. 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 ScholarGoogle Scholar
  37. M. Reiser and N. Wirth. Programming in Oberon: steps beyond Pascal and Modula. Addison-Wesley, June 1992. Google ScholarGoogle Scholar
  38. 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 ScholarGoogle Scholar
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. E. Soloway, J. Bonar, and K. Ehrlich. Cognitive strategies and looping constructs: An empirical study. Commun. ACM, 26(11):853--860, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. J. T. Stasko. Tango: A framework and system for algorithm animation. Computer, 23(9):27--39, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  43. B. Stroustrup. The C++ Programming Language. Addison-Wesley, 3rd edition, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. 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 ScholarGoogle Scholar
  45. 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 ScholarGoogle Scholar
  46. N. Wirth. The programming language Pascal. Acta Informatica, 1:35--63, 1971.Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. I. H. Witten and E. Frank. Data mining: practical machine learning tools and techniques with Java implementations. Morgan Kaufmann, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Micro patterns in Java code

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 40, Issue 10
      Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applications
      October 2005
      531 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1103845
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
        October 2005
        562 pages
        ISBN:1595930310
        DOI:10.1145/1094811

      Copyright © 2005 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 12 October 2005

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader