there is a quote from Algorithms for Java (sedgwick 2003) p. 135: "we commonly use driver programs when developing or debugging adt iplementations" what is meant by driver program? google just gives me loads of info about programming drivers, clearly not related
4 Answers
In this context a driver program is just a program that uses the class or algorithm that you're developing. It's primarily used for testing your code while you develop it.
1A Driver program, as I understand it, is just a simple class that instantiates the overall program you have created.
In University programs, we started learning Java by making very simple Drivers, that just passed in parameters to random classes and methods.
It's simply a program designed to call various APIs and pieces of logic you are working with. E.g. if you have a library that reads XML files, does some sort of transform on it, and writes the transformed data into another file, to work with that library you create a driver program which does nothing but call those 3 APIs and does error handling - e.g. it drives/directs your API to do its work.
A driver is generally a (relatively) simple executable program designed to exercise some component that isn't directly executable, like a library or ADT or test suite, etc. For example you might have a Table class that supports reading in CSV, and supports outputting to CSV and HTML. You might write a simple program that takes on the command line the name of an input CSV file and a format to output to so you can confirm the Table class does what you expect. All the driver would do is construct an instance of the Table and read in the file and use it to write out in the specified format.