Sustainable Software Testing – How to implement it

 

Sustainability refers to the idea that resources are limited and should be used carefully, sensibly, and with consideration for long-term goals. Sustainable software development involves designing, creating, testing, and maintaining software with the aim of minimising negative impacts on the environment, society, and the economy, thereby ensuring its long-term viability. Testing software in a manner aligned with sustainable principles is known as sustainable software testing. The following key topics will explore how sustainable software testing can be implemented, and its contribution enhanced:

  • Green Software Testing Practices
  • Risk-Based Testing (RBT) Strategies
  • Resource Optimisation
  • Testing Environments
  • Packaged Solutions
  • Test Automation
  • Remote and Off-Peak Testing
  • Software Waste
  • Net Zero Testing

Green Software Testing Practices:

An approach to software development called “green software development,” sometimes referred to as “sustainable software development,” emphasises environmental sustainability and reduces the impact of software on the environment throughout its entire lifecycle. The main objective of green software testing approaches is to minimise the harmful environmental effects of software testing. Achieving this goal requires understanding the energy consumed, resources utilised, and waste generated during testing.

Some commonly used fundamental green software testing practices include early problem detection in the development cycle, test environment optimisation (including reducing or eliminating the number of test environments), test automation, decommissioning redundant test resources, and resource optimisation.

By adopting green testing techniques, you can significantly reduce the environmental impact of software testing. Software testing, in turn, can support green development techniques by creating reusable test artefacts and optimising testing processes. Cleaner testing methods are typically more efficient, producing software that is less harmful to the environment, with minimal energy use and fewer resources required.

Shutting down non-production servers and test environments during off-peak hours (e.g. 8pm–6am) can be an effective approach to improving your organisation’s sustainability efforts and reducing its carbon footprint. This is especially beneficial, as idle servers continue to consume a significant amount of power. Even switching off production servers over the weekend (or for an alternative agreed period of time) for systems with the lowest business criticality (BC) can have a considerable impact on the organisation’s efforts to achieve sustainability.

Risk based Testing (RBT) Strategies:

Risk-based testing is a methodology where testing efforts are prioritised based on the likelihood and impact of potential failures (risks). This approach ensures that the most critical functionalities are thoroughly tested, but only when necessary, reducing both the risk of major system failures and the amount of testing time. By focusing testing efforts on high-risk areas, resources are optimised, leading to reduced energy consumption during the testing phase. Early identification and mitigation of high-risk issues contribute to long-term software stability, aligning with sustainability goals.

 

Risk-based testing plays an important role in the sustainable software testing domain. Integrating risk-based testing with sustainable practices creates a synergy that enhances both the overall quality and environmental friendliness of software testing. By efficiently identifying and addressing risks while minimising the environmental impact of testing processes, testing teams can contribute to the creation of resilient and sustainable software solutions.

 

Remember that the risk of some activities failing may be so low that no tests are necessary. If the impact of a defect in production is negligible, it is better to avoid testing, as this reduces costs and supports sustainable goals. It is important that risks are regularly reviewed and updated, and the testing approach is amended accordingly.

Resource Optimisation:

Sustainable software development and testing should utilise all resources efficiently. Optimising resources and promoting sustainability are crucial aspects of responsible software development. Consolidating test environments, virtualising resources, or using cloud-based solutions for testing will increase efficiency and reduce the physical hardware footprint. This involves hardware, software, and components such as memory and CPU, among others. Energy usage during the testing phase can be minimised by optimising resources, scheduling tests (e.g., during off-peak hours, nights, or weekends), and concentrating testing efforts on key areas.

Right-sizing testing resources (downsizing or upsizing) and using appropriate resources are key factors in achieving sustainable goals. Right-sizing hardware, software, and infrastructure while ensuring sustainable testing practices not only saves costs but also minimises your environmental impact, such as by identifying idle or underutilised resources. Optimising testing teams and resources is not just about numbers; it’s about making strategic decisions that balance business needs, project status, testing requirements, employee well-being, and environmental responsibility. Right-sizing goes beyond merely increasing or decreasing resources and headcount; it’s about doing so sustainably and responsibly, considering both testing needs and team well-being. Balancing downsizing and upsizing while prioritising sustainable testing requires a strategic approach at the organisational level.

It is important to periodically audit the test approach and requirements, updating or removing unused or outdated tests. This frees up resources and enhances the sustainability of the test systems. Cloud testing platforms and environments offer flexibility and scalability, allowing resources to be provisioned only when needed. This eliminates over-provisioning of infrastructure, reducing both hardware and energy consumption.

