Title
Investigating the effect of design patterns on energy consumption.
Abstract
Gang of Four (GoF) patterns are well-known best practices for the design of object-oriented systems. In this paper, we aim at empirically assessing their relationship to energy consumption, ie, a performance indicator that has recently attracted the attention of both researchers and practitioners. To achieve this goal, we investigate pattern-participating methods (ie, those that play a role within the pattern) and compare their energy consumption to the consumption of functionally equivalent alternative (nonpattern) solutions. We obtained the alternative solution by refactoring the pattern instances using well-known transformations (eg, replace polymorphism with conditional statements). The comparison is performed on 169 methods of 2 GoF patterns (namely, State/Strategy and Template Method), retrieved from 2 well-known open source projects. The results suggest that for the majority of cases the alternative design excels in terms of energy consumption. However, in some cases (eg, when the method is large in size or invokes many methods) the pattern solution presents similar or lower energy consumption. The outcome of our study can be useful to both researchers and practitioners, because we: (1) provide evidence on a possible negative effect of GoF patterns, and (2) can provide guidance on which cases the use of the pattern is not hurting energy consumption.
Year
DOI
Venue
2017
10.1002/smr.1851
JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS
Keywords
Field
DocType
design patterns,energy efficiency,GoF patterns,state pattern,strategy pattern,template method pattern
Data mining,Performance indicator,Best practice,Efficient energy use,Strategy pattern,Software design pattern,Engineering,Energy consumption,Code refactoring
Journal
Volume
Issue
ISSN
29.0
SP2.0
2047-7473
Citations 
PageRank 
References 
3
0.37
18
Authors
5
Name
Order
Citations
PageRank
Daniel Feitosa1428.42
Rutger Alders230.37
Apostolos Ampatzoglou333441.24
Paris Avgeriou41956139.94
Elisa Yumi Nakagawa535350.16