Most of the things mentioned in the comments are co-factors; that is, things often found alongside greatness, but not necessarily the cause of the greatness. They are also often found alongside mediocrity.
I prefer simple tests:
Bad programmer: It can't be done.
Mediocre programmer: It's never been done.
Good programmer: It can be done.
Great programmer: It's done.