HIV test
HIV tests are used to detect the presence of the human immunodeficiency virus in serum, saliva, or urine. Such tests may detect HIV antibodies, antigens, or RNA.

# Terminology
The window period is the time from infection until a test can detect any change. The average window period with antibody tests is 22 days. Antigen testing cuts the window period to approximately 16 days and NAT (Nucleic Acid Testing) further reduces this period to 12 days.
Performance of medical tests is often described in terms of:
- sensitivity: The percentage of the results that will be positive when HIV is present
- specificity: The percentage of the results that will be negative when HIV is not present.
All diagnostic tests have limitations, and sometimes their use may produce erroneous or questionable results.
- False positive results are when the test concludes HIV is present when, in fact, the person is not infected.
- False negative results are when the test concludes HIV is not present, when in fact the person is infected.
Nonspecific reactions, hypergammaglobulinemia, or the presence of antibodies directed to other infectious agents that may be antigenically similar to HIV can produce false positive results.  Autoimmune diseases, such as systemic lupus erythematosus, can also cause false positive results.

# Principles

## Screening donor blood and cellular products
Tests selected to screen donor blood and tissue must provide a high degree of confidence that HIV is not present (that is, a high sensitivity). A combination of antibody, antigen and nucleic acid tests are used by blood banks in Western countries. The World Health Organization estimated that, as of 2000, inadequate blood screening had resulted in 1 million new HIV infections worldwide.
In the USA, most blood donations are screened with an ELISA test for HIV-1 and HIV-2, as well as a nucleic acid test. These diagnostic tests are combined with careful donor selection. As of 2001, the risk of transfusion-acquired HIV in the U.S. was approximately one in 2.5 million for each transfusion.

## Diagnosis of HIV infection
Tests used for the diagnosis of HIV infection in a particular person require a high degree of both sensitivity and specificity. In the United States, this is achieved using an algorithm combining two tests for HIV antibodies. If antibodies are detected by an initial test based on the ELISA method, then a second test using the Western blot procedure determines the size of the antigens in the test kit binding to the antibodies. The combination of these two methods is highly accurate (see below).

## Human rights
The UNAIDS/WHO policy statement on HIV Testing states that conditions under which people undergo HIV testing must be anchored in a human rights approach that pays due respect to ethical principles. According to these principles, the conduct of HIV testing of individuals must be
- Confidential;
- Accompanied by counseling (for those who test positive);
- Conducted with the informed consent of the person being tested.

# Antibody tests
HIV antibody tests are specifically designed for routine diagnostic testing of adults; these tests are inexpensive and extremely accurate.

## Window period
Antibody tests may give false negative results during the window period, an interval of three weeks to six months between the time of HIV infection and the production of measurable antibodies to HIV (so-called seroconversion). Most people develop detectable antibodies approximately 30 days after infection, although some seroconvert later. The vast majority of people (99%) have detectable antibodies by three months after HIV infection; a six-month window is extremely rare with modern antibody testing. During the window period, an infected person can transmit HIV to others although their HIV infection may not be detectable with an antibody test. Antiretroviral therapy during the window period can delay the formation of antibodies and extend the window period beyond 12 months. Antibody tests may also yield false negative results in patients with X-linked agammaglobulinemia; other diagnostic tests should be used in such patients.
Three instances of delayed HIV seroconversion occurring in Health-care workers have been reported; in these instances, the Health-care workers  tested negative for HIV antibodies greater than 6 months postexposure but were seropositive within 12 months after the exposure. DNA sequencing confirmed the source of infection in one instance. Two of the delayed seroconversions were associated with simultaneous exposure to hepatitis C virus (HCV). In one case, co-infection was associated with a rapidly fatal HCV disease course; however, it is not known whether HCV directly influences the risk for or course of HIV infection or is a marker for other exposure-related factors.

## ELISA
The ELISA test, or the enzyme immunoassay (EIA), was the first screening test commonly employed for HIV. It has a high sensitivity.
In an ELISA test, a person's serum is diluted 400-fold and applied to a plate to which HIV antigens have been attached. If antibodies to HIV are present in the serum, they may bind to these HIV antigens. The plate is then washed to remove all other components of the serum.  A specially prepared "secondary antibody"  an antibody that binds to human antibodies  is then applied to the plate, followed by another wash.  This secondary antibody is chemically linked in advance to an enzyme.  Thus the plate will contain enzyme in proportion to the amount of secondary antibody bound to the plate.  A substrate for the enzyme is applied, and catalysis by the enzyme leads to a change in color or fluorescence. ELISA results are reported as a number; the most controversial aspect of this test is determining the "cut-off" point between a positive and negative result.

