Abstract

The embedded system is a tight-knit combination of hardware and software components whose power, memory, speed, and connectivity to the external world are constrained. It takes significant time, effort, and money to test embedded device software because each device is unique. Depending on the situation, manual testing can be exorbitant and time-consuming, contributing 60% of the development effort. A variety of embedded software types, their respective testing needs, and automation solutions are explored in this white paper.

Introduction

If we look at current trends, the automation of homes and residential units is on the rise, healthcare is upgrading to smarter diagnoses, digitizing solutions, and solving complex medical conditions, automobiles are becoming smarter, more entertaining, and safer, telecommunications are setting up smart communications infrastructure, and railroads are improving their safety and security. To improve productivity and produce more intelligent products, large and complex manufacturing industries are adopting embedded systems. To support these trends, the development of embedded systems and software with short development cycles is becoming increasingly critical, along with catering to the need for more sophisticated, defect-free, reliable, and high-quality embedded systems for a competitive edge in the market.

In every industry and organization, embedded systems and devices solve specific problems in unique ways. Therefore, to determine the success of an embedded device or software solution, it is important to verify the reliability, robustness, and performance (speed of the testing process), which includes both functional and non-functional aspects, in a rapid, invasive, repetitive manner. In testing, functions and non-functions of a system are verified and validated, and the most critical defects are exposed to improve a system's quality and reliability. In this paper, we will examine different types of embedded software used across industries, as well as the challenges associated with embedded software testing and how it can be automated to improve test coverage and reduce time-to-market.

shutterstock_2166690497

What is Embedded Software?

Embedded software is created to run on the specific device on which it is installed. This means that the restrictions on processing and memory are tied directly to the specifications of that device.

What is Embedded Software

As shown in the above diagram, software embedded in a device consists of the following four building blocks:

1. Firmware

Firmware is software written directly for hardware. It communicates with other devices directly or performs basic tasks and functions without requiring APIs, operating systems, or device drivers. Firmware is formed of the boot loader, board support packages, and hardware abstraction layer (HAL).

2. Operating system

Operating systems, along with required device drivers, are defined as a software package that enables a user to run other applications on an embedded device in its most general sense. They are divided into two types:

• Embedded operating systems (EOS) such as embedded Linux, Yocto OS (operating system), and Ubuntu Core

• Real-time operating systems (RTOS) such as VxWorks, Azure RTOS, QNX, and so on. 

3. Middleware

In computing, the term middleware refers to a software layer that sits between a user application and an operating system. This layer is also referred to as embedded frameworks, and it is used to ease the rapid development of user applications on a wide variety of operating systems and platforms with more sophisticated interoperability capabilities. A few good examples of this would be application frameworks such as Android and iOS that address telecommunication needs, Qt that addresses automotive, aerospace, consumer, and industrial user interface needs, and ROS (robot operating system) that addresses robotic automation needs.

4. User applications 

This refers to software that is installed on the operating system and uses middleware and firmware to perform the primary functions of an embedded system. Essentially, this application solves a specific problem within a specific domain. Every end application is unique, but operating systems and firmware may be the same from device to device. Embedded user applications can be classified into the following types:

a. Bare-mettle embedded application
This is the simplest type of embedded application to be self-contained without an operating system. All other types followed this type. To meet the needs of this embedded software, the software engineering team must also design and build the testing framework from scratch. As a result, we cannot use any off-the-shelf testing tools or frameworks available today.

b. Embedded Linux applications
This is an end-user application that does not have any real-time requirements and runs on a customized embedded Linux operating system. General purpose evaluation boards like Raspberry Pi, Beagle Bone, and Jetson are examples of embedded Linux devices that run on various embedded Linux distributions such as Yocto, Ubuntu Core, and Windriver for training and software development. There are also good off-the-shelf test tools that can be customized and extended to meet application-specific testing needs, e.g., LAVA.

c. Embedded RTOS software
When an end-user application has hard or soft real-time, deterministic, and repeatable behavior needs, they are developed and deployed on top of real-time operating systems like Azure RTOS, and QNX. Real-time operating systems applications include airline traffic control systems, command control systems, airline reservation systems, heart pacemakers, multimedia networks, and robots.

d. Embedded networking software
Software for embedded systems is primarily concerned with transferring data from one module to another or making two modules talk to each other. Embedded software is given a special category for networking since it requires a specific talent set to develop and manage custom network stacks. There are several types of network stacks, including Ethernet stacks, Wi-Fi stacks, and Bluetooth stacks.

