I may not follow you exactly, but it’s usual to have some kind of input file with sample test data and expected outcomes. This may be CSV, Excel, or wiki for example. For an old school example of driving tests this way, look into Fitnesse. It looks like there’s a similar and newer project, Gauge, that might be worth a look as well–I have no experience with this one. Hope it helps!