Funny this thread came up. I had asked this question not too long ago of a couple of truck engineers while I was out at the test track. While yes, there's alot of legal dealings that go into the PRINTED figures, they actually do test the ability rather interestingly.
First is the straight line tests. Accelleration and braking are done to determine fall off points and acceptable levels.
Second is the fun part. They have this fancy trailer that basically can sideload the trailer hitch of the vehicle to actually try and fishtail the tow rig at 25mph, 55mph, and 70mph to see what kind of side loads the vehicle can take. They come up with some slide rule math to determine the acceptable levels and they present the data to the lawyer types that typically recommend a level somewhat below the tolerance points. I thought it was kind of neat.