GreenScaler: Training Software Energy Models With Automatic Test Generation

Shaiful Chowdhury, Stephanie Borle, Stephen Romansky, Abram Hindle

2018/06/20

GreenScaler: Training Software Energy Models With Automatic Test Generation

Authors

Shaiful Chowdhury, Stephanie Borle, Stephen Romansky, Abram Hindle

Venue

Abstract

Software energy consumption is a performance related non-functional requirement that complicates building software on mobile devices today. Energy hogging applications (apps) are a liability to both the end-user and software developer. Measuring software energy consumption is non-trivial, requiring both equipment and expertise, yet researchers have found that software energy consumption can be modelled. Prior works have hinted that with more energy measurement data we can make more accurate energy models. This data, however, was expensive to extract because it required energy measurement of running test cases (rare) or time consuming manually written tests. In this paper, we show that automatic random test generation with resource-utilization heuristics can be used successfully to build accurate software energy consumption models. Code coverage, although well-known as a heuristic for generating and selecting tests in traditional software testing, performs poorly at selecting energy hungry tests. We propose an accurate software energy model,GreenScaler, that is built on random tests with CPU-utilization as the test selection heuristic. GreenScaler not only accurately estimates energy consumption for randomly generated tests, but also for meaningful developer written tests. Also, the produced models are very accurate in detecting energy regressions between versions of the same app. This is directly helpful for the app developers who want to know if a change in the source code, for example, is harmful for the total energy consumption. We also show that developers can use GreenScaler to select the most energy efficient API when multiple APIs are available for solving the same problem. Researchers can also use our test generation methodology to further study how to build more accurate software energy models.

Bibtex

@article{chowdhury2018EMSE-GreenScaler,
 abstract = { Software energy consumption is a performance related non-functional requirement that complicates building software on mobile devices today. Energy hogging applications (apps) are a liability to both the end-user and software developer. Measuring software energy consumption is non-trivial, requiring both equipment and expertise, yet researchers have found that software energy consumption can be modelled.  Prior works have hinted that with more energy measurement data we can make more accurate energy models.  This data, however, was expensive to extract because it required energy measurement of running test cases (rare) or time consuming manually written tests.  In this paper, we show that automatic random test generation with resource-utilization heuristics can be used successfully to build accurate software energy consumption models. Code coverage, although well-known as a heuristic for generating and selecting tests in traditional software testing, performs poorly at selecting energy hungry tests.
 We propose an accurate software energy model,GreenScaler, that is built on random tests with CPU-utilization as the test selection heuristic. GreenScaler not only accurately estimates energy consumption for randomly generated tests, but also for meaningful developer written tests.  Also, the produced models are very accurate in detecting energy regressions between versions of the same app.  This is directly helpful for the app developers who want to know if a change in the source code, for example, is harmful for the total energy consumption.  We also show that developers can use GreenScaler to select the most energy efficient API when multiple APIs are available for solving the same problem. Researchers can also use our test generation methodology to further study how to build more accurate software energy models.},
 accepted = {2018-06-20},
 author = {Shaiful Chowdhury and Stephanie Borle and Stephen Romansky and Abram Hindle},
 authors = {Shaiful Chowdhury, Stephanie Borle, Stephen Romansky, Abram Hindle},
 code = {chowdhury2018EMSE-GreenScaler},
 day = {20},
 funding = {NSERC Discovery},
 journal = {Empirical Software Engineering},
 journalid = {EMSE-D-17-00171R2},
 month = {June},
 pagerange = {1--52},
 pages = {1--52},
 published = {2018-06-20},
 role = { Researcher / Co-author},
 title = {GreenScaler: Training Software Energy Models With Automatic Test Generation},
 type = {article},
 url = {http://softwareprocess.ca/pubs/chowdhury2018EMSE-GreenScaler.pdf},
 venue = {Empirical Software Engineering},
 year = {2018}
}