m4r is a modified version of the classic GNU m4 macro processor whose purpose is to facilitate the automatic generation of unlimited quantities of randomized textual material which obeys a user-specified context-free grammar. The primary application of m4r is the automatic generation of test inputs for other computer programs.

In this role, m4r may be useful for automatically generating unlimited quantities of input test cases for almost any type of computer program that accepts user inputs. Note however that since the output of m4r (like GNU m4 itself) is composed of plain ASCII text, users wishing to use m4r to simulate random streams of other types of interactive input, in particular mouse movements and mouse clicks, may find it necessary to employ an external post-processor to convert the textual output of m4r to input data streams of the desired type.

While m4r can be used to generate randomized input test cases for testing virtually any type of computer program or automated system, it is most useful for generating input test cases for programs that require user inputs to be expressed using a particular context-free grammar. Examples of such programs are abundant in the world of computing, and include programs ranging from the trivial (e.g. the classical UNIX dc(1) desk calculator and bc(1) bench calculator programs) to the complex (e.g. command shell processors and compilers).

To learn about the specialized macro processing extensions implemented within m4r, please click on the extensions button at the left. To see examples of m4r usage, click on examples.

m4r is free software covered by the GNU General Public License (GPL). Please familiarize yourself with the GPL terms and conditions before downloading m4r.