Diagnosis of taeniasis typically involves the identification of tapeworm segments or eggs in the stool. For cysticercosis, imaging techniques such as MRI and CT scans are used to detect cysts in tissues. Serological tests can also detect antibodies against Taenia solium, aiding in the diagnosis of cysticercosis.