While it's possible to determine MTF by making measurements of the images of line patterns such as those shown earlier there is a faster and easier way (if you have the necessary equipment). If you look at the image of a very sharp line, typically an illuminated slit, you can mathematically calculate the MTF of the lens. Technically what you're doing is taking the real part of the Fourier Transform of the Line Spread Function. Sounds complex and it is, but in practice it's fast and easy to do, and in fact that's the way Popular Photography tests lenses. Below are examples for a good lens (on the right) and a better lens (on the left). The sharper image of the line produced by the better lens results in a better (higher) calculated MTF
Here's a typical MTF plot for a lens showing performance for both a real and a “perfect” lens. The blue trace (a perfect lens) might correspond to the “better lens”images on the left above, while the red trace (a real lens) might correspond to the “good lens”images on the right.
This plot shows MTF decreases as a lens is stopped down and also that lens aberrations reduce MTF. It also shows why a lens often performs best around f8, where aberrations are reduced but diffraction is still not severe.
Real lenses rarely, if ever, come close to the theoretical maximum MTF at apertures below about f8 as stated above, though a few (expensive) lenses may be an exception to this rule. Performance at the maximum theoretical MTF is called "diffraction limited" performance, since diffraction is the reason why MTF falls with increasing spatial frequency, even for a "perfect" lens - thus diffraction ultimately limits the lens' performance. Below is a plot of the MTF of 6 different 50mm camera lenses from a study published in 1960. My guess is that current 50mm lenses are not all that different since 50mm lenses are fairly easy to design and even 40 years ago designs were pretty good.. The scale of the plot needs some explanation. The horizontal axis reads 0 to 1 and this is the "normalized spatial frequency". What this means is that the horizontal axis is different for each aperture. The scale expressed in lp/mm would be from 0 to approximately 1800/f, where f is the f-stop. So for the f2 trace, the scale runs from 0 to 900 lp/mm, for f4 it runs from 0 to 450 lp/mm and for f11 it runs from 0 to 164 lp/mm. By using the normalized spatial frequency you can see how the lenses perform relative to their maximum theoretical performance at each aperture. It's pretty obvious that none of these lenses comes anywhere close to diffraction limited performance wide open, and that most of them will show best results when stopped down to the f5.6 to f8 region.
Data from K. Rosenhauer and K.J.
"Die optischen Bildfehler und die Ubertragungsfunktion", Optik 17, 249-277 (1960)
Though we normally think of focusing errors as simply "blurring" the image, we can look at the effect of defocus on MTF. Below is a plot showing the MTF of a perfect, diffraction limited, f2.8 lens. Traces are shown for various amounts of defocus (measured in units of wavelengths of wavefront error). Wavefront error is simply a measure of how far the image formation is from perfect. Various aberrations, such as spherical aberration, could also be represented in terms of wavefront error and plots for such aberrations would appear somewhat similar to the traces shown.
The red region represents an MTF less than zero. In reality what this means is that black areas appear as white and white areas appear as black, so although a pattern may appear to be resolved (insofar as you may see black and white areas), in reality it isn't. Resolution above the point at which the MTF first reaches zero is known as spurious resolution. This could be the result of defocus, or other aberrations intrinsic to a particular lens design.
Resolution is the spatial frequency at which the MTF first drops to zero. So although all of the plots above show resolution (a positive MTF) at spatial frequencies of over 600 lp/mm, the lowest plot (with 1 wave of error) shows a lens with only 120lp/mm true resolution. So when lens testing visually, using optical test charts, you look for the resolution pattern just before the first one which is not resolved, not the last resolution pattern which is resolved.