Test Solutions for C and C++
VectorCAST/C++ is a highly automated unit and integration test solution used by embedded developers to validate safety and business critical embedded systems. This dynamic test solution is widely used in the avionics, medical device, automotive, industrial controls, railway, and financial industries.
What is VectorCAST/C++?
Unit and Integration Testing for C and C++
VectorCAST/C++ is an integrated software test solution that significantly reduces the time, effort, and cost associated with testing C and C++ software components necessary for validating safety and mission-critical embedded systems. VectorCAST/C++ helps efficiently create unit tests and integration tests for C and C++ code to ensure it works properly prior to release in less time and at a lower cost.
VectorCAST/C++ Coded Tests allows developers to author test cases directly in code using the xUnit framework. This feature simplifies the setup and teardown of tests and improves the sharing of objects between tests, offering a seamless complement to the existing VectorCAST Test Editor. With the Test Editor, the software automatically generates a complete test harness in a data-driven way, which avoids recompiling the test driver for each update of test cases or data modifications. This dual approach caters to traditional and code-centric testing methodologies, providing flexibility and efficiency in the testing process.
Advantages
- Complete test-harness construction for unit and integration testing
- Test execution from GUI or scripts
- Code coverage analysis
- Regression Testing
- Code complexity calculation
- Automatic test creation based on decision paths
- User-defined tests for requirements-based testing
- Test execution trace and playback capabilities to debug code
- Integrations with best of breed requirements traceability tools
- Supports Agile and Test Driven Development Methods
Highlights
The key features of VectorCAST for C and C++ unit and integration testing include:
- Supports C++11, C++14, C++17, and C++ 20
- Supports a Wide Range of Compilers, Simulators, and Processor Architectures
- Eliminates Need to Build Test Drivers and Stubs Manually
- Integrated Code Coverage Capabilities, including MC/DC
- Supports Host, Simulator, or Embedded Target Testing
- Automates Regression Testing
- User Configurable Compiler Interface
- Supports DO-178 (Avionics), ISO 26262 (Automotive), IEC 61508 (Industrial), IEC 62304 (Medical), EN 50128, and EN 50657 (Rail)
- Supports Windows and Linux Platforms
- Full Command Line Interface
How it Works
Why VectorCAST/C++ for C and C++ Unit Testing?
Software component testing typically demands significant resources, with at least one line of test code required for every line of C or C++ code tested. This manual creation of test frameworks involving stubs, mocks, drivers, and test data can be costly and inefficient as engineers must write and debug both the application and test codes. VectorCAST/C++ transforms this process by automatically generating the mocking framework, allowing component testing to proceed without manually writing test code. This automation liberates engineers to focus on building comprehensive test cases, debugging, and finalizing the application. Unit testing with VectorCAST/C++ is streamlined through an intuitive interface where users select inputs and expected results for the unit under test (UUT). It also supports adding test-specific user code, such as teardown procedures, and includes features for C++ mocking, like initializing test cases to create and set up objects via class constructors.
How it Works (cont..)
Integrated Code Coverage
Without a code coverage tool, it is difficult to determine which portions of your source code have been exercised during testing. VectorCAST/C++ provides an integrated code coverage utility that allows you to gauge the effectiveness of your component testing by reporting on the source code statements or decision points exercised during individual or multiple test runs. Code coverage data can also be shared with VectorCAST/QA to produce combined coverage reports that reflect unit, integration, and system testing. Because VectorCAST/QA can also provide code coverage from your existing CPPUnit, GoogleTest or other unit testing frameworks, a complete view of code coverage across all phases of testing and all testing tools is possible. This aggregated code coverage can provide actionable insight into where testing efforts should focus. This is particularly effective when code coverage data is generated using VectorCAST/QA on legacy code, which doesn't have a formal unit test suite.
Testing is Repeatable
Since VectorCAST provides an automated C and C++ unit testing framework that doesn't have to be manually maintained, you can use it to make repeat testing more efficient. You can use your VectorCAST/C++ test project as a test runner to automatically rerun the test cases against the latest version of your C or C++ source files. These tests are easily executable against successive versions of your code. The management of test execution and the cataloging of test results are automatic. Comparing results of the same test cases against new software versions, prior to system integration is easy, with clearly outlined results, organized by date, time, unit and test names. This reporting results in fewer surprises caused by “one small change” to a software component. This is essential for companies wishing to develop software using a continuous integration and test process.
Supports Integration Testing
Multiple units can be tested in a single VectorCAST/C++ test environment. The VectorCAST/C++ unit test framework allows you to create complex test cases and scenarios that stimulate multiple functions across multiple units. Thorough integration testing is necessary for simulating real-world scenarios and ensuring proper functionality. Integration testing with VectorCAST/C++ allows dependencies to be stubbed or to be included as real code.
Data Capture and Control Flow
VectorCAST/C++ supports the use of Probe Points, which allow for run-time changes to data or control flow to support testing. This allows the test case to automatically drive the code down a hard-to-reach path. Asserts can also be used to capture the state of the code at a specific point in time. When the assert is evaluated during test execution, an event is logged in in the Execution Results report along with whether the assert was true or false. Probe points can also be used on function exit to add custom teardown code.
Compiler Integration
VectorCAST/C++ automatically compiles and links all of its generated test harness components using your compiler. An interface to your compiler’s debugger is also provided so that you can run test cases under the control of the debugger, making it easier to debug issues.
Test-Driven Development (TDD)
VectorCAST/C++ supports Agile and Test Driven Development methodologies. Once the design is complete, you can focus on test case development. This allows you to construct all unit tests based simply on the header files, prior to developing any application code. Early in this process, unit tests will fail due to the absence of source code. However, with the incremental development of code for individual units, the unit tests will begin to pass as less stubs or mocks and more real code is used. After this process, the unit test suite can be regression tested automatically.
Embedded Target Testing
VectorCAST/C++, when used in conjunction with VectorCAST RSP, allows C and C++ unit testing directly on your embedded target system. VectorCAST RSP is integrated with your specific cross compiler and RTOS, making it the perfect tool for testing real-time applications. Test cases may be developed in a host environment and then re-executed on an embedded target to verify real-world target and cross-compiler performance. This ability to compile and run the software executable in a real-world environment helps build confidence in the application.
Integrations
VectorCAST/C++ is designed to work with your existing software development toolchain and build system. You can build your software using common development environments like Windows Visual Studio, cmake or Github, allowing you to work based on already established workflows. Better yet, your test projects are executable in multiple environments and VectorCAST/C++ will use the compiler, operating system, and hardware appropriate for that environment. This means you can use VectorCAST/C++ for both host-based development testing, using Visual Studio for instance, as well as testing in your final embedded hardware target environment. This provides real-world testing scenarios that ensure the best possible functionality for your software. Python scripts can also be used to integrate VectorCAST with other tools in your development environment.
Data API and Reporting
VectorCAST/C++ has a compete data API that allows you to build your own custom reports. The data API also allows advanced customization of VectorCAST via the development of Python scripts that provide advanced analysis based on the VectorCAST data. Some reports are also available in xml format including the Probe Points Report which produces a list of probe points which can be parsed and passed to a third party tool managing the probe points.
Product Installers
Please see the VectorCAST Downloads Page or visit the Download Center to access all the VectorCAST Product Installers.
News
Events
Webinar Recordings
Product Descriptions
| Item | Document |
| Fact Sheet | |
| White Paper | Using VectorCAST/C++ with Test Driven Development (PDF) |
Compilers, Hardware, Debuggers and Simulators
VectorCAST supports C, C++ and Ada compilers. VectorCAST is user-configurable to match your development toolchain including hardware and simulators.
Questions?
Let's talk about your use cases. I will be happy to support you in finding the right solution.
Jeffrey Fortin
VectorCAST Expert