It is possible to do a sperm test. People usually just want to confirm if a stain they have found is sperm or not. In cases of suspected infidelity, it might even be worth considering an infidelity DNA test with the suspected sperm sample. There is also home male fertility test, but this is not related to the article.
There is what is known as a semen detection test. This test has nothing to do with DNA- it is much cheaper and less reliable to begin with. Detecting sperm involves detecting certain proteins which are found specifically in sperm. The semen detection test can sometimes give false positive results- in other words, the test result will confirm that sperm is present but in actual fact, it is not sperm at all. Unfortunately, this error is especially frequent when you choose to do a sperm test with your own home kit.
Under lab conditions a sperm testing is more reliable. This is because the laboratory scientists will actually run two tests. The two tests are not the same.
If you want to do an infidelity DNA test with the sperm sample then you must discuss sending the sample first. This test will involve actually mapping a DNA profile from the sperm sample (assuming it is actually sperm); once you have this profile you can send in another sample from the person you suspect this semen stain might have come- if the profiles match, it means that the DNA belongs to the same person.
On the other hand, you might not be sure the stain you found is sperm- perhaps it might be bodily fluids belonging to a female. The test can again detect whether the sample sent in contains the DNA of a male or female.
A sperm test can refer to either a test simply to detect semen presence or a test that actually maps DNA profiles.