Test data optimisation is another effective method to minimise data footprints and redundancy, supporting sustainability principles. This involves refreshing the test environment as needed with the right amount of data. A functional testing cycle may not require a full data refresh compared to a testing environment used for performance or volume testing. It is also important to clean up the environment after testing.

One practical way to enhance your company’s sustainability efforts and lower its carbon footprint is to turn off non-production servers during off-peak hours (e.g., 8 pm to 6 am). The main advantage is that idle servers still consume significant amounts of electricity. Research indicates that a large portion of an organisation’s energy usage is attributable to its IT infrastructure, and shutting down non-essential servers can lead to substantial energy savings. Reduced energy consumption directly lowers electricity costs. While exact savings may vary depending on factors such as server location and size, this can still be a significant cost-saving strategy. Lowering your company’s energy usage immediately helps to reduce its carbon footprint and lessen its impact on climate change. However, be aware that servers may require time to restart, which could result in delays, increased power consumption, and other environmental effects. Careful planning and automation techniques are essential to ensure that shutdown and startup procedures run smoothly without human intervention, effectively implementing this strategy. Even turning off production servers over weekends (or for a set period) for systems with the lowest business criticality (BC) can significantly contribute to the organisation’s sustainability targets. For instance, if a company can operate without a BC4 (lowest BC) system for a few days, it may not need to power it over the weekend. If it is not possible to completely shut down non-production servers, alternative options should be considered. Most modern OS systems and cloud providers offer power management capabilities that enable servers to enter low-power states when idle, greatly reducing energy consumption. Which strategy is best for you will depend on your priorities and specific needs. By carefully weighing the potential benefits and drawbacks, you can increase your organisation’s sustainability while maintaining efficient development and testing processes.

An optimised testing approach, coupled with effective strategies, plays a significant role in achieving sustainable testing goals. Utilising off-the-shelf product features, including the product’s built-in automated testing suite, will help reduce costs and support sustainability goals. It may be possible to avoid performance and volume testing, as well as accessibility testing, by reviewing the information provided by the software vendor against the implementation architecture and design. For example, an off-the-shelf product with W3C AA compliance may not require W3C AA accessibility testing if customisation and configuration during implementation are minimal.

Note: To assist everyone in creating a web that adheres to the ideals of accessibility, internationalisation, privacy, and security, the World Wide Web Consortium (W3C) creates standards and recommendations. There are three levels in WCAG: Level A (the lowest level), Level AA, and Level AAA (the highest level). These are usually pronounced as ‘single A’, ‘double A’, and ‘triple A’. Conformance at higher levels also indicates conformance at lower levels.

Testing Environments:

Creating sustainable testing environments can contribute to achieving overall sustainability goals. Utilising energy-efficient hardware and optimising test environments can reduce the environmental footprint of testing. This includes decommissioning unused environments and, in some cases, not using a dedicated testing environment at all (i.e., testing on production). Large programmes and enterprise solutions often maintain multiple Development, System, Integration, Non-Functional, UAT, Training, and Pre-Production testing environments. Maintaining multiple environments is often a resource- and cost-intensive process.

Cloud testing platforms and environments offer flexibility and scalability, enabling the provision of resources only when needed. This eliminates over-provisioning of infrastructure, reducing both hardware and energy consumption. However, it is important to optimise infrastructure usage. According to a major study by IDC, 64% of global organisations spend more on cloud than originally budgeted, and 21% of mature cloud users in Europe admitted they do not know how much money they are wasting on public cloud services. Controlling rapidly growing cloud costs is now the top priority and challenge of cloud adoption (State of Cloud Report, Flexera, 2023).

Leveraging virtualisation technologies and cloud-based testing platforms can contribute to sustainability by reducing the need for physical hardware and infrastructure, thus lowering energy consumption and resource usage. Creating green testing environments involves employing eco-friendly practices, such as energy-efficient data centres and responsible disposal of hardware, to support the testing process. Sustainable software testing aims to use resources such as hardware, test environments, personnel, and testing tools efficiently to minimise waste and reduce the environmental impact associated with testing processes.

Packaged Solutions:

A packaged solution is designed to fulfil a specific need or address a particular issue. It may consist of several components, including services, support, software, and training. Packaged software, sometimes referred to as off-the-shelf software, can be implemented more quickly, at a lower cost, and with less environmental impact than custom software.

