Generating a catalog of unanticipated schemas in class hierarchies using Formal Concept Analysis

被引:18
作者
Arevalo, Gabriela [1 ,6 ]
Ducasse, Stephane [3 ]
Gordillo, Silvia [2 ,5 ]
Nierstrasz, Oscar [4 ]
机构
[1] FI Univ Austral, RA-1063 Buenos Aires, DF, Argentina
[2] LIFIA UNLP, RA-1900 La Plata, Buenos Aires, Argentina
[3] INRIA Lille Nord Europe, ADAM Team, FR-59650 Villeneuve Dascq, France
[4] Univ Bern, SCG IAM, CH-3012 Bern, Switzerland
[5] CICPBA, RA-1900 La Plata, Buenos Aires, Argentina
[6] Consejo Nacl Invest Cient & Tecn, RA-1033 Buenos Aires, DF, Argentina
基金
瑞士国家科学基金会;
关键词
Object-oriented development; Class hierarchy schemas; Source code analysis; Formal Concept Analysis; PATTERNS; DESIGN;
D O I
10.1016/j.infsof.2010.05.010
中图分类号
TP [自动化技术、计算机技术];
学科分类号
080201 [机械制造及其自动化];
摘要
Context: Inheritance is the cornerstone of object-oriented development, supporting conceptual modeling, subtype polymorphism and software reuse. But inheritance can be used in subtle ways that make complex systems hard to understand and extend, clue to the presence of implicit dependencies in the inheritance hierarchy. Objective: Although these dependencies often specify well-known schemas (i.e., recurrent design or coding patterns, such as hook and template methods), new unanticipated dependency schemas arise in practice, and can consequently be hard to recognize and detect. Thus, a developer making changes or extensions to an object-oriented system needs to understand these implicit contracts defined by the dependencies between a class and its subclasses, or risk that seemingly innocuous changes break them. Method: To tackle this problem, we have developed an approach based on Formal Concept Analysis. Our Formal Concept Analysis based-Reverse Engineering methodology (FoCARE) identifies undocumented hierarchical dependencies in a hierarchy by taking into account the existing structure and behavior of classes and subclasses. Results: We validate our approach by applying it to a large and non-trivial case study, yielding a catalog of hierarchy schemas, each one composed of a set of dependencies over methods and attributes in a class hierarchy. We show how the discovered dependency schemas can be used not only to identify good design practices, but also to expose bad smells in design, thereby helping developers in initial reengineering phases to develop a first mental model of a system. Although some of the identified schemas are already documented in existing literature, with our approach based on Formal Concept Analysis (FCA), we are also able to identify previously unidentified schemas. Conclusions: FCA is an effective tool because it is an ideal classification mining tool to identify commonalities between software artifacts, and usually these commonalities reveal known and unknown characteristics of the software artifacts. We also show that once a catalog of useful schemas stabilizes after several runs of FoCARE, the added cost of FCA is no longer needed. (C) 2010 Elsevier B.V. All rights reserved.
引用
收藏
页码:1167 / 1187
页数:21
相关论文
共 79 条
[1]
Instantiating and detecting design patterns:: Putting bits and pieces together [J].
Albin-Amiot, H ;
Cointe, P ;
Guéhéneuc, YG ;
Jussien, N .
16TH ANNUAL INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2001), PROCEEDINGS, 2001, :166-173
[2]
Alpert ShermanR., 1998, DESIGN PATTERNS SMAL
[3]
[Anonymous], 2012, Formal concept analysis: mathematical foundations
[4]
[Anonymous], P INT WORKSH CONC LA
[5]
Design pattern recovery in object-oriented software [J].
Antoniol, G ;
Fiutem, R ;
Cristoforetti, L .
6TH INTERNATIONAL WORKSHOP ON PROGRAM COMPREHENSION (IWPC 98) - PROCEEDINGS, 1998, :153-160
[6]
AREVALO G, 2005, THESIS U BERN BERN
[7]
AREVALO G, 2003, P LMO 03, P47
[8]
Arévalo G, 2006, LECT NOTES COMPUT SC, V4199, P513
[9]
AUER K, 1995, PATTERN LANGUAGES OF PROGRAM DESIGN, P505
[10]
Beck K, 1994, LECT NOTES COMPUTER, V821, P139