Testing user interfaces (UI) on microcontroller (MCU)-based devices has traditionally been a highly manual, error-prone process. The lack of computing resources, display abstraction, and conventional debugging tools makes it difficult to implement automated testing workflows commonly used in desktop or mobile development. However, recent advancements in lightweight UI frameworks like Qt Quick Ultralite (Qt QUL) and specialized testing tools such as Squish for MCUs are changing the landscape, making automated UI testing viable even in resource-constrained environments.
In this article, we’ll break down how Squish for MCUs supports automated testing for Qt Quick Ultralite applications, the technical challenges it addresses, and what future developments will bring to embedded UI test automation.
Why UI Testing on MCUs Is Challenging
Microcontrollers are designed for efficiency and low power consumption. While ideal for embedded applications like appliances, wearables, or automotive dashboards, they lack the infrastructure typically required for UI test automation. Specifically, MCUs often have:
-
Very limited CPU cycles (e.g., <200 MHz)
-
Low RAM and flash memory (often <1MB RAM, <2MB flash)
-
No operating system or only a minimal RTOS
-
No network stack or dynamic object introspection
These constraints eliminate the possibility of using traditional object-based UI testing, which depends on runtime reflection, accessible widget hierarchies, and remote communication protocols.
Qt Quick Ultralite addresses these limitations by offering a streamlined subset of Qt Quick, optimized for MCUs. It removes non-essential APIs (like networking and multimedia) to reduce memory and storage usage. However, this also limits the options for automated testing.
Qt Quick Ultralite: A UI Framework Tailored for MCUs
Qt Quick Ultralite is a runtime designed specifically for MCU-class devices. It offers a streamlined subset of the Qt Quick/QML framework, optimized for devices with tight memory and processing budgets. Key trade-offs include:
-
Removal of heavy components (e.g., networking, multimedia, and scripting engines)
-
Precompiled QML code for reduced memory usage
-
Static layouting and minimal runtime allocation
While these optimizations make Qt QUL ideal for performance, they also reduce runtime introspection and make UI testing significantly harder unless paired with a tool built for the job.
How Squish Enables Automated Testing on MCUs
Squish for MCUs is purpose-built to enable UI test automation in embedded environments. Its architecture bypasses the need for object-level access or network stacks by using a Device Link runtime module. This module is compiled into the target application and enables two core testing capabilities:
-
Synthetic Input Injection: Sends low-level touch, tap, or click events directly to the UI stack, simulating real user interaction.
-
Screen Data Capture: Retrieves framebuffer snapshots for analysis, including image comparison and Optical Character Recognition (OCR).
This approach enables image-based testing and OCR (optical character recognition) without requiring object-level access or a full network stack.
What You Can Test with Squish for MCUs
- Simulated user interactions (e.g., tapping a button)
- Presence of specific images (e.g., UI elements)
- Text recognition via OCR
- Visual and screenshot comparisons
While object awareness is not yet available, it’s on the roadmap for future releases.
A Real-World Example
In a demo, a simple Qt Quick Ultralite application for home temperature control was tested using Squish. The test script:
- Connected to the MCU device
- Located and clicked a green button using image recognition
- Verified that the system state changed by detecting the word “OFF” via OCR
This test was recorded and replayed entirely within the Squish IDE, demonstrating how even basic image-based testing can validate UI behavior on embedded devices.
Supported Hardware and Tools
Squish currently supports Tier 1 MCU boards from STM and NXP, devices with the highest level of support from the Qt for MCUs team. The testing workflow integrates with:
- Squish IDE (supports Python, Perl, and other scripting languages)
- Vendor tools for flashing and debugging
- Tesseract OCR (included with Squish) or other OCR engines
Tests can be recorded, edited, and replayed directly from the Squish IDE, and integrated into CI/CD pipelines for automated regression testing.
What’s Next for Squish and MCU Testing
Future updates to Squish for MCUs will include:
- Object awareness: Access to the full object tree and properties for more precise testing
- Support for additional boards, including Espressif’s ESP32
- Testing for other GUI toolkits, such as LVGL
These enhancements will expand the scope and depth of automated testing for embedded UIs.
Conclusion
Automated UI testing on MCUs is no longer out of reach. With Qt Quick Ultralite and Squish for MCUs, developers can:
- Replace manual testing with reliable automation
- Validate UI behavior using image and OCR-based techniques
- Integrate tests into modern CI/CD workflows
As embedded systems become more complex, tools like Squish are essential for maintaining quality and accelerating development.
Learn more about
Squish for GUI Automated Testing
Watch a keynote by Katarina Behrens, Senior Software Engineer at Qt Group, "Testing Qt Quick Ultralite Applications on MCU Devices"