Whitepaper: Streamlining Unit Testing for Embedded and Safety-Critical Systems

Unit testing is necessary but demands significant time and resources. There’s a better way to successfully address unit testing that’s scalable and effective.

Learn why unit testing is absolutely essential for embedded and safety critical systems, associated challenges and best practices to overcome them.

Parasoft ctest Unit Testing

Download the whitepaper to discover the key elements for successfully executing unit testing scalably and successfully.

Focus areas:
  • Using automation tools for test creation
  • How to isolate components to improve automation
  • Successfully executing unit tests
  • Knowing when to call a test “complete”
  • Addressing late stage defects with static and runtime analysis
  • Using advanced reporting and analytics to tie it all together
  • The importance of tool certification and qualification for safety critical systems

Unit testing is essential for increasing the speed and quality of software development while reducing risk and costs. When it comes to safety critical systems, unit testing is required to qualify software for its intended use.

Unit testing is critical for:

  • Safety
  • Security
  • Verification
  • Validation

Unfortunately, unit testing demands considerable time and resources. Most of the time, a programming expert has to design, develop and maintain unit tests. In addition, unit tests are fragile to changes in software and their maintenance can burden projects.

On the plus side, there is a way to successfully execute unit testing scalably across your project, allowing more of the software team to contribute rather than engineers exclusively.

Without an automation tool, unit test creation is incredibly time-consuming. Software engineers who know the unit and development environment have to code unit tests. However, an automation tool like Parasoft C/C++test can simplify the process by integrating into the developers’ IDE and providing a framework for unit testing.

At times, automation tools for unit testing can be difficult because team members have mixed skillsets and preferences. Some may prefer to go directly to code while others may prefer a higher level, such as test logic. This can be solved by using graphical editors and views, plus source code-based representations of test artifacts.

Isolating a unit from its dependencies so that you’re only testing the unit itself is the hardest part of unit tests. Stubs (test doubles) are used for unit isolation but become difficult due to programming the response from stubs. Parasoft C/C++test make stubbing dependencies the preferred method for code isolation because it’s flexible. There’s no need to rearchitect code or use special code design like virtual functions.

Tests have to be run on the intended target system, which can have an entirely different architecture than a typical desktop system. Manual test execution on embedded targets is very time consuming, but can be alleviated using test automation, both local and remotely to a target system. For instance, Parasoft C/C++ offers remote execution which includes:

  • Runtime analysis
  • Code coverage
  • Test results extraction

It seems like an obvious statement, but what it means to be finished testing can vary from person to person. Ideally, it’s over when the requirements are proven to be met. With some applications, nonfunctional requirements like performance, security, safety and ensuring there aren’t lingering problems in code. Tool automation keeps track of metrics to show project status, whether for code or requirements.

A code coverage tool makes it significantly easier to analyze the quality of test cases, allowing you to decide whether additional testing is required.

  1. Static analysis: the inspection of source code for deviations from best practices that can lead to bugs, security vulnerabilities and reliability issues.
  • Analyze code compliance with industry standards
  • Detecting runtime problems without executing code
  • Creating checkers for custom coding standards
  1. Runtime analysis: the instrumentation of monitoring and runtime execution of applications to detect ‘real’ defects at runtime.
  • Detecting runtime problems when running an application
  • Detecting runtime problems when executing unit tests
  • Performing runtime checks for cross-platform environments
  • Combining runtime analysis results with other test data

It’s not enough to report on the results of unit test automation. To quantify the quality and risk of a project, you need to bring together data across all test practices for a centralized view of quality, covering:

  • Static analysis
  • Unit and integration testing
  • Code coverage
  • Runtime analysis
  • Traceability

Parasoft DTP, the reporting and analytics dashboard for Parasoft C/C++test, provides an interactive web-based reporting capability for navigating metrics and test results, demonstrating compliance, investigating areas of concern, and implementing and enforcing project policies.

 Automating all aspects of the testing cycle helps software teams understand the true status of testing and maximize limited resources.

About Parasoft

Parasoft’s software testing solutions support the entire software development process, from when the developer writes the first line of code all the way through unit and functional testing, to performance and security testing, leveraging simulated test environments along the way. Parasoft's unique analytics platform aggregates data from across all testing practices, providing insights up and down the testing pyramid to enable organizations to succeed in today's most strategic development initiatives, including Agile/DevOps, Continuous Testing, and the complexities of IoT. Parasoft’s automated software testing innovations fuel software development organizations, helping teams reduce the time, cost, and effort of delivering high-quality software to the market.