No medical test can indicate the presence of OCD, as is the case with bodily ailments. However, psychological measurements such as the Yale-Brown Obsessive-Compulsive Scale can aid in the diagnosis. Psychologists and psychiatrists usually rely to varying extents on the psychologist's bible of disorders and symptomology, the Diagnostic and Statistical Manual of Mental Disorders (DSM IV-TR), published by the American Psychiatric Association. This manual outlines the behaviors and symptoms which must be present in order for an individual to receive a diagnosis of OCD. To summarize, these criteria include:
The presence of either obsessions or compulsions (or both).
The awareness of individual that his or her obsessions and/or compulsions are excessive or unreasonable.
The obsessions or compulsions cause distress, consume significant amounts of time (more than one hour daily), or impair functioning in the home, workplace, or socially.
The content of obsessions or compulsions is not related to another disorder (for example, persistent thoughts of drugs would not be counted as a symptom of OCD if the individual had already been diagnosed with the Substance Abuse Disorder).
The disorder is not related to intake of substances such as drugs or medication or to a medical condition.
The detailed list of criteria from the DSM is available here.
Self-reports are also sometimes used as an aid in diagnosis. Several different measures can be used, including the aforementioned Yale-Brown Obsessive Compulsive Checklist and Scale (Y-BOCS), the Maudsley Obsessional Compulsive Inventory (MOCI), the Padua Inventory (PI), and the Compulsive Activity Checklist. However, perhaps the best way to diagnose OCD is through a clinical interview (which may in itself employ some of the above measures) that is, a session with a clinician in which one may discuss behavior, thoughts and history.
While you may recognize some of your own behaviors in the DSM criteria above, only a licensed mental health professional can give you a proper diagnosis. If you suspect you have OCD, it is avisable to seek the counsel of a mental health professional as soon as possible.
Trained clinicians can use interviews specifically tailored to the guidelines present in the Diagnostic and Statistical Manual of Mental Disorders to evaluate and diagnose individuals.