Refactoring has been considered an effective technique for improving the maintainability of software. However, refactoring is a difficult task because it is hard to determine where to apply which refactoring operations. Since refactoring usually relies on human intuitions, it is harder especially troublesome for the beginners. In this thesis, we propose a systematic refactoring approach based on metrics in order to help the refactoring process. We employ a number of metrics both for identifying refactoring candidate classes and for selecting suitable refactoring operations. We also suggest a refactoring process that will help apply refactoring systematically. We apply our refactoring approach to a program of moderate size and show that our approach is effective for locating refactoring candidate classes and choosing appropriate refactoring operations.
리팩토링은 프로그램의 유지보수를 좋게 하는 효과적인 방법이다. 이런 리팩토링을 적용할 때 생기는 중요한 문제점 중 하나는 시스템의 어느 부분에 어떤 리팩토링 연산을 적용하는가를 결정하는 것이 판단하기 어렵다는 것이다. 본 논문에서는 보다 쉽게 리팩토링을 적용하는 것을 돕기 위해 응집도 측면에서 유지보수를 좋게 하는 대표적인6가지 리팩토링 연산에 대해 메트릭을 적용시켜보았다. 응집도 메트릭을 사용하여 리팩토링이 필요한 대상 클래스를 찾고, 기준 메트릭과 기준 메트릭과 리팩토링 연산과의 관계를 정의하여 그에 따라 적절한 리팩토링 연산을 제안하였다. 그리고 리팩토링 전후에 리팩토링 대상 클래스와 그 클래스와 상속/사용 관계에 있는 클래스들의 응집도와 커플링 값을 측정하여 리팩토링이 올바르게 적용되도록 하였다. 또한 이런 메트릭을 이용하여 리팩토링하는 방법을 체계화 하였다. 마지막으로 본 논문에서 제안한 방법을 실제 시스템에 적용시켜 리팩토링을 수행한 사례를 소개하였다.