C/C++ code Testing
Testing C/C++ code with TPT
C and C++ code can be easily tested with TPT. Testing C or C++ code is possible for module and integration tests. Every piece of C/C++ code — small, big, or even integrated SW builds — can be tested with TPT. TPT masters your software tests and greatly simplifies creation, management, maintenance and analysis of tests.
By default, TPT supports lots of common C or C++ code features and even less frequently used ones. For special requests TPT is also flexible enough for manual tweaks. TPT masters your C and C++ tests — and you save time to focus on your product development.
Testing C and C++ code with TPT. How it works.
Test setup and execution of C or C++ code with TPT is easy. You only have to select your C/C++ sources and make a few configurations. TPT does the rest – if you like – fully automated in the background. The test harness that connects the C or C++ code with TPT will be generated automatically by TPT or can also be built manually. Its your choice.
C/C++ code analysis | Functional Test case design |
---|---|
TPT analyzes the structure of your C or C++ code automatically. It extracts all data types, variables and functions to get all the interface information of the system under test. TPT handles scalar variables, arrays, multidimensional arrays, structs, pointers, maps, curves and class instances. Even fix point scaling is easily managed by TPT so that the tester operates with natural physical values.
Function calls and function stubs are also supported and generated by TPT allowing the user to control their return values and arguments. The task scheduling with one or many C functions makes testing of your code very easy and flexible. |
Test cases can be modeled with TPT manually as functional test cases. TPT supports many awesome techniques for modeling tests. TPT test case design is very natural and intuitive including reactive closed loop testing, signal and parameter descriptions, measurement data playback and much more. Test structuring makes it simple to read for maintainability. It is really easy to create and easy to maintain tests for C or C++ code. |
Structural test case design (TASMO)
For C and C++ code you can even generate test cases automatically. If you need test cases that meet certain coverage criteria such as Condition Coverage or Decision Coverage, TPT offers a technology — called TASMO — to generate suitable test cases at the push of a button. You just select the desired coverage criteria and TASMO searches for the test cases for you. TASMO generates a minimum number of test cases automatically that lead to a maximum structural coverage of your C or C++ code. The generated test cases can also be used for back-to-back regression tests and can be merged with your functional test cases.
Tutorial: Testing C-Code
- create test cases and run them
- set up the Executable Platform as test environment
- compile an executable from the C/C++ code
- insert information about channels, parameters and the like into TPT