Genetic testing can identify mutations in the BRCA1 and BRCA2 genes. This involves providing a blood, saliva, or cheek swab sample for DNA analysis. Genetic counseling is often recommended both before and after testing to help individuals understand the implications of the test results.