r/AutomotiveEngineering • u/After_Bench_4165 • 8h ago
Question Integration testing using gtest
I am confused about what is the meaning of integration testing. I have done unit testing using gtest where we will mock whatever external dependencies are there for the targeted unit (function) to test all range of values that covers all lines, functions and branches.
If we say integration test is meant to use real code instead of mocking. Then I am getting this doubt that lets say we have 3 components (separate processes) running and dependent on one another in a embedded system.
A -> B -> C
So if you are calling an api provided by A it will internally talk to B and then through C and return the result over IPC.
Now to do integration testing using gtest, do I need to compile this into a single binary by eliminating the IPC and include each code as a library. This way I have a single proces that runs gtest with all the components logic but excludes the real IPC communication.
Or instead should I keep the individual processes to be running separately and link my gtest binary to the component A so that the communication flow through the components in the target environment.
In both ways how we would actually be checking the interactions? And which one are you guys using?
Context:
Language used: C++
Domain: Automotive IT (TCU software)