Energy Bad Smells 기반 소모전력 절감을 위한 코드 리팩토링 기법 209 Code Refactoring Techniques Based on Energy Bad Smells for Reducing Energy Consumption Jae-Wuk Lee Doohwan Kim †† Jang-Eui Hong ††† ABSTRACT While the services of mobile devices like smart phone, tablet, and smart watch have been increased and varied, the software embedded into such devices has been also increased in size and functional complexity. Therefore, increasing operation time of mobile devices for serviceability became an important issue due to the limitation of battery power. Recent studies focus on the software development having efficient behavioral patterns because the energy consumption of mobile devices is caused by software behaviors which control the hardware operations. However, it is often difficult to develop the embedded software with considering energy-efficiency and behavior optimization due to the short development cycle of the mobile services in many cases. Therefore, this paper proposes the refactoring techniques for reducing energy consumption, and enables to fulfill the energy requirements during software development and maintenance. We defined energy bad smells with the code patterns that can excessively consume the energy, and our refactoring techniques are to remove these bad smells. We performed some case studies to verify the usefulness of our refactoring techniques. Keywords : Software Behavioral Patterns, Energy Consumption, Energy Bad Smells, Code Refactoring Energy Bad Smells 기반 소모전력 절감을 위한 코드 리팩토링 기법 이 제 욱 김 두 환 †† 홍 장 의 ††† 최근 스마트폰, 태블릿과 같은 기기의 사용량이 증가하면서, 이에 탑재되는 소프트웨어는 더욱 복잡해지고 규모가 커지고 있다. 배터리의 전 력으로 구동되는 모바일 기기들은 전력 공급의 한계로 인해 운용시간을 증가시키는 것이 중요한 이슈이다. 최근에는 소프트웨어 동작이 하드웨 어 구동을 통해 전력 소모를 일으킨다는 점에서, 효율적인 동작 패턴을 갖는 소프트웨어 개발에 대한 연구들이 진행되고 있다. 그러나 모바일 기기에 탑재되는 소프트웨어는 그 개발 주기가 짧은 경우가 많아 최적화와 전력 소모량을 반영하기 어려운 경우가 많다. 따라서 본 연구에서는 소모전력 절감을 위한 코드 리팩토링 기법을 제안하여, 소프트웨어 개발 및 유지보수에서 보다 용이하게 저전력 요구사항을 충족시키고자 한다. 이를 위해 전력 소모량을 감소시킬 수 있는 코드 패턴에 대하여 Energy Bad Smell을 식별하고, 이를 제거하기 위한 새로운 코드 리팩토링 기 법을 제안하며, 실험을 통해 그 효용성을 검증하였다. 키워드 : 소프트웨어 행위패턴, 에너지 소모, Energy Bad Smells, 코드 리팩토링 KIPS Tr. Software and Data Eng. Vol.5, No.5 pp.209~220 pISSN: 2287-5905 1. 서 최근 스마트폰 및 태블릿과 같은 모바일 기기의 이용자들 이 증가하면서, 모바일 기기를 위한 응용 프로그램들은 사 이 논문은 정부(교육부)의 재원으로 한국연구재단-일반연구자지원사업의 지원을 받아 수행된 연구임(No. NRF-2014R1A1A4A01005566). †† 준 회 원 : 충북대학교 컴퓨터과학과 박사과정 ††준 회 원 : 충북대학교 컴퓨터과학과 박사후과정 †††종신회원 : 충북대학교 컴퓨터과학과 교수 Manuscript Received : January 12, 2016 First Revision : April 11, 2016 Accepted : April 11, 2016 * Corresponding Author : Jang-Eui Hong(jehong@chungbuk.ac.kr) 용자들의 다양한 요구사항을 만족시키기 위해 더욱 복잡해 지고 규모가 커지고 있으며, 결과적으로 사용자들이 모바일 기기를 이용하는 시간을 증가시키고 있다. 그러나 모바일 기기는 배터리의 전력으로 구동되므로 전력 공급에 한계성 이 있다. 이러한 환경에서 모바일 기기의 성능과 기능을 유 지한 채 운용시간을 늘리는 것은 중요한 이슈이다[1]. 모바일 기기의 운용시간을 늘리기 위한 연구는 크게 배터 리 용량증가, 저전력 하드웨어 모듈 개발, 소프트웨어 최적 화의 세 가지로 분류할 수 있다[2]. 소프트웨어에 의한 소모 전력 절감 연구는 크게 개발 초기 단계에서 소모 전력을 예 측하는 기법들[3-5]과 개발된 코드의 검증을 통해 소모 전 http://dx.doi.org/10.3745/KTSDE.2016.5.5.209