Success Factors in Embedded Testing

 

Nowadays, embedded software is integrated into almost all products – from simple household appliances to safety-critical systems. At the same time, requirements for quality, safety, and maintainability are continuously increasing. Software errors are not just annoying; in the worst-case scenario, they can endanger human lives or cause significant economic damage.

From our many years of experience in testing embedded software, particularly in safety-critical sectors such as passenger transport and medical technology, we know that testing is not a "nice to have" but a decisive factor on the path to a reliable and standards-compliant product.

Below, we summarize the success factors that have repeatedly proven to be crucial in our daily practice.

 

Clear and Complete Requirements as a Foundation

Fundamentally, testing verifies that every software unit does exactly what it is supposed to do. For this to be possible, clear software requirements are needed. Especially in the embedded environment with normative specifications, such as those defined in the basic safety standard IEC 61508 or product-specific standards like EN 62304 or EN 50128, requirements must be formulated clearly, measurably, consistently, and completely.

This allows them to be easily translated into test cases. If a requirement does not allow for a clear test to be derived, the requirement is often not formulated precisely enough.

To avoid room for interpretation and later discussions, the testing team can provide support as early as the requirements review stage.

 

Early Testing Prevents Untestable Code

Testing is not simply a quality assurance step that can be "quickly" handled after implementation. Rather, testing should be woven into the development process from the very beginning.

Those who start testing too late often find themselves confronted with a lack of interface abstraction, global states, and heavy hardware dependencies.

If testing is carried out alongside implementation, testability automatically becomes part of the design, and it becomes apparent early on whether modules have been cleanly separated and responsibilities clearly defined. Furthermore, errors detected early are significantly more cost-effective to fix.

 

Small, Manageable Software Modules as a Quality Factor

Large modules or functions with several hundred lines of code may seem efficient at first glance. In practice, however, such structures often lead to a web of conditions, states, and dependencies that are difficult to trace. For testing, this results in high analysis effort, very complex test cases, and an increased susceptibility to errors.

By dividing the software into smaller units with clearly defined responsibilities, the logic becomes transparent and complexity becomes manageable.

Individual functions can be tested in isolation, dependencies become visible, and errors can be localized more quickly. Small software building blocks also facilitate refactoring and increase long-term maintainability.

 

A Solid Test Infrastructure

Successful tests require a stable infrastructure. A well-thought-out toolchain with a suitable test framework and comprehensive mocking mechanisms forms the basis. The tests built upon this must be independent, reproducible, and fast. Unstable tests quickly undermine trust in the test environment and lead to warnings being ignored and tests being bypassed.

Ideally, test execution is automated within a pipeline. This opens up the possibility of using branch policies to allow the check-in of new code only if all previously implemented tests have passed successfully. This ensures that new changes do not unintentionally affect existing functionalities.

In addition to dynamic unit and integration tests, static analysis tools should not be forgotten. These help to consistently comply with coding standards such as MISRA C or internal guidelines. Static analysis thus not only supports error prevention but also ensures long-term maintainability and consistency in the codebase.

Where the interaction with real peripherals or time-critical behavior needs to be checked, Hardware-in-the-Loop (HIL) offers an effective supplement. By integrating real or simulated hardware, system aspects can be verified that cannot be fully covered by pure software tests. You can find more about this in our separate blog post: https://www.csa.ch/en/blog/hardware-in-the-loop

 

Collaboration with the Software and Hardware Teams

A cornerstone of a successful project is good and respectful cooperation within the project team. Testers rely on transparent architecture information and stable builds from the development team. In return, the testing team is obliged to provide meaningful and reproducible bug reports with clear error descriptions, defined reproduction steps, and logs or measurement data.

The more precise the preliminary work in testing, the faster the development team can react and fix errors. Open communication, mutual technical understanding, and a constructive error culture ensure that the testing team is perceived not as a tedious control instance, but as a quality partner.

 

Management Support

Testing often fails due to priorities. Without clear backing from the management level, testing frequently remains an optional item that is the first to be reduced under time pressure or tight budgets. Especially in the embedded environment, however, this is risky.

If errors appear late in the integration process or even in the production system, they can cause high costs. While investments in a good test infrastructure may seem like an additional effort at first glance, they significantly reduce project risks and total costs in the long term.

Management support is not just demonstrated through budget approvals. It manifests itself in realistic scheduling, clearly defined quality goals, and a corporate culture in which testing is understood as a fundamental part of development. Successful testing is therefore not just a technical discipline, but also a leadership task.

 

Conclusion

Quality in embedded testing is the result of clear requirements, a testable architecture, a stable test infrastructure, and management that consciously supports testing.

Those who understand testing as a fundamental part of development benefit in several ways:

  • Risks become visible early
  • Error costs decrease
  • The maintainability of the software increases sustainably

Furthermore, a systematic understanding of quality strengthens product reliability and customer satisfaction.

Especially in safety-critical environments, quality is not an option, but a prerequisite.

Martin Kuhn

Martin Kuhn

BSc FHNW in Electrical Engineering and Information Technology
ISTQB Certified Tester, System Test Engineer

About the author

Martin Kuhn has been working at CSA Engineering AG since 2019. His main area of responsibility is testing embedded software with increased functional safety requirements, such as in passenger transport or medical technology.

Contact us