The regression testing methodology was developed to ensure that embedded systems still function as they should after hardware or software changes. When code is restructured, for example through firmware updates or application enhancements, unintended consequences can create unpredictable outcomes.

Bugs can be inadvertently introduced, and functionality can be compromised. To be effective, regression testing must include all previous test cases and it should always include a review of energy consumption in the system.

Automation is Key

Where possible, automation needs to be used because over time the number of test cases can grow to hundreds or even thousands. Some of these will need to be updated and the new code tested, new test cases may need to be added, and older ones that are no longer relevant should be deleted to prevent unnecessary evaluation slowing down future development.

Without considering power consumption as a key regression test, it’s easy to seriously compromise the operating life of IoT devices that are battery-powered, powered by harvested energy, or derive power from a combination of these sources.

Including power consumption in regression testing is key to maintaining a device’s efficiency and reliability throughout its lifecycle.

Power Measurements in Manual Regression Testing

Hardware, firmware, and software developers need to create and manage power efficiency benchmarks and continuous regression testing. Integrating power efficiency testing into daily development work is essential and there are now compact, low-cost tools that make it possible.

These enable you to synchronize results visualizations and compare multiple power measurement recordings. You can easily add new recordings to existing projects and carry out extended measurements and benchmarking. All of this can be done in real-time (Figure 1), so the impact of firmware and software changes on system power consumption can be evaluated instantly. 

Comparing power measurements in real-time enables the effect of even small software changes to become immediately apparent when estimating the operating life of IoT devices using Otii Arc/Ace Pro.

Figure 1. Comparing power measurements in real-time enables the effect of even small software changes to become immediately apparent when estimating the operating life of IoT devices using Otii Arc/Ace Pro. Click image to enlarge

When power consumption increases, it can indicate that a bug has been introduced that may not have been revealed in functional tests. However, with the latest test equipment, you can synchronize a UART log output with power metrics to produce detailed insights into your project’s power profile. This functionality makes a significant contribution to software quality assurance.

By making such measurements part of everyday development work, you make embedded and IoT development more power-efficient and more cost-effective. 

Automation Saves Time and Effort

It’s now possible to script and automate testing of device power consumption, which provides flexibility and scalability. You can evaluate both core and corner use cases and their impact on projected battery life.

Automating power consumption regression testing not only improves efficiency but also cuts the time and effort required for repetitive testing. It also increases test coverage, repeatability, and consistency in the results. 

For battery-driven devices, you’re able to address a multitude of variables, including hardware platforms, components, and a diverse range of deployment environments. IoT protocols, communication layers, and the types and sizes of batteries that you may want to consider can all be compared in a way that simulates real-world operating conditions.

Power measurements can be made part of an existing continuous integration setup, such as Jenkins. The Jenkins extensible framework is designed to make test automation faster and more efficient (Figure 2). It’s an open source, server-based system for developing, building, testing, and deploying software.

Figure 2. Power measurement as part of continuous integration testing of IoT devices within the Jenkins framework

Jenkins enables frequent integration of code changes into a shared repository and ensures that these code changes are always available in a deployable state. Originally developed for Java applications, it now supports the most popular programming languages including C and C++ and its versatility is enhanced by hundreds of proven plugins.

Continuous integration of testing helps prevent surprises in battery life and ensures comprehensive, accurate results.

An Essential Task for Optimizing Battery Life

Regression testing for IoT devices and other embedded systems is essential to optimize battery life, facilitate energy-aware design, enhance system performance and reliability, and ensure compliance with regulatory standards. It is the only way to emulate real-world conditions and realistic user experience.

Today’s power measurement tools for embedded systems are now more sophisticated and affordable than ever before, bringing such resources into the reach of most development labs.

Qoitech’s Otii toolsuite facilitates the measurements described here and more. The suite includes a power profiler, DC energy analyzer, smart power supply, digital multimeter, source measurement unit, power debugger, and battery life calculator. 

All images used courtesy of Qoitech.

Industry Articles are a form of content that allows industry partners to share useful news, messages, and technology with All About Circuits readers in a way editorial content is not well suited to. All Industry Articles are subject to strict editorial guidelines with the intention of offering readers useful news, technical expertise, or stories. The viewpoints and opinions expressed in Industry Articles are those of the partner and not necessarily those of All About Circuits or its writers.