When compared to custom development, a packaged software solution saves time and money while still providing a dependable, high-quality software product. The use of reusable test frameworks and scripts reduces the need to create new tests for every product update. By focusing on essential features during testing, the test suite can remain relevant even when minor feature additions are made to the software. This approach makes the process more sustainable in the long term by reducing rework and streamlining future testing efforts.

There are advantages to implementing off-the-shelf products (e.g., SAP), but some solutions can become bloatware if software providers continually update their products with new features to stay competitive and maintain or extend their market share.

Test Automation:

Software test automation makes a significant contribution to sustainability in several ways. By automating repetitive and time-consuming test cases, tests can be run faster and more efficiently, requiring fewer servers and workstations. Automation often involves the use of specialised testing frameworks and tools with lower resource requirements compared to manual testing. This minimises software overhead and enhances overall resource efficiency and sustainability.

Automated tests can be scheduled to run during off-peak hours when energy demand is lower, taking advantage of reduced electricity rates and further minimising peak resource utilisation. Automation also decreases the time and resources needed for testing, making it a more sustainable option compared to manual testing. CI/CD and DevOps practices encourage the frequent integration and testing of code changes, enabling early issue detection and resolution. However, frequent testing can result in substantial energy, resource, and infrastructure consumption, which negatively impacts efforts to achieve sustainability goals.

Remote and Off-Peak Testing:

Remote testing can eliminate the need for a dedicated environment restricted to a specific testing type, such as performance testing or penetration testing. This approach allows for the continuous utilisation of the environment 24/7, aligning with sustainable principles. For example, the team can be optimised to conduct testing during non-office hours, or remotely test the solution from a different geographical location.

Software Waste:

Sustainable testing aims to minimise electronic waste (e-waste) by ensuring that software is thoroughly tested and free of critical defects before release. This helps prevent the need for frequent updates or replacements due to software issues. Post-launch software testing often involves monitoring for issues and collecting user feedback. By promptly addressing problems and improving user satisfaction, software can have a longer and more sustainable lifecycle. Leveraging virtualisation technologies and cloud-based testing platforms contributes to sustainability by reducing the need for physical hardware and infrastructure, thereby lowering energy consumption and hardware wastage.

Net Zero Testing:

Net zero, often referred to as carbon neutrality, refers to a state where the greenhouse gases emitted into the atmosphere are balanced by the removal of an equivalent amount of greenhouse gases. This means that while we may still be emitting some greenhouse gases, we are actively removing them from the atmosphere through various methods such as planting trees, investing in renewable energy, and utilising carbon capture and storage technologies.

Net zero sustainable software testing takes the concept of sustainable testing a step further, focusing on achieving carbon neutrality throughout the testing process. This means that any greenhouse gas emissions generated during testing are balanced by removing an equivalent amount from the atmosphere. It involves precisely calculating the carbon footprint of the entire testing process, taking into account emissions from data centres and network traffic, as well as energy use from hardware, software, and infrastructure. After conducting this assessment, testing strategies can be created to reduce emissions or identify testing activities that can be eliminated to offset greenhouse gases. Some of these strategies include reducing testing cycles and environments, using energy-efficient hardware and software, optimising resource utilisation, utilising renewable energy sources, automating tests to reduce resource consumption, optimising cloud technologies, and selecting effective testing frameworks and tools.

Synopsys:

Sustainable testing considers the environmental impact of testing activities throughout the software testing lifecycle. A well-tested software product tends to provide a better user experience. When users can accomplish tasks efficiently and without frustration, they are less likely to abandon software prematurely, thereby reducing the need to seek alternatives or updates. Sustainable software testing focuses on conducting testing activities in a manner that minimises resource consumption, reduces waste, and takes into account the environmental impact of testing processes. It aligns with broader sustainability goals and can contribute to greener software testing practices.

Software testing and sustainability may seem like two unrelated concepts, but they can be interconnected in several ways. Sustainable testing can, in turn, contribute to a greener and more environmentally responsible digital world.

It’s worth noting that “too little testing is a crime, and too much testing is a sin”—a sustainability sin against the planet and future generations. It is highly recommended to appoint a Sustainability Champion for every software development or production team to thoroughly examine requirements, solutions, architecture, test approaches, and so on, through the lens of sustainability. By embracing sustainable testing practices, you can create a win-win situation for your team, your projects, and the planet.

 

About the Author

Boby

Find out more about @bobyjose

Related Content