You can get tested at the Autism research unit They test a urine sample for problems with gluten and casein. I don't think they claim it to be 100% but it seems to be reliable from talking to friends (by which I mean those who had a negative result and tried the diet anyway- I include a friend who tried ot for a year!- saw absolutely no difference- whilst those who had a positive saw a difference within days).
The diet isn't all that simple though as you also need to avoid sources of glutamate and other things as well, so you need to avoid, MSG, apartame, yeast extract, sorbitol. It's also extremely strict on the gluten- no gluten at all. Foods are allowed to be labelled gluten free if they contain under 1% guten but children who need the diet are often far more sensitive than coeliacs so you really have to check everything.
On the other hand its trial and error- if you look at allergy induced autism you will get lots of helpful info. OTOH they are VERY strict- we are not as strict with the diet as my son just doesn't eat enough (he also isn't casein free- tried it twice saw no difference - but I think AiA would pass out at that! )
Ds1 was absolutely away with the fairies yesterday evening, had no idea what had got into him. Still spaced this morning. Found out today that he'd been making biscuits yesterday at school- so he was elbow deep in flour. Luckily they knew not to give him one to eat or he would have been screaming for hours today. Now personally I'd rather he did that (as it seems to just space him out for 24 hours) than missed out.
If you don't want to get the test done you can just try the diet- if its going to work it works very quickly ime. Sunderland say it can take a while, but everyone I know has seen a difference within a week.
RexandBen's little boy is gfcf as well I think.