(I'm not sure if this should go here or in ethics)
Basically alignment is a way to deal with the mechanics of a world where a being's philosophical standing has a real physical impact on the world around him.
read about alignment here.
http://en.wikipedia.org/wiki/Alignment_(Dungeons_%26_Dragons)
SRD - Alignment and Description
Character Alignment - Television Tropes & Idioms
I'd put up a sensible alignment test however none exist. For example the test on the WotC website asks if you would marry someone dreadful if your parents made you. Whoever made that question is a total dumbass.
Good and evil are pretty easy to understand as the D&D morality is objective and humanoid oriented. Anything with 3 or over points of intelligence is considered sapient and it is evil to kill them if they are not trying to hurt you. A vampire is considered evil when it feeds on humans or makes them his slaves even if he has higher mental scores.
However order and chaos couldn't be more muddled and self contradictory if they tried. Fiends are the opposed of celestials. Angels are any good and devils are lawful evil. however apparently the opposite of a robot (inevitables and modrons) is the opposite of giant disease ridden frogs (Slaad)?
Slaad are horribly ilconceived. They reproduce via infecting people with a disease which makes them evil and not chaotic. Also the slaad lords make no sense. What does entropy have to do with ethics? I thought the negative planes already covered this? Insanity? Than why doesn't the spell have the chaos descriptor? And what does mental condition have to do with ethics? And colour again colour spray is not a chaotic spell and colour is not related to ethics.
The barbarian supposedly chaotic warriors yet the spell rage lacks the chaotic descriptor, there is evil a devil that rages (they call it a frenzy though). Bards can take devoted performer to be lawful.
The blood war is the ancient battle between devils (lawful evil) and demons (chaotic evil) with the daemons (neutral evil) acting as mercenaries for either side.
I would really like for someone who has spent a long time studying ethics to provide clearer behavior patterns for each alignment and creatures composed of the essence of that alignment.