However you're defining focus I'm sure correlates pretty well with the personality trait conscientiousness. (IQ is the best single-variable predictor of nice things like life success, for various definitions of success, IQ + Conscientiousness predicts even better...)
They're not called that, but they do exist. I recently went through a full day's testing for issues relating to autism and a number of the tests related to ability to hold focus rather than skill, per se.
One I recall vividly was basically a page full of weird symbols and a "key" at the top mapping symbols to numbers. I had to go through the whole page converting the entire page and various elements of my performance (variance of speed, attention, etc.) were measured during the task. This does not really correlate to what I'd consider focus or "flow" during typical programming tasks, however, but it did try my patience! :-)