Patients with specific types of cancer or with cancers that have specific genetic mutations may benefit the most from these therapies. Genetic testing and other diagnostic tools can help determine whether a patient's cancer is likely to respond to targeted therapy or immunotherapy.