Inserting Sustainability Gates Into the Software Lifecycle

Sep 19, 2024 | Inserting Sustainability Gates Into the Software Lifecycle

In this article, we explore how integrating control gates into the software lifecycle can enhance the green sustainability of source code. Measuring and reducing dissipated power and CO2 emissions has become a crucial objective in modern software development.

Each gate includes static code measurement, the calculation of a green indicator, and the potential creation of a specific remediation action plan to eliminate deviations from a fixed green compliance value. This process extends the green optimization of production applications, making them more efficient and sustainable.

The role of ICT in CO2 emissions

The ICT sector is both a contributor to and a potential solution for CO2 emissions. Decarbonization in ICT involves several aspects, including:

  • Green design of buildings where work is performed
  • Green design of devices used by developers
  • Efficient usage of these devices by staff
  • Management of remote work to limit workforce movement
  • Utilization of renewable energy
  • Energy-efficient design of networks and data centers

However, the focus here is on application code. Software written without adhering to green sustainability practices often leads to higher energy consumption compared to more sustainable alternatives that achieve the same functionality. This consumption is significant; for instance, 50% of a server’s energy use is linked to application code. This percentage can rise to 65% in highly energy-efficient data centers and up to 94% in hyperscalable platforms. As the sustainability of the environment where code is developed and executed improves, the integrity of the code—in terms of its sustainability—becomes crucial for reducing CO2 emissions.

Reducing an application’s power consumption through code integrity improvement is achievable with tools that calculate specific sustainability KPIs and suggest remedial actions to enhance this index to the desired level.

The CAST sustainability measurement solution

CAST Imaging offers objective measurement of an application’s green sustainability, based on the OMG ASCRSM standard index. This sustainability index directly correlates with the energy consumed by the code. Enhancing the green compliance of code can significantly reduce CO2 emissions.

The ASCRSM index is calculated by evaluating a comprehensive set of rules that directly impact code sustainability, governed by ISO 5055. These rules, specific to each technology, are verified during code scanning. Violations of these rules negatively impact the index. CAST Imaging, when calculating the ASCRSM index, not only performs static code analysis but also defines a remediation plan to improve compliance, including a forecast of the cost of these interventions.

For example, a code with a compliance index of 84.52% could potentially reduce dissipated power by 27%, bringing the index to 100% with an estimated effort of 823 man-days. A remediation plan can be defined to progressively improve the sustainability index.

Green evaluation and improvement in the application lifecycle

This process can be guided by considerations related to the technological stack (some development technologies are more energy-intensive than others), physical deployment, and workload, including the number of users per session that each application supports. After this initial phase, you can proceed to a static code analysis aimed at identifying critical components. CAST’s Highlight solution is designed for this purpose: it quickly generates a green ranking of applications by scanning the sources and identifying a list of applications to prioritize. This results in a set of "emission-critical" applications that require focused attention. Only after this step should the selected code be subjected to measurements for determining the ASCRSM index and developing remediation plans

.

Compliance_ASCRSM   Piano_di_Rimedio_Sostenibilità

Implementing a continuous remediation process with gates in the SCM chain

Evaluating and remediating an existing application portfolio can be time-consuming and costly. A more effective approach is to apply green best practices early in the code's lifecycle, ensuring that components with high green sustainability compliance are promoted into production. To achieve this, it is advisable to insert green gates into the software lifecycle, starting from the development environments. This approach also supports a vendor management process based on sustainability. However, this is a delicate issue, as blocking gates in the toolchain could disrupt scheduled releases and business operations.

In this context, it is helpful to divide applications into two main categories: "new" applications and those already in operation that are subject to maintenance and upgrades.

For new applications, starting from scratch allows the imposition of green compliance thresholds for each release that are close to the ideal—ideally 100%—with only minor deviations allowed.

For existing applications, a conservative approach is more effective to avoid delays. The key is to ensure that no new green violations are introduced with each release. A baseline measurement of the code at time t0 serves as a reference for subsequent green evaluations as the code passes through the gates. The CAST platform natively distinguishes between existing violations (pending) and those added in the latest version (added), enabling the implementation of this process.

Given the automatic and integrated nature of this measurement within the SCM (Software Control Manager) system, and considering the importance of the topic, it is advisable to pass all code through sustainability gates for a comprehensive evaluation. Alternatively, to focus efforts, "emission-critical" applications can be identified through the pre-selection process described above, and green measurements can be conducted on this targeted set.