To demonstrate the difference, here is the basic form of a differential amplifier which makes up the input stage for an opamp:
Notice there are two signals input at each side. SIG and SIG_INV are a 1kHz differential input (SIG is 180° shifted in phase from SIN_INV), and SIG_COM is a 9kHz common mode input (same signal at each side referenced to ground, i.e. 0° phase difference)
These signals are both at a 10mV (20mV pk-pk) level.
Now lets have a look at the simulation:
We can see the input (referenced to ground) is the mix of both signals, but the output is only the 1kHz differential signal at roughly a gain of 100. The differential amplifier has rejected almost all of the 9kHz common mode signal.
To see exactly how much of the 9kHz signal gets through to the output, here is the simulation again with only the 9kHz signal present:
Now we can see the output is roughly 10mV pk-pk (+/-5mV), so there is a gain of 0.5. We can now calculate the CMRR as we know the differential gain is 100 and the common mode is 0.5, so 100/0.5 = 200 = 46dB.
This is not a very good ratio, but it's the most basic form of differential amplifier. An typical opamp will improve greatly on this figure by for example, using a current source instead of the common tail resistor (R3) (also other things too).
For interest's sake, I just replaced R3 with an ideal current source and this reduces the common mode output to 324uV pk-pk (for 20mV pk-pk in) so the common mode gain is 0.0162 and thus the CMRR is improved to 20 * log10 (100 / 0.0162) = ~75.8dB. A high quality opamp might reach 120dB or more.
Calculating CMRR from component values
In the differential amplifier above, we can calculate both differential gain and common mode gain pretty easily. Here are the formulas with a brief explanation:
The differential gain is:
Gdiff = Rc / (2 * (Re + re)) where Re is the emitter resistors value and re is the intrinsic emitter resistance, given by ~25mA / Ic.
So, for our circuit above, we get:
re = 25mA / 100uA = 250Ω
Gdiff = 75k / (2 * (100Ω + 250Ω)) = 107, which agrees with our simulation.
The common mode gain is given by:
Gcm = -Rc / ((2*Rtail) + Re + re) - the minus sign means the output is inverted (180° shift) Rtail is R3 in the schematic above (the differnetial pair is sometimes referred to as the "long tailed pair", so this is the "tail" resistor)
So, we get:
Gcm = -75kΩ / (2*75kΩ) + 100 Ω 250Ω) = ~-0.5, which again agrees with our simulation.
The CMRR can either be calculated using the above results, or can be calculated directly using:
20 * log10(Rtail / (Re + re)) = 20 * log10(75kΩ / (100 + 250)) = 46.6dB, which again agrees with what can can see in the simulation.
From the above formula, we can see that the ratio between the tail resistor and emitter resistor is the main factor controlling the CMRR, so using a high impedance current source improves things dramatically.
The above equations don't take everything into account (you will need to do some further reading for the more subtle effects), but get you close enough for most applications.
Best Answer
Just short-circuiting the inputs will not be possible. Usually, the small input offset voltage will be amplified by the opamp and will in most cases lead to saturation of the output.
Using a amplifier in buffer configuration reduces gain, so saturation will not happen at the output. However, it will change the output voltage as you sweep the input. Measuring the difference with the input will therefore give you the sum of the input offset voltage, a contribution due to finite gain and your figure of interest: the CMRR. So you have one more term in there. If the differential gain is much much larger than the CMRR then the approximation will be OK. But I don't think this is necessarily the case. The input offset voltage is more or less constant w.r.t. the common mode, so you can compensate for that.
When working with the differential amplifier configuration, you can add some gain to the CMRR, making the measurement more sensitive (if the resistors are matched well enough). The gain can be limited so output saturation due to an input offset voltage will likely not happen. And because the output stays close to constant, the extra term in the previous paragraph (caused by the finite gain) will also be much more limited.