For when ‘Peel’ strategy doesn’t work, like when the difficult-to-test code is in the middle of the testable code, not at the beginning or end.
Copy a symbol next to the items on this list which might make a function difficult to test:
This picture visualizes the Slice strategy:
The function you’re trying to test has a line that is difficult to test in the middle. You can’t easily use Peel to remove it. You need to slice away the depencency and replace the hard to test call with a call to a stub or a fake.
One way to solve TirePressure is using Slice. You can also do it on ‘getScoreboard’ in IceCreamScores
What is important to remember when you add tests to code containing a call to a difficult-to-test function?