This principle can be applied to the process of checking a large routine but we will illustrate the method by means of a small routine viz. one to obtain n! ... — AM Turing, Checking a Large Routine (1949)
I don't know if this is the earliest example of fac
as a running example in CS literature, but Turing does tackle a slightly more complex problem than the modern usage:
... without the use of a multiplier, multiplication being carried out by repeated addition.