e. Headless embedded UI software
Headless user interface (UI) software does not have any UI on the device but uses a Web server to enable remote access. The implementation of headless devices with remote access over the user's mobile device may become dominant in industries such as home automation. The future may see fewer refrigerators, ovens, and washing machines with large displays but more Wi-Fi-enabled devices. Using Web application test utilities, these applications can be tested with ease.

f. Embedded UI software
A GUI (graphical user interface) application is one that has a user interface embedded within it. They run on embedded microprocessors and controllers running embedded OS and RTOS that are hidden inside products such as cellular phones, communication equipment, automobile engines, laser printers, and medical devices. GUI applications are built on Qt, Azure GUIX, PEG, etc. GUI libraries are examples of such applications that are usually constrained by power, memory, and performance. Some of these libraries also provide testing capabilities that must be adapted for application testing.

g. Mobile application
Mobile applications, also known as apps, are software applications that run on mobile devices, such as smartphones or tablets. The complexity of embedded devices is hidden from developers so that they can develop rapid applications with smooth interoperability. This should be categorized as a separate embedded application type. Examples include applications developed for Android and iOS devices such as smart watches, TVs, mobile phones, tablets, etc. Testing tools are more mature for these types of applications, e.g., Appium, selenium, etc.  

shutterstock_2147543211

What are the uses of embedded software?

Here are some examples of industries that use embedded technology

Consumer electronics

Microwave ovens, refrigerators, etc use embedded software to regulate temperature. Embedded systems are also used to build home automation systems to control lights, room temperature, security systems, and entertainment systems via wireless and wired networks.

Healthcare

An embedded system can be found in imaging systems such as MRIs (magnetic resonance imaging), CAT scanners, and PET scanners, electronic stethoscopes, auditory medical devices, therapeutic devices such as infusion pumps, pacemakers and diagnostic devices such as blood pressure monitors and ECG monitors as well.

Automotive

Safety systems such as Anti-Lock Braking Systems (ABS), Traction Control Systems (TCS), and Electronic Stability Controls (ESP) have been developed with embedded technology. Drive-by-wire and brake-by- wire technologies have also been implemented through embedded systems by automakers.

Telecommunications

Devices such as mobile phones, network switches, and data routers use embedded technology. High-speed networking capabilities can also be developed with this technology.

Railroads

To ensure safer travel, railroads incorporate embedded technology into their signaling systems. By managing railroad signals and heavy railroad traffic, embedded technology reduces the chances of mishaps.

Aerospace

A few examples of embedded systems in commercial planes are in-flight entertainment systems, temperature control, speed control, sensors, flight management systems, flight data recorders, and engine control.

Industrial

The focus is often on deterministic real-time operation and secure cloud connectivity for applications such as factory floor management, motors, and windmills.

What is Embedded Software Testing?

The purpose of embedded software testing is to verify a software's functional and non-functional attributes as well as its bug-free integration with hardware. There are five levels of the testing process for embedded software:

1. Software unit testing

Software unit testing involves testing each unit of software to decide whether it performs as expected. The process involves isolating a section of code and verifying its accuracy during the software development phase. A unit may be a function, a module, an object, a procedure, or a method.

2. System unit testing

To conduct the test, a framework having information about software codes and real-time operating systems, including details about communication, mechanisms, and interrupts must be developed. A point of control protocol sends and receives messages via message queues. Next, the developer sees the system resources to figure out whether the system can accommodate embedded system execution. Gray box testing is often used for this process.

3. Integration testing

Integration testing can be further divided into two categories: software integration testing and software/hardware integration testing. A software component is tested in conjunction with a hardware component. You can also use this test to analyze how software interacts with peripheral devices. Embedded tests are always conducted in a real-world environment like the one in which software is developed. Most testers find embedded testing crucial since comprehensive testing can't be conducted under simulated conditions.

4. System integration testing

During this process, the entire system is contained within a single node. To control and observe, a combination of communication protocol choice, operating system events, and messages is used. A combination of black and grey box testing is often used for this process.

5. System validation testing

This is also called acceptance testing. Here, testers ensure that the embedded system and subsystem are perfectly implemented. Analyzing whether the external entity can match the product's functional requirements is the main aim. External entities can be people, devices, or both. In this process, black box testing is often used.

What is Embedded Software Testing?

The purpose of embedded software  testing is to verify a software's functional and non-functional attributes as well as its bug-free integration with hardware. There are five levels of the testing process for embedded software:

1. Software unit testing

Software unit testing involves testing each unit of software to decide whether it performs as expected. The process involves isolating a section of code and verifying its accuracy during the software development phase. A unit may be a function, a module, an object, a procedure, or a method.

2. System unit testing

