Consolidate repeated unit test setup code into helper functions
In the CF unit tests, the "preconditions" for each test case are often very similar, but instead of being set up through some sort of helper function, the code is cut-and-pasted. As a result, code to set up for particular preconditions may be repeated dozens of times in the unit test.
This incurs a significant maintenance cost when the FSW data structures need to change in any way (and they will, the FSW is not set in stone and will need to be maintained). A small change to FSW can affect many different unit test cases. This wouldn't be a big problem if the setup was in some sort of helper function, but since it is repeated, each affected case must be individually found and fixed. As a result, the time cost of maintaining the unit test is extremely high.
To reduce this cost, common sequences of setup (such as setting up for an input PDU, an output PDU, etc) should be consolidated into a helper function, so only this function needs to change if the internal FSW structures change.