Scientists have developed a new test to determine which cystic fibrosis treatment is best suited to an individual patient.