You are making a simple but common mistake: Target selectors must not have spaces. In fact, most arguments must not have spaces.
I.e. your command should be
/testfor @a[x=X,y=Y,z=Z,r=RADIUS,name=NAME]
The reason for that is that Minecraft's command parsing algorithm simply splits commands at spaces to evaluate the arguments of the command. For that reason, only very few arguments allow for spaces, and these will always be the last argument of the command. [dataTag]
is the most common case of these.
Looking at the syntax, /testfor <player> [dataTag]
, what happens with your command is that the game sees @a[x=X,
as <player>
, and y=Y, z=Z, r=RADIUS, name=NAME]
as [dataTag]
, which is rubbish and caused the command to fail.