  In the device-independent approach to quantum information theory, quantum
systems are regarded as black boxes which, given an input (the measurement
setting), return an output (the measurement result). These boxes are then
treated regardless of their actual internal working. In this paper, we develop
SWAP, a theoretical concept which, in combination with the tool of
semi-definite methods for the characterization of quantum correlations, allows
us to estimate physical properties of the black boxes from the observed
measurement statistics. We find that the SWAP tool provides bounds orders of
magnitude better than previously-known techniques (e.g.: for a CHSH violation
larger than 2.57, SWAP predicts a singlet fidelity greater than 70%). This
method also allows us to deal with hitherto intractable cases such as robust
device-independent self-testing of non-maximally entangled two-qutrit states in
the CGLMP scenario (for which Jordan's Lemma does not apply) and the
device-independent certification of entangled measurements. We further apply
the SWAP method to relate nonlocal correlations to work extraction and quantum
dimensionality, hence demonstrating that this tool can be used to study a wide
variety of properties relying on the sole knowledge of accessible statistics.
