Can somebody tell me or direct me to where i may find a way of doing a script that checks the output from programs compared to scripts.

Can somebody give me an example of a script code that would test a program
or would someone be able to direct me to where i might be able to find some info on this...
thanks