Test programs are fragment of code, but, unlike ordinary application programs, they are not intended to solve a problem, nor to calculate a function. Instead, they are supposed to give information about the machine that actually executes them. Today, the need for effective test programs is increasing, and, due to the inexorable increase in the number of transistor that can be integrated onto a single silicon die, devising effective test programs is getting more problematical. This paper presents µGP, an efficient and versatile approach to test-program generation based on an evolutionary algorithm. The proposed methodology is highly versatile and improves previous approaches, allowing the test-program generator generating complex assembly programs that include subroutines calls.