We will begin to test the logic for the box packing line, using the Suspend instruction to isolate sections of the program.
- To test the sizing logic for detection of small boxes only, we will set the value of N7:2 to 1 so that the program will suspend after detecting and counting a series of small boxes.
- We will set the value of N7:2 in Rung 2 to zero in order to disable the first suspend instruction. Then, we will move to rung 4 of the program and enable the second suspend instruction by setting N7:2 to a value of 2.
By using suspend and temporary end statements that are enabled by integer values that can be changed online, the program testing can occur one section at a time.
It may be apparent that thinking about the testing strategy during program development can help the programmer decide how to structure the program to make it easier to test.