Applying the principles of ecology and evolution could help oncologists anticipate cancer drug resistance and optimize their treatment plans for patients.