Diagnostic testing is used when uncertainties persist after the history and physical examination, particularly when the diseases remaining under consideration are serious or have dangerous or costly treatment.