Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1094811.1094819acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Micro patterns in Java code

Published: 12 October 2005 Publication History

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

Cited By

View all
  • (2024)Streamlining Java Programming: Uncovering Well-Formed Idioms with IdioMineProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639135(1-12)Online publication date: 20-May-2024
  • (2024)Design Pattern Representation and Detection Based on Heterogeneous Information NetworkReuse and Software Quality10.1007/978-3-031-66459-5_5(72-91)Online publication date: 13-Jul-2024
  • (2023)Pre-implementation Method Name Prediction for Object-oriented ProgrammingACM Transactions on Software Engineering and Methodology10.1145/359720332:6(1-35)Online publication date: 29-Sep-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

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
  • 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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 October 2005

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. design patterns
  2. implementation patterns
  3. object-oriented programming
  4. program analysis

Qualifiers

  • Article

Conference

OOPSLA05
Sponsor:

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)39
  • Downloads (Last 6 weeks)2
Reflects downloads up to 03 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Streamlining Java Programming: Uncovering Well-Formed Idioms with IdioMineProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639135(1-12)Online publication date: 20-May-2024
  • (2024)Design Pattern Representation and Detection Based on Heterogeneous Information NetworkReuse and Software Quality10.1007/978-3-031-66459-5_5(72-91)Online publication date: 13-Jul-2024
  • (2023)Pre-implementation Method Name Prediction for Object-oriented ProgrammingACM Transactions on Software Engineering and Methodology10.1145/359720332:6(1-35)Online publication date: 29-Sep-2023
  • (2023)Lorgnette: Creating Malleable Code ProjectionsProceedings of the 36th Annual ACM Symposium on User Interface Software and Technology10.1145/3586183.3606817(1-16)Online publication date: 29-Oct-2023
  • (2023)A Software Vulnerability Prediction Model Using Traceable Code Patterns and Software MetricsSN Computer Science10.1007/s42979-023-02077-54:5Online publication date: 9-Aug-2023
  • (2022)Quality attribute traceability based on Clone MicrotacticsSoftware Quality Journal10.1007/s11219-022-09606-031:2(533-573)Online publication date: 23-Nov-2022
  • (2021)GEML: A grammar-based evolutionary machine learning approach for design-pattern detectionJournal of Systems and Software10.1016/j.jss.2021.110919175(110919)Online publication date: May-2021
  • (2021)Using software metrics for predicting vulnerable classes and methods in Java projectsJournal of Software: Evolution and Process10.1002/smr.230333:3Online publication date: 3-Mar-2021
  • (2020)A Survey on Renamings of Software EntitiesACM Computing Surveys10.1145/337944353:2(1-38)Online publication date: 17-Apr-2020
  • (2019)Feature Maps: A Comprehensible Software Representation for Design Pattern Detection2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER.2019.8667978(207-217)Online publication date: Feb-2019
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media