In my project, am using TPT as the testing environment and we using model based testing. The code coverage is normally comes around 80%. But the customer requires a 100% cover coverage and so want to use .c and .h files for testing.
I am new to this type of testing, as we only did model based testing. May I know how to use TPT in terms of code based testing?
C-code as well as Simulink models can be tested using TPT. There is no difference in the test development but only in the test execution environment. For testing C-code one can decide if the C-code shall be tested in the so called SiL-mode in Simulink where the C-Code is embedded in Simulink as so called S-function. The generation of the S-function can be doen automatically by m-scripts dependent of the code generator.
Alternatively in TPT C-code can be tested in two ways. The first is using the so called EXE-platform where a test harness is build in C-code and to be compiled by the user by its own compiler. The second alternative is the so called FUSION platform where the user writes an interface that fits a well definid API to its system under test and compiles it as dll. This dll is simulated at the FUISON.
If 100% statement or condition coverage is required TPT comes with a feature called TASMO. TASMO generates test cases automatically to fulfill a maximum of coverage of a Simulink or TargetLink model.
I’m one of the TPT developer. For further information about TPT you can visit our website.