I am new to unit testing, just getting into it using Check for C.
This is a question of unit testing theory. Let's say (because it is true) that I have a module of code that formats messages to and from a serial protocol. I have another module which implements a state machine sending and receiving those messages.
I am starting to write unit tests for the message send and parse functions, and plan to write tests for the state machine too. In each case I use mocks/stubs to fake out the other module (apologies if I am misusing any unit testing buzzwords here).
Is it also considered a good idea to test the two modules together? So I would build the real state machine with the real protocol engine, drive it with wire-level messages and see if the appropriate state transitions and messages came out.
In theory this would already be covered by the individual tests, though..
Looking for some general clues, don't have enough experience to have a feel for this yet.