To conduct the test, a framework having information about software codes and real-time operating systems, including details about communication, mechanisms, and interrupts must be developed. A point of control protocol sends and receives messages via message queues. Next, the developer sees the system resources to figure out whether the system can accommodate embedded system execution. Gray box testing is often used for this process.

3. Integration testing

Integration testing can be further divided into two categories: software integration testing and software/hardware integration testing. A software component is tested in conjunction with a hardware component. You can also use this test to analyze how software interacts with peripheral devices. Embedded tests are always conducted in a real-world environment like the one in which software is developed. Most testers find embedded testing crucial since comprehensive testing can't be conducted under simulated conditions.

4. System integration testing

During this process, the entire system is contained within a single node. To control and observe, a combination
of communication protocol choice, operating system events, and messages is used. A combination of black and grey box testing is often used for this process.

5. System validation testing

This is also called acceptance testing. Here, testers ensure that the embedded system and subsystem are perfectly implemented. Analyzing whether the external entity can match the product's functional requirements is the main aim. External entities can be people, devices, or both. In this process, black box testing is often used.

Challenges in Embedded Software Testing

In Web, mobile, cloud, and desktop applications, testing automation has reached a high level of maturity, and the market offers highly complex solutions. It is becoming increasingly clear that embedded software testing must evolve in this direction. This is due to the industry's aggressive move toward more intelligent solutions, such as those based on artificial or cognitive intelligence. To put it another way, embedded software testing and automation have a long way to go, and embedded testers' lives are still difficult despite new-age technologies such as remote connectivity, emulators, simulators, Docker containers, and test solutions.

Let's look at what challenges testing embedded software and systems face:

1. Need for know-how

Skilled and thorough knowledge of functionality, as well as technical knowledge of mechanical, environmental, electrical, and software triggers, is a must. Due to the unique nature of each embedded software, they do not have the same learning curve for software testing.

2. Need for determinism and repeatability

It is hard to reproduce repeatable deterministic real-time behavior for testing embedded software since most of it is real-time and deterministic.

3. No single communication method

The fact that there is no single communication protocol or channel that can be used to communicate with embedded devices, to test software for these devices calls for knowledge and adaptability of multiple communication protocols and channels.

4. Hardware dependency and lack of access

Testing embedded software presents several technical challenges since it is heavily dependent on hardware devices. There is a high probability that a competent hardware platform will not be available during the first testing phase, and testers may have to conduct the test without a hardware platform. As a result, testers are forced to settle for emulators and simulators that do not accurately stand for the real behavior of real devices. This leads to inaccuracies in deciding the usability and performance of a system.

5. Software vs hardware defects

It is common to detect a high ratio of system defects in embedded testing since both software and hardware are tested. It is not easy to tell whether the defects are mainly in software or hardware. This complicates debugging. In such cases, the testing team's knowledge of hardware and software is critical. Furthermore, the embedded software works well on one hardware variant but often fails on another. This is a big obstacle in embedded testing.

6. Non-reproducible defects

It is even more difficult to reproduce defects in embedded testing due to the reproducibility of events in software and hardware. As a result, testers must analyze every defect at a higher level. In addition to finding the source of defects, collecting reproduction data is also challenging.

7. Software update limitations

Security fixes, RTOS upgrades, kernel upgrades, and many other upgrades are necessary for embedded systems. Testing activities can become more complex because of such changes. Therefore, builds, productions, and deployments need to be handled with extra care.

8. Regression test

An iterative development life cycle involves developing a revision of software or hardware based on an earlier release. That means testers or developers must execute previously developed test cases that are affected by the updated software changes, along with added tests. Testers always perform this regression process at the end of every sprint or iteration. Changes here usually break existing tests, and fixing them is always a painful task, and in most cases, supplementary tests must be written. Choosing which parts of the application to test is the key challenge in regression testing.

How to overcome these challenges?

If you choose the right software architecture for embedded systems that proves measurable testability by controlling the inputs of each component (possibly manipulating its internal state) and seeing its outputs (and possibly its internal state), most of the above-mentioned challenges can be overcome by—

Overcoming these Challenges?

Know-how

  • Skilled knowledge of mechanical, environmental, electrical, and software triggers is must
  • Shallow learning curve

Determinism and repeatability

  • Most embedded software is real-time and deterministic
  • Difficult to recreate repeatable deterministic real-time behavior

Communication

  • Not a single communication protocol or channel
  • Multiple communication protocols and channels need to be understood and adapted

Hardware dependency & Lack of access

  • Non availability of hardware at early phase of SDLC
  • Difficult to move and setup heavy hardware to test location

Software vs hardware defects

  • Isolating software defects from hardware one
  • Difficult to debug
  • The software works well on one hardware but fails on another

