International Journal of Research in Engineering and Science (IJRES) ISSN (Online): 2320-9364, ISSN (Print): 2320-9356 www.ijres.org Volume 3 Issue 6 ǁ June 2015 ǁ PP.74-87 www.ijres.org 74 | Page Ranking The Refactoring Techniques Based on The External Quality Attributes Sultan Alshehri 1 and Abdulmajeed Aljuhani 2 1+2 Department of Engineering, Software Engineering, University of Regina, Canada ABSTRACT: The selection of appropriate decisions is a significant issue that might lead to more satisfactory results. The difficulty comes when there are several alternatives and when all of them have the same chance of being selected. It is important, therefore, to find the kinds of priorities among all of these alternatives in order to choose the most appropriate one. The analytic hierarchy process (AHP) is capable of structuring decision problems and finding mathematically determined judgments built on knowledge and experience. This suggests that AHP should prove useful in agile software development where complex decisions occur routinely. This paper presents an example of using the AHP to rank the refactoring techniques based on the external code quality attributes. XP encourages applying the refactoring where the code smells bad. However, refactoring may consume more time and efforts. Therefore, to maximize the benefits of the refactoring in less time and effort, AHP has been applied to achieve this purpose. It was found that ranking the refactoring techniques helped the XP team to focus on the technique that improve the code and the XP development process in general. KEYWORDS: Extreme programming, Refactoring; Refactoring techniques; Analytic Hierarchy Process. I. Introduction: Code refactoring is the process of re-designing existing code by changing its internal structure, and keeping its external behavior [1]. Refactoring is a core practice in extreme programming development process, which assists to enhance software design with reducing cost and effort of coding and testing [2]. 1.1 Guidelines in the refactoring process Several researchers, such as [3], exhibited various refactoring steps, which can be described as follows: - Determining which part of the code that should be refactored. - Selecting the appropriate refactoring methods to be applied. - Applying the refactoring. - Evaluating the influences of the applied refactoring methods on the code quality attributes [2]. Further steps can be found in [4,5,6]. Issue regarding refactoring tools: Murphy-Hill et al. [7] conducted an empirical study, which leaded to collect data about refactoring process in order to assist in constructing a robust refactoring tool. Brunel et al. [8] analyzed several open-source java systems (JasperReports, Tyrant, Velocity, MegaMek, PDFBox, HSQLDB, Antlr) in order to investigate refactoring tools accuracy. Refactoring characterization has been introduced by Maticorna and Perez [9]; also, the authors explained how to use it as a comparing tool in different refactoring definitions. Roberts et al. [10] studied the functional requirements and empirical criteria for the refactoring tools, and their findings were that accuracy and the ability to search across the entire program are the most functional requirements, and integration and speed are the most empirical criteria. Simmonds and Mens [11] conducted a study to provide the strengths and weakness of four refactoring tools, which are SmalltalkWorks 7.0, Eclipse, Guru, and Together ControlCenter 6.0. 1.2 Identification of code smells to locate possible refactoring Advani et al. [12] specified the field of complexity across the systems when applying refactoring. In addition, the authors introduced a method to assign the testing effort. Bryton et al. [13] presented Binary Logistic Regression (BLR) model in order to discover the code smell specifically Long Method objectively. Intelligent assistant and a refactoring agent has been used by Sandalski et al. [14] to inspect the refactoring architecture and evaluate the existing code in order to emphasize which part of the code needs to be refactored. Based on plug-ins for Eclipse, a technique has been introduced by Hayashi et al. [15] to assist the development team on how and where to do refactoring based on the histories of program modifications.