Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
15 August 2025
In any kind of software development, but especially embedded, thoroughly testing your software is non-negotiable. Testing creates code that is reliable, maintainable, and capable of handling real-world challenges. It also prevents costly bugs and allows you to iterate with confidence. In this blog, I’ll share some key testing strategies and best practices, pulled from a whitepaper I recently wrote about general embedded development.
Testing needs to be baked into the development process – not an afterthought. That means you should have a robust suite of unit tests at the heart your software. Some frameworks you might want to look at are Google Test/gMock, doctest, Catch2, and Qt Test.
Many developers see testing as tedious or boring, but this mindset needs to change. Unit tests act as a safety net, letting you tweak and improve code without worrying that you’re going to break something. They are one of the best tools you have to ensure your code is dependable when things go wrong.
Comprehensive code coverage is key. During code reviews, flag any untested sections and take the time to flesh out those tests before committing your other changes. Similarly, bug fixes should be considered an opportunity to strengthen the test suite by writing tests that recreate the problem.
Speed also matters. Tests that run in seconds are much more likely to be used frequently, enabling developers to catch issues early. Tests that take too long often aren’t used during daily development. Longer-running tests are fine for CI pipelines, but your day-to-day tests should be quick and easy to deploy.
Here are a couple recommendations for letting tests run quickly in your daily test runs:
When testing embedded systems, it’s important to consider how to test hardware-related features. By separating hardware calls into a hardware abstraction layer (HAL,) you can isolate hardware-related functionality, making it easier to stub it out for testing purposes. Depending on your needs, there are several possible testing options – and often a mix of them works best:
Writing and maintaining separate tests for every edge case can quickly get out of hand. That’s where data-driven testing comes in. Instead of creating specialized test code for each case, developers feed a variety of inputs and expected outputs from external sources, like files or spreadsheets, into the same test logic. Decoupling this logic from test data is a smarter, more efficient way to handle complex testing. Advantages include:
With data-driven techniques, you can cover more ground without creating unnecessary headaches. It’s a practical, efficient way to ensure even edge cases are accounted for.
No matter how much testing you do, crashes happen – especially in embedded systems running in the field. Unlike mobile platforms that provide built-in crash reporting, embedded developers need to roll their own solutions.
The good news is, a practical crash reporting system doesn’t need to be complicated. Minidumps, for example, are a lightweight alternative to full core dumps. These smaller files capture key data, such as registers, stack frames and the instruction pointer, without bloating files or collecting sensitive data. Pairing minidumps with logs and build version information lets you pinpoint issues quickly.
To make the most of crash reports, use a back-end system to collect and process them. Tools like Google Breakpad and Sentry.io can automate much of this process, linking crash data with the correct build symbols and grouping similar issues for easier diagnosis. While more advanced tools like Crashpad are available, simpler systems like Breakpad often provide an ideal balance of functionality and ease of integration. (Sometimes a running start with a straightforward tool is better than being bogged down by the complexities of advanced systems.)
Remember, not all bugs are catastrophic crashes. Many issues are subtle malfunctions that don’t immediately crash the software but still result in a poor UX. These bugs often show up in the field where end users are pushing your code in unexpected ways. Empowering users to report these issues is just as important as capturing crash data.
A robust in-field reporting system should collect all the information you need for understanding the problem, such as thread stacks, logs, and any contextual data. Combine this with a customer’s description of the problem, and you’ll have a clear view of the issue, making it easier to reproduce and resolve. In particular, logs are super helpful because they show you what was happening when the software didn’t work as expected.
Encouraging customers to report bugs also helps builds trust. When users see that you’re listening and acting on their feedback, they’re more likely to remain loyal – even in the face of occasional software glitches.
Testing is not just a duty – it’s a mindset that separates professional software from mediocre solutions. By embracing these best practices, you’ll be setting yourself up for success, ensuring that your software not only performs reliably but also stands up to the challenges of real-world use.
Want more insights into best practices for embedded software development? Download my full whitepaper for more info on mastering embedded engineering.
About KDAB
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications. In addition to being leading experts in Qt, C++ and 3D technologies for over two decades, KDAB provides deep expertise across the stack, including Linux, Rust and modern UI frameworks. With 100+ employees from 20 countries and offices in Sweden, Germany, USA, France and UK, we serve clients around the world.
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Need help with performance issues?
Let the KDAB experts solve concrete performance problems, improve your software architecture or teach your team how to apply debugging and profiling tools to your developement process in the best way.
Get in touch