## Western blot
In the Western blot procedure, cells that may be HIV-infected are opened and the proteins within are placed into a slab of gel, to which an electrical current is applied. Different proteins will move with different velocities in this field, depending on their size, while their electrical charge is leveled by a surfactant called sodium lauryl sulfate. Once the proteins are well-separated, they are transferred to a membrane and the procedure continues similar to an ELISA: the person's diluted serum is applied to the membrane and antibodies in the serum may attach to some of the HIV proteins. Antibodies which do not attach are washed away, and enzyme-linked antibodies with the capability to attach to the person's antibodies determine to which HIV proteins the person has antibodies.
There are no universal criteria for interpreting the Western blot test: the number of viral bands which must be present may vary.  If no viral bands are detected, the result is negative. If at least one viral band for each of the GAG, POL, and ENV gene-product groups are present, the result is positive. The three-gene-product approach to Western blot interpretation has not been adopted for public health or clinical practice. Tests in which less than the required number of viral bands are detected are reported as indeterminate: a person who has an indeterminate result should be retested, as later tests may be more conclusive. Almost all HIV-infected persons with indeterminate Western-Blot results will develop a positive result when tested in one month; persistently indeterminate results over a period of six months suggests the results are not due to HIV infection. In a generally healthy low-risk population, indeterminate results on Western blot occur on the order of 1 in 5,000 patients.

## Rapid or point-of-care tests
Rapid Antibody Tests are qualitative immunoassays intended for use as a point-of-care test to aid in the diagnosis of HIV infection. These tests should be used in conjunction with the clinical status, history, and risk factors of the person being tested. The specificity of Rapid Antibody Tests in low-risk populations has not been evaluated. These tests should be used in appropriate multi-test algorithms designed for statistical validation of rapid HIV test results.
If no antibodies to HIV are detected, this does not mean the person has not been infected with HIV. It may take several months after HIV infection for the antibody response to reach detectable levels, during which time rapid testing for antibodies to HIV will not be indicative of true infection status. A comprehensive risk history and clinical judgement should be considered before concluding that an individual is not infected with HIV.
OraQuick is an antibody test that provides results in 20 minutes. The blood, plasma or oral fluid is mixed in a vial with developing solution, and the results are read from a sticklike testing device.
Orasure is an HIV test which uses mucosal transudate from the tissues of cheeks and gums. It is an antibody test which first employs ELISA, then Western Blot.
There is also a urine test; it employs both the ELISA and the Western Blot method.
Home Access Express HIV-1 Test is a FDA-approved home test: the patient collects a drop of blood and mails the sample to a laboratory; results and counseling are obtained over the phone.
There have been a number of cases of fraudulent tests being sold via mail order or the Internet to the general public. In 1997, a California man was indicted on mail fraud and wire charges for selling supposed home test kits. In 2004, the US Federal Trade Commission asked Federal Express and US Customs to confiscate shipments of the Discreet home HIV test kits, produced by Gregory Stephen Wong of Vancouver, BC. In February 2005, the US FDA issued a warning against using the rapid HIV test kits and other home use kits marketed by Globus Media of Montreal Canada.

## Interpreting antibody tests
ELISA testing alone cannot be used to diagnose HIV, even if the test suggests a high probability that antibody to HIV-1 is present. In the United States, such ELISA results are not reported as "positive" unless confirmed by a Western Blot.
The ELISA antibody tests were developed to provide a high level of confidence that donated blood was NOT infected with HIV. It is therefore not possible to conclude that blood rejected for transfusion because of a positive ELISA antibody test is in fact infected with HIV. Sometimes, retesting the donor in several months will produce a negative ELISA antibody test. This is why a confirmatory Western Blot is always used before reporting a "positive" HIV test result.
False positive results due to factors unrelated to exposure to HIV are found more often with the ELISA test than with the Western Blot. False positives can be caused by antibodies to viruses other than HIV, antibodies produced by pregnancy, and other medical conditions such as recent acute illnesses, influenza vaccinations and allergies. A false positive result does not indicate a condition of significant risk to health. When the ELISA test is combined with Western Blot, the rate of false positives is extremely low, and diagnostic accuracy is very high (see below).

## Accuracy of HIV testing
The evidence regarding the risks and benefits of HIV screening was reviewed in July 2005 by the U.S. Preventive Services Task Force. The authors concluded that:
...the use of repeatedly reactive enzyme immunoassay followed by confirmatory Western blot or immunofluorescent assay remains the standard method for diagnosing HIV-1 infection. A large study of HIV testing in 752 U.S. laboratories reported a sensitivity of 99.7% and specificity of 98.5% for enzyme immunoassay, and studies in U.S. blood donors reported specificities of 99.8% and greater than 99.99%. With confirmatory Western blot, the chance of a false-positive identification in a low-prevalence setting is about 1 in 250 000 (95% CI, 1 in 173 000 to 1 in 379 000).
Other studies have confirmed the accuracy of current methods of HIV testing in the United States, reporting false-positive rates of 0.0004% to 0.0007% and false-negative rates of 0.003% in the general population.

