The karyotype test is designed to rule out abnormalities in the structure and number of chromosomes, which can cause infertility or recurrent miscarriages.