Publications

Detailed Information

함수 단위 중복코드 쌍을 자동으로 안전하게 고치는 방법 : Automatic and Safe Refactoring of Function-Level Code Clones

Cited 0 time in Web of Science Cited 0 time in Scopus
Authors

양준모

Advisor
이광근
Major
공과대학 컴퓨터공학부
Issue Date
2019-02
Publisher
서울대학교 대학원
Description
학위논문 (석사)-- 서울대학교 대학원 : 공과대학 컴퓨터공학부, 2019. 2. 이광근.
Abstract
본 논문은 JAVA 소스코드를 대상으로 함수단위 코드중복 쌍을 찾아 자동으로 안전하게 고쳐주는 방법을 제안한다. 이 방법은 크게 두 단계로 구성된다. (i) 전체 소스코드 내에서 중복코드 탐지기를 이용하여 중복코드 쌍을 찾아낸다. (ii) 찾아낸 중복코드 쌍을 유형별로 분류한 뒤 알맞은 알고리즘을 통해 안전하게 고친다. (i)에서는 Deckard 중복코드 탐지기를 활용한다. (ii)에서는 입력받은 함수단위 중복코드 쌍을 두가지 유형으로 나누어 처리한다. 첫번째 유형은 두 함수의 타입이 같을 때로 두 함수를 병합하여 처리하고, 두번째 유형은 타입이 다를 때로 내부 중복부분을 추출하여 처리하는 것이다. 이 방법의 실효성을 보이기 위해 함수단위 중복 리팩토링 도구 AutoRefactor를 설계 및 구현하였다. 구현한 도구로 회사 제품코드와 오픈소스 프로젝트에서 찾은 실제 중복을 없애기 위해 실험한 결과, 같은 파일 내 존재하는 함수단위 중복코드 6,082 LOC(55개쌍 중복) 중 3,976 LOC(30개쌍 중복)를 처리할 수 있었다.
This paper proposes a method to automatically find duplicated function-level code clone pairs and securely fix them for JAVA programs. This method consists of two major stages. (i) Find duplicated code pairs using code clone detector within the complete source code. (ii) Classify the located duplicated code pairs and fix them safely through the appropriate algorithm. Stage (i) utilizes the Deckard code clone detector. In stage (ii), duplicated code pairs are divided into two classes. If two functions have same type, they are merged into a single function. If they don't have same type, internal duplicated code snippet is extracted. In order to demonstrate the effectiveness of this method, I designed and implemented function-level code clone refactoring tool, AutoRefactor. I experimented AutoRefactor with real company product codes and open source projects. Experimental results show that AutoRefactor can process 3,976 LOCs (30 clone pairs) out of 6,082 LOCs (55 clone pairs).
Language
kor
URI
https://hdl.handle.net/10371/150818
Files in This Item:
Appears in Collections:

Altmetrics

Item View & Download Count

  • mendeley

Items in S-Space are protected by copyright, with all rights reserved, unless otherwise indicated.

Share