Abstract-The analytic network process (ANP) is capable of structuring decision problems and finding mathematically determined judgments built on knowledge and experience. Researches suggest that ANP can be useful in software development, where complicated decisions happen routinely. In extreme programming (XP), the refactoring is applied where the code smells bad. This might cost more effort and time. As a result, in order to increase the advantages of refactoring in less effort and time, the analytic network process has been used to accomplish this purpose. This paper presents an example of applying the ANP in order to rank the refactoring patterns regarding the internal code quality attributes. A case study that was conducted in an academic environment is presented in this paper. The results of the case study show the benefits of using the ANP in XP development cycle.