International Journal of Computer Applications (0975 – 8887) Volume 70 No.26, May 2013 16 Case-Based Reasoning for Design Patterns Searching System Weenawadee Muangon Software System Engineering Laboratory, Department of Mathematics and Computer Science, Faculty of Science, King Mongkut’s Institute of Technology Ladkrabang, Bangkok, Thailand E-mail: s9062903@kmitl.ac.th Sarun Intakosum Software System Engineering Laboratory, Department of Mathematics and Computer Science, Faculty of Science, King Mongkut’s Institute of Technology Ladkrabang, Bangkok, Thailand E-mail: kisarun@kmitl.ac.th ABSTRACT Design patterns are graceful solutions to specific software design problems. However, choosing proper design patterns for given software design problems might not be an easy task especially for novice developers. The design patterns searching tools are therefore needed to solve the problem. One major problem of the existing researches in this field is the indexing problem. This paper aims to solve the problem by presenting an elegant design pattern searching model that combines Case Based Reasoning (CBR) and Formal Concept Analysis (FCA) techniques. This model proposes a newly refinement technique. The technique allows experts to organize indexes to gain more complete software problem description in order to retrieve more appropriate design patterns. The indexes and cases similarity is calculated using FCA. The learning model to store new knowledge for retention process is also provided. Mean Average Precision (MAP) is used to assess the performance of the model. The preliminary experimental results show that the presented model has more retrieval ability in term of MAP comparing to the traditional model of CBR. General Terms Software Engineering, Reasoning, Knowledge Extraction, Knowledge Management. Keywords Design pattern, Design pattern retrieval, Knowledge Representation, Case Based Reasoning, Formal Concept Analysis. 1. INTRODUCTION Design patterns are important techniques used to capture software design knowledge in order to solve software design problems. In general, design patterns are collected by experienced software designers [1] [2] [3] who formulate solutions in the specific context of recurring software design problems. Although design patterns are extremely useful in software design, choosing the right design pattern for a given design problem is a very difficult task. Especially, inexperienced software designers who have less knowledge of the field may not be able to cope with the large number of design patterns. For this reason, software design pattern searching tools for retrieving the right design patterns that can solve specific software design problems are considered helpful. Existing techniques for searching design patterns generally do not support efficient searching because of the major problem of indexing limitation. Usually, index assignment is performed by authors, which is difficult to match with the keywords of users. One way to solve this problem can be made by using a construction learning model. This paper proposes such a new model that applies both Case Based Reasoning (CBR) and Formal Concept Analysis (FCA). CBR is a smart knowledge learning model, which is a powerful tool used in problem-solving systems. FCA is a data analysis technique that can be used to discover hidden knowledge between indexes and cases in a case base. Utilizing the two approaches is very useful to solve the index limitation problem. This paper’s model starts when a user inputs a new problem description. The system retrieves similar cases that are relevant to the problem by using a similarity function. Retrieved solutions are proposed to users and also stored to the system as new knowledge that can be reused for solving new problems. If users do not satisfy with the retrieved solutions, the system can find the right design pattern by giving alternative methods using FCA implementation. First, the structure of FCA enables discovery of related cases. The problem descriptions of related cases are presented to the user in order to extend comprehension of their problems. Second, FCA technique generates relevant indexes to make a more complete problem description. Lastly, using CBR retains new experiences in retrieval and revising processes as knowledge instrumental in solving similar problem in the future. The remainder of this paper is organized as follows: Section (2) provides a concise survey of related work. Section (3) discusses important background knowledge to be applied to this paper’s model. Section (4) presents a design pattern searching model. Section (5) proposes a simple prototype of the approach. Section (6) presents a preliminary evaluation of the model and explains the experimental results. 2. RELATED WORKS This section briefly looks at some studies that relate to design pattern searching models. The goal of this section is to collect the studies in the field of design patterns retrieval. The studies in this field can be divided into two categories design pattern indexing and searching models. 2.1 Design Patterns Indexing Research in [4] proposes formalizing technique to support design pattern retrieving system. It formalizes the text from intent section specified by [2] into phrases that are used to identify the roles of specific design patterns. The indexes that will be used in the searching model, discussed next, can be generated from these phrases. Research in [5] provided a way to find appropriate indexes to indicate the problem situation of design patterns. The research applied Pattern Component Markup Language (PCML) metadata of design patterns by adding pairs of subjects and predicates according to the software problem situation. This metadata can extend to a