The pap smear is done to detect cervical cancer. The test is done by checking the cell sample collected from the cervix.