A test conducted to ascertain the accurate biological sex in cases where uncertainty exists, such as in hermaphroditism, or to assess the potential transmission of specific congenital defects to future generations. This painless procedure involves gently scraping a few cells from the inner lining of the cheek for microscopic examination.