Micro patterns in Java code

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.

[1]  John F. Wakerly,et al.  The programming language PASCAL , 1979, Microprocessors and microsystems.

[2]  Oscar Nierstrasz,et al.  Traits: Composable Units of Behaviour , 2002, ECOOP.

[3]  Welf Löwe,et al.  Automatic design pattern detection , 2003, 11th IEEE International Workshop on Program Comprehension, 2003..

[4]  Amnon H. Eden,et al.  Objectives , 1975 .

[5]  Martin Odersky,et al.  An Overview of the Scala Programming Language , 2004 .

[6]  Niklaus Wirth,et al.  Programming in Oberon - steps beyond Pascal and Modula , 1992 .

[7]  Ellen Agerbo,et al.  How to preserve the benefits of design patterns , 1998, OOPSLA '98.

[8]  Adele Goldberg,et al.  Smalltalk-80 - the interactive programming environment , 1984 .

[9]  Marco Meijers,et al.  Tool Support for Object-Oriented Patterns , 1997, ECOOP.

[10]  Alan R. Earls,et al.  Digital equipment corporation. , 2004, Analytical chemistry.

[11]  Joshua J. Bloch Effective Java : programming language guide , 2001 .

[12]  Rick Kazman,et al.  Architecture, design, implementation , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

[13]  James Gosling,et al.  The Java Programming Language" The Java Series , 1996 .

[14]  Daniel Pak-Kong Lun,et al.  Precise modeling of design patterns in UML , 2004, Proceedings. 26th International Conference on Software Engineering.

[15]  Mark Lorenz,et al.  Object-oriented software metrics - a practical guide , 1994 .

[16]  J. McC Smith,et al.  Elemental design patterns: a formal semantics for composition of OO software architecture , 2002, 27th Annual NASA Goddard/IEEE Software Engineering Workshop, 2002. Proceedings..

[17]  Ken Arnold,et al.  The Java programming language (2nd ed.) , 1998 .

[18]  Stuart Kent,et al.  Precise Visual Specification of Design Patterns , 1998, ECOOP.

[19]  Naftaly H. Minsky,et al.  Law-Governed Linda Communication Model , 1995 .

[20]  Stéphane Ducasse,et al.  A categorization of classes based on the visualization of their internal structure: the class blueprint , 2001, OOPSLA '01.

[21]  Robert L. Glass,et al.  Measuring software design quality , 1990 .

[22]  Joseph Gil,et al.  Self-calibration of metrics of Java methods , 2000, Proceedings 37th International Conference on Technology of Object-Oriented Languages and Systems. TOOLS-Pacific 2000.

[23]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[24]  Kyle G. Brown,et al.  Design reverse-engineering and automated design-pattern detection in Smalltalk , 1996 .

[25]  Ian H. Witten,et al.  Data mining: practical machine learning tools and techniques with Java implementations , 2002, SGMD.

[26]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[27]  Craig Chambers,et al.  Alias annotations for program understanding , 2002, OOPSLA '02.

[28]  Hausi A. Müller,et al.  Manipulating and documenting software structures using SHriMP views , 1995, Proceedings of International Conference on Software Maintenance.

[29]  Mary Campione,et al.  The Java Tutorial: A Short Course on the Basics , 2006 .

[30]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[31]  Alan Bundy,et al.  Automatic verification of Java design patterns , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

[32]  Kate Ehrlich,et al.  Cognitive strategies and looping constructs: an empirical study , 1983, CACM.

[33]  Stephen G. Eick,et al.  Seesoft-A Tool For Visualizing Line Oriented Software Statistics , 1992, IEEE Trans. Software Eng..

[34]  J.T. Stasko,et al.  Tango: a framework and system for algorithm animation , 1990, Computer.

[35]  Amnon H Eden A VISUAL FORMALISM FOR OBJECT-ORIENTED ARCHITECTURE , 2002 .

[36]  James Noble,et al.  Patterns as Signs , 2002, ECOOP.

[37]  Kent L. Beck,et al.  Smalltalk best practice patterns , 1996 .

[38]  Peter Van Emde Boas,et al.  Resistance is Futile; Formal Linguistic Observations on Design Patterns , 1997 .

[39]  Naftaly H. Minsky Towards Alias-Free Pointers , 1996, ECOOP.

[40]  Tommi Mikkonen,et al.  Formalizing design patterns , 1998, Proceedings of the 20th International Conference on Software Engineering.

[41]  Martin C. Rinard,et al.  Automatic detection and repair of errors in data structures , 2003, OOPSLA '03.

[42]  Ken Arnold,et al.  The Java Programming Language , 1996 .

[43]  Lutz Prechelt,et al.  Functionality versus Practicality: Employing Existing Tools for Recovering Structural Design Patterns , 1998, J. Univers. Comput. Sci..

[44]  Mark Grand Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with UML , 2002 .

[45]  Ralph E. Johnson,et al.  Design Patterns: Abstraction and Reuse of Object-Oriented Design , 1993, ECOOP.

[46]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[47]  William R. Cook,et al.  Mixin-based inheritance , 1990, OOPSLA/ECOOP '90.