Ben Brocka makes many fine points. Insanity is a legal definition and what constitutes insanity will vary state to state, even jurisdiction to jurisdiction. What makes sanity so hard to quantify is the fact that so often, in a forensic setting, it comes down to the discretion of a jury of one's peers or the Court to accept or deny insanity as an explanation for a specific instance of behaviors. Laypeople (persons who are not mental health professionals) bring their personal understanding and definition of insanity to the determination process, at least minimally on an unconscious level, and these are strong biases on which to predicate an untarnished, comprehensive determination of sanity, or lack thereof.
Almost always, the establishment of sanity focuses on this general question: Did the individual understand at the time he/she was committing a crime that what he/she was doing was wrong under the law? This may seem basic and obvious, but it's not.
You wanted to know which specific tests or evaluation criteria might be used in determining sanity. I can speak only from a forensic point-of-view, based on my experiences in my state.
The determination of sanity will almost always start with a comprehensive psychological or psychiatric assessment. It is at this level that the presence of underlying Axis I criteria -- mental illness, substance use disorders, learning disorders -- and Axis II -- typically personality and intellectual/learning symptoms (and note that learning disorders and intellectual dysfunctions are not the same thing) -- disorders are determined.
During this process, a person's General Assessment of Functioning, or GAF, score is determined. This score is used as a general indicator of a person's ability to function in society and maintain self-efficacy. The lower the score, the lower a person's abilities are seen; however, note that this is not an intelligence assessment.
Intelligence testing may be part of the process of determining sanity. Tests frequently used are the Woodcock-Johnson, the Weschler (adult and child versions), and the Stanford-Binet.
A substance abuse evaluation often occurs at this point; there are tons of testing instruments for substance abuse assessment, and the criteria examined from a forensic point-of-view is less focused on the individual than on community safety.
Psychological assessment is similar to psychological testing but usually involves a more comprehensive assessment of the individual. Psychological assessment is a process that involves the integration of information from multiple sources, such as tests of normal and abnormal personality, tests of ability or intelligence, tests of interests or attitudes, as well as information from personal interviews. Collateral information is also collected about personal, occupational, or medical history, such as from records or from interviews with parents, spouses, teachers, or previous therapists or physicians. A psychological test is one of the sources of data used within the process of assessment; usually more than one test is used.* (CITATION)
Before diagnosing a psychological disorder, Clinicians must study the themes, also known as abnormalities, within psychological disorders. The most prominent themes consist of: deviance, distress, dysfunction and danger. These themes are known as the 4 D's, which define abnormality. (CITATION)
Other specific tests used might include the MMPI or the MMPI-II, the PCL-R (Hare). How can psychology be measured objectively? First, I think it's important to understand that a thorough psych assessment is like a snapshot of the big picture. You cannot measure the properties of a person as you might a rock, but the testing instruments are highly highly specialized, and should take into account an individual's willingness to report their symptoms and history accurately and honestly (which is different than being unable to self-report due to mental illness or another factor). In other words, psychological and forensic tests have 'lie scales,' which gives the assessor a comparison point -- how open is the subject being in relation to the overall picture put together from not only test scores and information, but also collateral information?
It is extraordinarily difficult to successfully malinger to the trained eye. For example, I had an individual under my supervision who had successfully avoided offender accountability for years because he maintained he was illiterate. He made the mistake of emptying his pockets on my desk; there was a Lotto card among his items -- it was a crossword puzzle Lotto card, where a person had to write the words in (as opposed to scratching the letters out from a pre-printed card). A person who is not genuinely mentally ill, learning disabled, or intellectually challenged cannot continuously keep up the ruse, because they don't know what it really feels like to have any of those conditions, and eventually they make a mistake.