I always thought this was a process that had to be done by hand. Enter netselect.
# apt-get install netselect netselect-apt
# netselect-apt testing
After issuing those two commands, you will have in the current directory a sources.list suitable for adding to /etc/apt/sources.list to replace the existing mirrors in there. Netselect automatically determines the server with the best network conditions, taking all the work out of it.