Abstract PSR J1012+5307, a millisecond pulsar in orbit with a helium white dwarf (WD), has been timed with high precision for about 25 yr. One of the main objectives of this long-term timing is to use the large asymmetry in gravitational binding energy between the neutron star and the WD to test gravitational theories. Such tests, however, will be eventually limited by the accuracy of the distance to the pulsar. Here, we present very long baseline interferometry (VLBI) astrometry results spanning approximately 2.5 yr for PSR J1012+5307, obtained with the Very Long Baseline Array as part of the project. These provide the first proper motion and absolute position for PSR J1012+5307 measured in a quasi-inertial reference frame. From the VLBI results, we measure a distance of kpc (all the estimates presented in the abstract are at 68% confidence) for PSR J1012+5307, which is the most precise obtained to date. Using the new distance, we improve the uncertainty of measurements of the unmodeled contributions to orbital period decay, which, combined with three other pulsars, places new constraints on the coupling constant for dipole gravitational radiation and the fractional time derivative of Newton’s gravitational constant in the local universe. As the uncertainties of the observed decays of orbital period for the four leading pulsar-WD systems become negligible in ≈10 yr, the uncertainties for and κ D will be improved to ≤1.5 × 10−13 yr−1 and ≤1.0 × 10−4, respectively, predominantly limited by the distance uncertainties.