Measuring and Visualizing Energy
Consumption within Software
Code
Tiago Carção
University of Minho, Braga, Portugal
Supervisors:
João Saraiva
Jácome Cunha
Graduate Consortium - VL/HCC 2014
Do the developers concern
themselves with energy consumption
during the development process?
How can we display that information
to the developers?
What type of information should be
presented to the developers?
Why Energy?
1
Why software?
2
Isolation
Responsibility
Identification and improvement
Quantification
What type of information do developers have?
3
Spectrum-based Fault Localization
4
Tests
t1 t2 t3 t4 t5
1
1
1
1
1
1
1
1
1
1
0
0
1
1 1 1
1 1 1
1 1 1
1 0 1
1 0 1
1 1 1
0 1 0 1
Spectrum-based Fault Localization
4
Does the test output matches the expected output?
Tests
t1 t2 t3 t4 t5
1
1
1
1
1
1
1
1
0
0
1 1
1 1 1
1 1 1
1 1 1
1 0 1
1 0 1
1 1 1
0.3
1 0 1 0 1
Spectrum-based Fault Localization
4
Tests
t1 t2 t3 t4 t5
1
1
1
1
1
1
1
1
0
0
1 1
1 1 1
1 1 1
1 1 1
1 0 1
1 0 1
1 1 1
0.7
0.3
0.3
0.3
1 0 1 0 1
Spectrum-based Fault Localization
4
Tests
t1 t2 t3 t4 t5
1
1
1
1
1
1
1
1
0
0
1 1
1 1 1
1 1 1
1 1 1
1 0 1
1 0 1
1 1 1
0.3
0.7
0.3
0.3
0.3
0.7
1 0 1 0 1
Enquire
possible
faults!
Spectrum-based Fault Localization
4
How to adapt the SFL model for Energy Leak detection?
What data to collect from the code execution?
Decide what is a energy leak?
5
int first = 0, second = 1, next, c;
for ( c = 0 ; c < number; c++ ) {
if ( c <= 1 )
next = number;
else {
next = first + second;
first = second;
second = next;
}
}
int fibonacciCalc(int number) {
return next;
}
Source code instrumentation
6
#GET TIME & START MEASURING
int first = 0, second = 1, next, c;
for ( c = 0 ; c < number; c++ ) {
if ( c <= 1 )
next = number;
else {
next = first + second;
first = second;
second = next;
}
}
int fibonacciCalc(int number) {
return next;
}
#GET TIME & END MEASURING
Source code instrumentation
6
Metrics collected
7
SFL Adapted
Tests
t1 t2 t3 t4 t5
8
Tests
t1 t2 t3 t4 t5
1
1
1
1
1
1
1
1
0
0
1 1
1 1 1
1 1 1
1 1 1
1 0 1
1 0 1
1 1 1
0.8 0.3 0.9 0.3 0.7
SFL Adapted
8
Tests
t1 t2 t3 t4 t5
1
1
1
1
1
1
1
1
0
0
1 1
1 1 1
1 1 1
1 1 1
1 0 1
1 0 1
1 1 1
0.1
0.2
0.11
0.23
0.8
0.46
0.8 0.3 0.9 0.3 0.7
SFL Adapted
8
How to represent the information?
9
What we envision
10
Do the developers concern
themselves with energy consumption
during the development process?
How can we display that information
to the developers?
What type of information should be
presented to the developers?
Measuring and Visualizing Energy
Consumption within Software
Code
Tiago Carção
University of Minho, Braga, Portugal
Supervisors:
João Saraiva
Jácome Cunha
Graduate Consortium - VL/HCC 2014

PresentationMeasuring and Visualizing Energy Consumption within Software Code

  • 1.
    Measuring and VisualizingEnergy Consumption within Software Code Tiago Carção University of Minho, Braga, Portugal Supervisors: João Saraiva Jácome Cunha Graduate Consortium - VL/HCC 2014
  • 2.
    Do the developersconcern themselves with energy consumption during the development process? How can we display that information to the developers? What type of information should be presented to the developers?
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
    Tests t1 t2 t3t4 t5 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 1 Spectrum-based Fault Localization 4 Does the test output matches the expected output?
  • 8.
    Tests t1 t2 t3t4 t5 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0.3 1 0 1 0 1 Spectrum-based Fault Localization 4
  • 9.
    Tests t1 t2 t3t4 t5 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0.7 0.3 0.3 0.3 1 0 1 0 1 Spectrum-based Fault Localization 4
  • 10.
    Tests t1 t2 t3t4 t5 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0.3 0.7 0.3 0.3 0.3 0.7 1 0 1 0 1 Enquire possible faults! Spectrum-based Fault Localization 4
  • 11.
    How to adaptthe SFL model for Energy Leak detection? What data to collect from the code execution? Decide what is a energy leak? 5
  • 12.
    int first =0, second = 1, next, c; for ( c = 0 ; c < number; c++ ) { if ( c <= 1 ) next = number; else { next = first + second; first = second; second = next; } } int fibonacciCalc(int number) { return next; } Source code instrumentation 6
  • 13.
    #GET TIME &START MEASURING int first = 0, second = 1, next, c; for ( c = 0 ; c < number; c++ ) { if ( c <= 1 ) next = number; else { next = first + second; first = second; second = next; } } int fibonacciCalc(int number) { return next; } #GET TIME & END MEASURING Source code instrumentation 6
  • 14.
  • 15.
  • 16.
    Tests t1 t2 t3t4 t5 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0.8 0.3 0.9 0.3 0.7 SFL Adapted 8
  • 17.
    Tests t1 t2 t3t4 t5 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0.1 0.2 0.11 0.23 0.8 0.46 0.8 0.3 0.9 0.3 0.7 SFL Adapted 8
  • 18.
    How to representthe information? 9
  • 19.
  • 20.
    Do the developersconcern themselves with energy consumption during the development process? How can we display that information to the developers? What type of information should be presented to the developers?
  • 21.
    Measuring and VisualizingEnergy Consumption within Software Code Tiago Carção University of Minho, Braga, Portugal Supervisors: João Saraiva Jácome Cunha Graduate Consortium - VL/HCC 2014