Testing how a unit of code interacts with its environment When testing a unit of code you need to both observe how the unit of code is interacting with the outside world and also control how the world interacts with it. In a particuarly simple example, you might want to check that when an adder function is given a 2 and a 4 then it returns a 6. In this case you’re controlling what the System Under Test (SUT) pulls in from its environment (the 2 and the 4) and also observing what it pushes o...