  PSR J1012+5307, a millisecond pulsar in orbit with a helium white dwarf (WD),
has been timed with high precision for about 25 years. 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 VLBI (very long
baseline interferometry) astrometry results spanning approximately 2.5 years
for PSR J1012+5307, obtained with the Very Long Baseline Array as part of the
MSPSRPI 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 $0.83^{+0.06}_{-0.02}$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
$\kappa_D=(-1.7\pm1.7)\times 10^{-4}$ and the fractional time derivative of
Newton's gravitational constant $\dot{G}/G = -1.8^{\,+5.6}_{\,-4.7}\times
10^{-13}\,{\rm yr^{-1}}$ in the local universe. As the uncertainties of the
observed decays of orbital period for the four leading pulsar-WD systems become
negligible in $\approx10$ years, the uncertainties for $\dot{G}/G$ and
$\kappa_D$ will be improved to $\leq1.5\times10^{-13}\,{\rm yr^{-1}}$ and
$\leq1.0\times10^{-4}$, respectively, predominantly limited by the distance
uncertainties.
