What is the purpose of the ball and string attached to the tip of the vertical fin on test aircraft?
That is a static pressure line. The "shuttlecock" device on the end pulls the line out behind the aircraft, where it can get a more accurate pressure reading, away from the air flowing around the aircraft that affects the regular pitot-static system. It will also be more accurate during flight conditions that normal aircraft rarely experience, but need to be accurately analyzed during testing. 


Cropped from this image

Static pressure has an effect on the performance of the aircraft, so during testing that is one value they want to measure accurately during flights. Once testing is complete there is no longer a need for that information, and the regular pitot-static system takes the measurements needed.

The line can be seen in this photo, and in this video, you can see the reel inside the rear of the aircraft that is used to pull in the line when it is not in use.