Parasoft Logo

WEBINAR

Simplify Software Testing on Target Hardware

A notable challenge for embedded safety- and security-critical systems is optimizing target-based testing methodologies to validate the accuracy of functionality, security measures, and performance parameters. Target systems exhibit distinct performance and behavior compared to their host counterparts, which can significantly influence test outcomes, highlighting the need for tailored testing procedures.

Static analysis raises code quality, while unit testing is a fundamental aspect that focuses on verifying module designs to ensure each software unit operates as intended. The meticulous collection and analysis of code coverage metrics are essential practices for safety-critical software. Code coverage serves as a metric for test case completion and execution, providing tangible evidence of validation completeness aligned with software design specifications.

Watch this webinar to learn how to perform testing on target hardware and watch a demo of Parasoft C/C++test in action.

Key Takeaways

  • Host vs. Target Testing: While testing on a host machine (like Windows or Linux) is easier and more accessible for developers, testing on target hardware is essential for meeting safety and security standards.
  • Cross-Platform Capability: Parasoft C/C++test allows you to create test configurations that can build, cross-compile, and run the same tests on various target environments, including embedded boards, simulators, or emulators.
  • Comprehensive Analysis: The tool helps verify application functionality, code robustness, captures test results, obtains code coverage metrics (statement, branch, and MC/DC), and monitors for memory problems.
  • Debugging and Reporting: It offers extensive debugging facilities and can save or send test results through different methods like serial ports, JTAG or TCP/IP.
  • Static Analysis Benefits: Static analysis can catch coding errors early. You can also suppress specific findings if they are intentional.
  • Memory Monitoring: The tool can detect memory issues like reading out of bounds or using null pointers, providing call traces to help pinpoint the exact location of the problem.
  • Unit Testing: Unit testing, combined with features like stubbing, helps increase code coverage, ensuring that even specific functions like error reporting are tested.

Understanding Target Hardware Testing

Testing on target hardware is critical because the actual performance and behavior of your software can differ significantly from a simulated environment. Parasoft C/C++test addresses this by letting developers create test configurations that can be tailored to specific target environments. This means you can compile and run your tests on the actual embedded board, a simulator, or an emulator, ensuring your software works as expected in its intended setting.

Static Analysis in Action

Static analysis is a powerful technique for improving code quality. It involves analyzing the code without actually running it. For example, Parasoft C/C++test can identify common mistakes like using an assignment operator (=) when a comparison operator (==) was intended within a logical statement. While syntactically correct, this can lead to subtle bugs. The tool flags these issues, and you can either fix them or suppress them if they are intentional, providing detailed reports on the rules being checked and any suppressions made.

Detecting Memory Issues with Application Monitoring

When your application behaves unexpectedly, like showing garbage data, it often points to memory-related problems. Parasoft C/C++test’s application monitoring feature can help diagnose these issues. By instrumenting the code and running it on the target, the tool can detect problems such as reading from a null pointer, accessing memory out of bounds, or uninitialized memory reads. It provides detailed information, including call traces, to help you trace the problem back to its source, like an incorrect array index being used.

Improving Code Coverage with Unit Testing

Unit testing focuses on verifying individual software units. Parasoft C/C++test facilitates this by allowing you to generate test cases and suites. You can even use features like stubbing to isolate the unit you want to test and control its dependencies. This is particularly useful for increasing code coverage, ensuring that all parts of your application, including error-handling functions, are tested. The tool can then report on the coverage achieved and help you identify any parts of the code that were not executed during testing.

Combining Techniques for Robust Testing

Parasoft C/C++test allows you to combine different testing techniques, such as static analysis, memory monitoring, unit testing, and code coverage within a single workflow. This integrated approach helps you catch a wider range of issues early in the development cycle. By running tests on the target hardware and analyzing the results, you can gain confidence in the reliability, safety, and security of your embedded systems.