Firmware update

  • Often require security fixes, RTOS upgrades, kernel updates, and other upgrades, making testing more complex

Regression

  • Choosing which parts of the application to test
  • Specially in Iterative development, Changes usually break existing tests

Non-reproducible defects

  • Difficult to reproduce defects
  • Finding the source of defects, collecting reproduction data
 shutterstock_2142756045

1. Adopting testable software architecture

Use popular, stable, and mature OTS middleware or develop an in-house framework that encapsulates hardware, platform, and operating system intricacies. This will help to significantly reduce the learning curve of test engineers in case the OS, hardware, platform, or environment changes.

2. Provisioning injectable test hooks

The chosen middleware or in-house developed middleware must provide test hooks to ease integration with test fixtures and supply more control over input and output.

3. Abstracting device communication

Construct a portable device communication strategy that encapsulates all communication protocols and channels and is highly configurable and scalable.

4. Adopting modular and scalable test architecture

To achieve greater reusability and sustainability during the iterative development cycle, it is important to have modular and scalable test architectures.

5. Emulators and test containerization

Configurable and virtualized test execution environments will aid in first software testing where real hardware availability is limited. In an iterative development model, containerization will ease deployment and software upgrades.

6. Enabling remote and distributed testing

Using FOTA (firmware over the air) will allow devices to be upgraded remotely. And having the ability to control multiple devices remotely will improve agility and significantly reduce regression and execution time.

7. Enabling CI/CD integration

Continuous deployment and testing will help to achieve automated repeatability of test execution and development workflow management.

8. Using cognitive intelligence

Cognitive intelligence solutions will help testers to create self-healing tests and perform regressions on change triggers and change impact analysis.

9. Creating test scripts in Gherkin syntax

The use of Gherkin syntax for test script creation for embedded applications will abstract out platform dependency and enable validation/acceptance test creation by business analysts or stakeholders in plain English.

10. Test automation

For non-reproducible or intermittent defect verification, tests need to execute repeatedly, multiple times for longer durations. Using a modular framework for automated testing will simplify the process of automating and orchestrating flaky tests.

To address the challenges and solutions mentioned above, embedded device test execution processes must be automated. Testing can be made more efficient and less time-consuming by automating the process before manual testing. This results in organizations launching their products earlier and reducing software development costs significantly, which is crucial to their success.

Cyient’s Solution: CyFAST (AI-Powered E2E System Test Automation Platform)

Cyient's end-to-end test automation framework, named CyFAST, is designed to solve most embedded test automation challenges with an intuitive test management workflow. How multiple stakeholders will be able to automate test execution for multiple devices and applications is shown in the infographic below.

With CyFAST, embedded testing will benefit from the most advanced features of the robot framework, and CyFAST’s containerized distributed test execution capability will allow the parallel execution of multiple targets on multiple platforms. There is an embedded test library provided by CyFAST, along with portable and easy-to-configure test hooks that can be used to quickly develop and integrate test keyword libraries for every type of embedded software application. This library may be run with a remote server from the robot framework as well as in isolation.

1-Jun-30-2023-10-53-39-9696-AM

 

Conclusion

Due to the difficulty of embedded testing, organizations struggle to deliver high-quality embedded software or embedded solutions in an efficient, cost-effective, and prompt manner and with adequate test coverage. Testability of embedded software can be improved if embedded software is architected to abstract OS, platform, hardware, and communication interfaces to enable effective and deterministic test automation. Test automation frameworks with modularity and high scalability are essential for enabling distributed testing of several types of embedded applications. Cognitive intelligence and containerization of test environments will greatly reduce regression effort in embedded software testing, especially in iterative development models.

About the Author


Bhushan Mahajan

Bhushan Mahajan, senior solutions architect at Cyient, has vast experience in medical device design and development. In the course of developing medical devices and frameworks for their verification, Bhushan has become well-versed in best practices and pitfalls to be avoided. Cyient’s CyFAST is aligned with identified megatrends and is a key support to technology driven disrupters specifically for automation.

About Cyient

Cyient (Estd: 1991, NSE: CYIENT) is a leading global engineering and technology solutions company. We are a Design, Build, and Maintain partner for leading organizations worldwide. We leverage digital technologies, advanced analytics capabilities, and our domain knowledge and technical expertise, to solve complex business problems.

We partner with customers to operate as part of their extended team in ways that best suit their organization’s culture and requirements. Our industry focus includes aerospace and defense, healthcare, telecommunications, rail transportation, semiconductor, geospatial, industrial, and energy. We are committed to designing tomorrow together with our stakeholders and being a culturally inclusive, socially responsible, and environmentally sustainable organization.

For more information, please visit
www.cyient.com