Genetic testing helps in identifying mutations that increase the risk of developing certain cancers. For example, mutations in the BRCA1 and BRCA2 genes are strongly linked to an increased risk of breast and ovarian cancers. Genetic testing can be particularly useful for individuals with a family history of cancer, allowing for early detection and preventive measures.