If the ideal gas law $PV=nRT$ is not enough, as a second approximation the van der Waals equation
$$\left(P+a\frac{n^2}{V}\right)\left(V-nb\right)=nRT$$
is applied. The constants $a$ and $b$ are van der Waals constants which take into account some of the attraction and repulsion that the ideal gas law does not.
Solving for $P$,
$$P=\frac{nRT}{V-nb}-a\frac{n^2}{V^2}$$
and plugging it into the definition formula of compression factor $Z$ yields $$Z=\frac{V_{m,real}}{(RT)/P}=\frac{V_{real}}{(nRT)/P}=\frac{V_{real}}{V-nb}-a\frac{nV_{real}}{RTV^2}.$$
This result, supposedly, helps in the measuring of constants $a$ and $b$. But how is it really done? What are the more rigorous definitions of the constants?