Like with Bio products, the world is developing to become a more nature-aware ecosystem. The green initiative defines two main goals: reduce energy consumption and use basic natural sources in electrical energy production.
This lecture focuses on energy consumption of working software and its development processes, where each development phase plays a significant role. Considering any software development process, the energy is being consumed while problem analysis, constructing and evaluating the code as well. Software or hardware tools have to be used to implement energy consumption monitoring for software run at the top of selected operating systems and for evaluation of the energy consumption. Usual usage scenarios are to monitor energy usage of selected software. We will also look at the possibility to use these tools to measure how green is the process that produced the programs.
2. Abstract
TEWI-Kolloquium, Klagenfurt,
February 7, 2018
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
2
This lecture focuses on energy consumption of working
software and its development processes, where each
development phase plays a significant role. Considering any
software development process, the energy is being consumed
while problem analysis, constructing and evaluating the code
as well. Software or hardware tools have to be used to
implement energy consumption monitoring for software run
at the top of selected operating systems and for evaluation of
the energy consumption. Usual usage scenarios are to
monitor energy usage of selected software.We will also look
at the possibility to use these tools to measure how green is
the process that produced the programs.
3. Agenda
— ERASMUS+ invitations
— What is green IT and green software?
— Software energy label
— Scaling from software to process
— Case studies and examples
TEWI-Kolloquium, Klagenfurt,
February 7, 20183
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
6. Green software, green IT
TEWI-Kolloquium, Klagenfurt,
February 7, 20186
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
7. TEWI-Kolloquium, Klagenfurt,
February 7, 2018
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
7
8. Green software, green IT
TEWI-Kolloquium, Klagenfurt,
February 7, 2018
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
8
— Goals:
— Save energy by more efficient hardware
— Save energy by optimized/custom software
— Save energy by location of hardware
— To make it really green:
— Develop new working hardware
— Develop energy efficient working software
— Teach users to save energy when using the software
— Make sure the used energy is also green
11. SW energy label?
— Measurement -> Calibration
— Software life -> Development
— Software life -> Evolution
— Software testing -> Black-box testing
— Software testing ->White-box testing
TEWI-Kolloquium, Klagenfurt,
February 7, 201811
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
12. Measurement
— To measure is to observe one or more system attributes
— Measurement uses metrics and metrics values to state the
results of such observation
— Metrics are used to compare two or more artifacts
— Energy consumption can be measured.
TEWI-Kolloquium, Klagenfurt,
February 7, 201812
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
13. Motivation example
— The guys are gone fishing without the girls
— They have to keep contact with them for various reasons via
their mobile phones
— They use their mobile phones for outdoor navigation
— They also use their mobile phones to connect to the fish
finder (sonar) several times per day
— How many power banks they need for one week to survive?
TEWI-Kolloquium, Klagenfurt,
February 7, 201813
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
14. Development and evolution
— Energy consumption is not a very often requirement, at least
not an accelerated one
— If exists, it is a non-functional requirement, which makes it
measurable just after building the product
— There exist energy saving guidelines for different OS or
target devices
— Energy efficiency is more often a requirement arising during
usage
TEWI-Kolloquium, Klagenfurt,
February 7, 201814
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
15. Black box testing
— A test technique applied in testware of (almost) final
products.
— Start -> observe -> close -> evaluate. During observation,
the complete software is running.
— Objective method since it is not altering the SUT.
— Can find existence of a failure but cannot locate it.
TEWI-Kolloquium, Klagenfurt,
February 7, 201815
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
16. White box testing
— A test technique applied during module development and
integration.
— Select -> configure -> run -> evaluate. Selection takes a part
of the system code that will be tested.
— It creates a modified SUT to locate the source of the failure
or error.
TEWI-Kolloquium, Klagenfurt,
February 7, 201816
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
17. Energy consumption measurement
— Invasive or not (black or white?)
— Invasive: more precise for the price of change
— Non-invasive: how can we be sure we measure only what we
want?
— Hardware measurement – using sensors or external devices
— Software measurement – using estimation based on
host/target system configuration
TEWI-Kolloquium, Klagenfurt,
February 7, 201817
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
18. Invasive EE measurement
— Principle 1: running white-box tests that position the
measured routine into a frame with known energy
consumption.After running a required minimum number of
tests, one can statistically estimate the energy efficiency of
the routine.
— Principle 2: adding signal sources into the code to start/stop
measurement
TEWI-Kolloquium, Klagenfurt,
February 7, 201818
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
19. Non-invasive measurement
— Principle 1:We measure energy consumption of the system
with and without running the measured application.After a
suitable statistical evaluation, the energy efficiency of the
application can be calculated.
— Principle 2:We calibrate the energy consumption estimation
model on the host system using known processes.Then, we
observe the behavior of the selected process on the host.
Observed values are turned to energy consumption
estimations based on CPU load, memory usage etc.
TEWI-Kolloquium, Klagenfurt,
February 7, 201819
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
20. — One could set up a measurement process that combines the
previous principles.
TEWI-Kolloquium, Klagenfurt,
February 7, 201820
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
21. Tools
TEWI-Kolloquium, Klagenfurt,
February 7, 2018
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
21
— https://software.intel.com/en-us/articles/intel-power-
gadget-20
— Googleing for: Joulemeter1.2Setup
— https://developer.apple.com/library/content/documentati
on/Performance/Conceptual/EnergyGuide-
iOS/MonitorEnergyWithXcode.html
— Adding PowerTop for linux via standard packaging tools
— GettingTrepn Profiler for Android from the Google Store
— MicrosoftVisual Studio includes Joulemeter
22. Scaling up
TEWI-Kolloquium, Klagenfurt,
February 7, 2018
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
22
— Usual energy efficiency measurement focuses on software or
hardware products.
— But, in our case we will measure the development (host)
system’s energy efficiency using a black-box testing method.
— We start the measurement before starting the browser and
the IDE and we will stop measuring after closing all used
tools.
23. Scaling up
TEWI-Kolloquium, Klagenfurt,
February 7, 2018
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
23
— During development it is normal to compile and run an
application many times, which will have an effect on energy
consumption.The goal of our measurements is to point out
this energy and compare to the energy consumption of the
product itself.
24. The energy-measured development
game
1. Setup the environment
2. Start the energy monitor
3. Develop (think, code, test, fix) for 15 minutes
4. Have a 5 minutes break (stop energy usage monitoring, set
up the next one, get a coffee)
5. Finish (for this time) if there is no further idea
6. Repeat (jump to label 2)
7. Analyze collected data (energy efficiency of your
development process) inside the team
TEWI-Kolloquium, Klagenfurt,
February 7, 201824
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
25. Examples
TEWI-Kolloquium, Klagenfurt,
February 7, 2018
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
25
— Installing a java IDE
— Developing the mirror application
26. Example 1: software installation
0
5
10
15
20
25
30
35
40
1
15
29
43
57
71
85
99
113
127
141
155
169
183
197
211
225
239
253
267
281
295
309
323
337
351
365
379
393
407
421
435
449
463
477
491
505
519
533
547
561
575
589
Total power [W]
CPU [W]
Monitor [W]
Disk [W]
Base system [W]
TEWI-Kolloquium, Klagenfurt,
February 7, 201826
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
27. Disk access during installation
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
1
14
27
40
53
66
79
92
105
118
131
144
157
170
183
196
209
222
235
248
261
274
287
300
313
326
339
352
365
378
391
404
417
430
443
456
469
482
495
508
521
534
547
560
573
586
Disk [W]
Disk [W]
TEWI-Kolloquium, Klagenfurt,
February 7, 201827
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
28. Evaluation
— Disk operations’ energy consumption: 1.35Ws
— Total energy consumption: 1771.03Ws
— These are the “costs” of an installation.
— The same method can be applied on measuring energy
efficiency of the development process as well. Process
distribution introduces the requirement of distributed
measurement.
TEWI-Kolloquium, Klagenfurt,
February 7, 201828
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
29. Example 2: mirror app
— Let develop a JavaFX FXML application that implements a
classical mirror. It will use the computer’s built-in camera to
capture the video that will be then displayed in the
application window.
— We will use IntelliJ IDEA for JavaFX, Oracle’s Scene Builder
for visual FXML GUI design, and the OpenCV library for
image processing.
TEWI-Kolloquium, Klagenfurt,
February 7, 201829
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
30. Our search engine found the following
reusable sources
— https://opencv-srf.blogspot.sk/p/opencv-lessons.html
— https://opencv-srf.blogspot.sk/2010/09/object-detection-
using-color-seperation.html
— https://www.codeproject.com/Tips/717283/How-to-Use-
OpenCV-with-Java-under-NetBeans-IDE
— http://opencv-java-tutorials.readthedocs.io/en/latest/03-
first-javafx-application-with-opencv.html
— https://github.com/opencv-java/getting-
started/tree/master/FXHelloCV/src/it/polito/elite/teachi
ng/cv
TEWI-Kolloquium, Klagenfurt,
February 7, 201830
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
31. The development process
— We found a reusable solution, it will save time and energy to
use it.
— We follow the tutorial.
— If required, we introduce changes to fit the tutorial to our
requirements.
— This is a small task, to which a tutorial exists, but because of
the non-native library used, it can be qualified as Medium.
— Total time to solve the problem is also short (even when not
considering the option downloading the project from Git)
TEWI-Kolloquium, Klagenfurt,
February 7, 201831
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
34. Measurement results – development
0
5
10
15
20
25
30
35
40
45
1
19
37
55
73
91
109
127
145
163
181
199
217
235
253
271
289
307
325
343
361
379
397
415
433
451
469
487
505
523
541
559
577
595
613
631
649
667
685
703
721
739
757
775
793
811
Total power [W]
CPU [W]
Monitor [W]
Disk [W]
Base system [W]
IDE [W]
TEWI-Kolloquium, Klagenfurt,
February 7, 201834
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
35. Measurement results – product
0
5
10
15
20
25
30
1 2 3 4 5 6 7 8 9 101112131415161718192021222324252627282930313233343536373839404142434445464748495051
Total power [W]
CPU [W]
Monitor [W]
Disk [W]
Base system [W]
Target application [W]
TEWI-Kolloquium, Klagenfurt,
February 7, 201835
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software
36. Evaluation
— Target application energy consumption: 2.19Ws
— IDE energy consumption: 74.72Ws
— Total host system energy consumption: 1983.28Ws
TEWI-Kolloquium, Klagenfurt,
February 7, 201836
2017-1-SK01-KA203-035402: Focusing Education on
Composability, Comprehensibility and Correctness of
Working Software