It's fairly rare that they are test pilots, as a general rule they are experienced line / squadron / private (occasionally) pilots on type who have - because there is a need for somebody - been given special training, typically half a day to a day in the civil world, in how to fly the post maintenance / annual air test.
G