I know the so-called textbook definition of unit tests and integration tests. What I am curious about is when it is time to write unit tests… I will write them to cover as many sets of classes as possible.
For example, if I have a
Word class, I will write some unit tests for the
Word class. Then, I begin writing my
Sentence class, and when it needs to interact with the
Word class, I will often write my unit tests such that they test both
Word… at least in the places where they interact.
Have these tests essentially become integration tests because they now test the integration of these 2 classes, or is it just a unit test that spans 2 classes?
In general, because of this uncertain line, I will rarely actually write integration tests… or is my using the finished product to see if all the pieces work properly the actual integration tests, even though they are manual and rarely repeated beyond the scope of each individual feature?
Am I misunderstanding integration tests, or is there really just very little difference between integration and unit tests?