  Binaries harbouring millisecond pulsars enable a unique path to determine
neutron star masses: radio pulsations reveal the motion of the neutron star,
while that of the companion can be characterised through studies in the optical
range. PSR J1012+5307 is a millisecond pulsar in a 14.5-h orbit with a
helium-core white dwarf companion. In this work we present the analysis of an
optical spectroscopic campaign, where the companion star absorption features
reveal one of the lightest known white dwarfs. We determine a white dwarf
radial velocity semi-amplitude of K_2 = 218.9 +- 2.2 km/s, which combined with
that of the pulsar derived from the precise radio timing, yields a mass ratio
of q=10.44+- 0.11. We also attempt to infer the white dwarf mass from
observational constraints using new binary evolution models for extremely
low-mass white dwarfs, but find that they cannot reproduce all observed
parameters simultaneously. In particular, we cannot reconcile the radius
predicted from binary evolution with the measurement from the photometric
analysis (R_WD=0.047+-0.003 Rsun). Our limited understanding of extremely
low-mass white dwarf evolution, which results from binary interaction,
therefore comes as the main factor limiting the precision with which we can
measure the mass of the white dwarf in this system. Our conservative white
dwarf mass estimate of M_WD = 0.165 +- 0.015 Msun, along with the mass ratio
enables us to infer a pulsar mass of M_NS = 1.72 +- 0.16 Msun. This value is
clearly above the canonical 1.4 Msun, therefore adding PSR J1012+5307 to the
growing list of massive millisecond pulsars.
