Amniocentesis is a prenatal diagnostic test in which a small amount of amniotic fluid is collected from the uterus for genetic testing. The test is usually performed between 16 and 20 weeks of gestation and involves inserting a fine needle into the uterus to draw a sample of the amniotic fluid.