  Mutually unbiased bases (MUBs) constitute the canonical example of
incompatible quantum measurements. One standard application of MUBs is the task
known as quantum random access code (QRAC), in which classical information is
encoded in a quantum system, and later part of it is recovered by performing a
quantum measurement. We analyse a specific class of QRACs, known as the $2^{d}
\to 1$ QRAC, in which two classical dits are encoded in a $d$-dimensional
quantum system. It is known that among rank-1 projective measurements MUBs give
the best performance. We show (for every $d$) that this cannot be improved by
employing non-projective measurements. Moreover, we show that the optimal
performance can only be achieved by measurements which are rank-1 projective
and mutually unbiased. In other words, the $2^{d} \to 1$ QRAC is a self-test
for a pair of MUBs in the prepare-and-measure scenario. To make the
self-testing statement robust we propose measures which characterise how well a
pair of (not necessarily projective) measurements satisfies the MUB conditions
and show how to estimate these measures from the observed performance.
Similarly, we derive explicit bounds on operational quantities like the
incompatibility robustness or the amount of uncertainty generated by the
uncharacterised measurements. For low dimensions the robustness of our bounds
is comparable to that of currently available technology, which makes them
relevant for existing experiments. Lastly, our results provide essential
support for a recently proposed method for solving the long-standing existence
problem of MUBs.
