Energy-Driven Software Engineering: A Tutorial
摘要
The EU Climate Law targets climate neutrality by 2050. At the same time, the Knowledge Economy is deemed crucial to EU prosperity. Thus, the energy footprint of software services remains an important topic of research and education. In these lecture notes, we set out to inspire students and fellow lecturers on energy-driven software engineering education. We describe relevant background theory, and suggest further reading material. Students can organise their own self-paced learning activities, while lecturers can adapt some of our proposed activities to their existing teaching material. We show how to assess whether established software smells (anti-patterns), such as ‘Long Function’, ‘Large Class’, and ‘Duplicate Code’, are also energy-related smells. We illustrate two approaches: removing code smells from the software project under analysis and introducing code smells in the software project under analysis. We summarise research findings on several software projects. Based on research on programming languages and software smells, we design a tutorial for students and practitioners alike that allows them to discuss and reason about these topics. In this tutorial, students showcase an energy-aware mindset while programming and broaden their knowledge regarding energy consumption and the choice of tooling. In particular, we teach them how to establish whether some programming languages are inherently more energy-friendly, and whether how a computer program is written has any impact on the energy consumption. We summarise previous research findings on Java, JavaScript, Python, PHP, Ruby, C, C++ and C#. We make a selection of programming languages and programs from The Computer Language Benchmarks Game and illustrate how the experimental set-up can be used to identify the programming languages that consume the least amount of energy over all selected problems. Following the tutorial, we identify interesting future research-based educational directions which include investigating the impact of the difference at the level of (special) programming language constructs on the energy consumption.