# Antigen tests
The p24 antigen test detects the presence of the p24 protein of HIV (also known as CA), a major core protein of the virus. Monoclonal antibodies specific to the p24 protein are mixed with the person's blood. Any p24 protein in the person's blood will stick to the monoclonal antibody and enzyme-linked antibody to the monoclonal antibodies to p24 causes a color change if p24 was present in the sample.
This test is no longer used routinely in the US or the EU  to screen blood donations since the objective was to reduce the risk of false negatives in the window period.  Nucleic acid testing (NAT) is more effective for this purpose, and p24 antigen testing is no longer indicated if a NAT test is performed.  The p24 antigen test is not useful for general diagnostics, as it has very low sensitivity and only works during a certain time period after infection before the body produces antibodies to the p24 protein.

# Nucleic acid based tests (NAT)
Nucleic-acid-based tests amplify and detect a 142-base target sequence located in a highly conserved region of the HIV gag gene . Since 2001, donated blood in the United States has been screened with nucleic-acid-based tests, shortening the window period between infection and detectability of disease to about 12 days. Since these tests are relatively expensive, the blood is screened by first pooling some 10-20 samples and testing these together; if the pool tests positive, each sample is retested individually. A different version of this test is intended for use in conjunction with clinical presentation and other laboratory markers of disease progress for the management of HIV-1-infected patients.
In the RT-PCR test, viral RNA is extracted from the patient's plasma and is treated with reverse transcriptase so that the RNA of the virus is transcribed into DNA. The polymerase chain reaction (PCR) is then applied, using two primers thought to be unique to the virus's genome. After the PCR amplification process is complete, the resulting amplified segments bind to specific oligonucleotides bound to the vessel wall and are then made visible with a probe bound to an enzyme. The amount of virus in the sample can be quantified with sufficient accuracy to detect three-fold changes.
In the Quantiplex bDNA or branched DNA test, plasma is centrifugated to concentrate the virus, which is then opened to release its RNA. Special oligonucleotides are added which bind to viral RNA and to certain oligonucleotides bound to the wall of the vessel. In this way, viral RNA is fastened to the wall. Then new oligonucleotides are added which bind at several locations to this RNA; and other oligonucelotides which bind at several locations to those oligonucleotides. This is done to amplify the signal. Finally, oligonucleotides that bind to the last set of oligonucleotides and that are bound to an enzyme are added; the enzyme action causes a color reaction which allows quantification of the viral RNA in the original sample. Monitoring the effects of antiretroviral therapy by serial measurements of plasma HIV-1 RNA with this test has been validated for patients with viral loads greater than 25,000 copies per milliliter.

# Other tests used in HIV/AIDS treatment
The CD4 T-cell count is not an HIV test, but rather a procedure where the number of CD4 T-cells in the blood is determined.
A CD4 count does not check for the presence of HIV. It is used monitor immune system function in HIV-positive people. Declining CD4 T-cell counts are considered to be a marker of progression of HIV infection. In HIV-positive people, AIDS is officially diagnosed when the count drops below 200 cells/L or when certain opportunistic infections occur. This use of a CD4 count as an AIDS criterion was introduced in 1992; the value of 200 was chosen because it corresponded with a greatly increased likelihood of opportunistic infection. Lower CD4 counts in people with AIDS are indicators that prophylaxis against certain types of opportunistic infections should be instituted.
Low CD4 T-cell counts are associated with a variety of conditions, including many viral infections, bacterial infections, parasitic infections, sepsis, tuberculosis, coccidioidomycosis, burns, trauma, intravenous injections of foreign proteins, malnutrition, over-exercising, pregnancy, normal daily variation, psychological stress, and social isolation.
This test is also used occasionally to estimate immune system function for people whose CD4 T cells are impaired for reasons other than HIV infection, which include several blood diseases, several genetic disorders, and the side effects of many chemotherapy drugs.
Generally speaking, the lower the number of T cells, the lower the immune system's function will be.  Normal CD4 counts are between 500 and 1500 CD4+ T cells/microliter, and the counts may fluctuate in healthy people depending on recent infection status, nutrition, exercise and other factors. Women tend to have somewhat lower counts than men.

# Criticisms of HIV tests
HIV tests have been criticized by a number of AIDS dissidents (people who reject the scientific consensus that HIV causes AIDS), including the Perth Group of scientists (led by Eleni Papadopulos-Eleopulos) who question the very existence of HIV. Their arguments rest on issues of specificity, standardisation, reproducibility, and validation.
According to scientific consensus, the accuracy of serologic testing has been verified by isolation and culture of HIV and by detection of HIV RNA by PCR, which are widely accepted "gold standards" in microbiology. While the AIDS dissidents focus on individual components of HIV testing, it is generally believed that the combination of ELISA and Western Blot used for the diagnosis of HIV is remarkably accurate, with very low false-positive and -negative rates as described above. The vast majority of scientists believe that the views of AIDS dissidents are based on highly selective analysis of mostly outdated scientific papers; there is broad scientific consensus that HIV is the cause of AIDS.