I'm working on an algorithm that's split up into multiple parts, each of which performs different tasks but is more or less separate from the others, by which I mean the only interaction between the parts is the passage of a single piece of data from one part to the next like a conveyor belt. I was doing some unit tests for the algorithm and I was wondering, is it a bad idea to use the same tests cases to test each part of the algorithm?
I thought it might be a good idea at first, since it saves me having to rewrite a whole new set of test cases for each step in the algorithm, but as I got further into it I realized some parts of the algorithm were more specific to certain tasks than others.
For example, one step in the algorithm reads a file and spits out a set of strings, which is then used by a later step in the algorithm to produce another set of completely different objects. Should separate tests be designed to specifically test the integrity of this first step?
Another thing that turned me off to the idea of using the same tests cases for multiple steps in the algorithm is that the output of one step might be complete gibberish to the step proceeding it. So a test case could pass for one step in the algorithm, but fail in the next step because despite the fact that the previous step was able to correctly parse the input data, the output is unusable to the next step.
tl;dr should the same tests be used for all the steps in an algorithm?
EDIT (In response to possible duplicate): From what I can tell, that question doesn't seem to be asking about a linear algorithm (like the conveyor belt model I described above), it seems instead to be talking about combining data from multiple individual non-contiguous components. It's also not asking about whether or not the same tests should be used for all steps.