Sensitivity is calculated as the number of true positives divided by the sum of true positives and false negatives. Specificity is calculated as the number of true negatives divided by the sum of true negatives and false positives. These metrics are often presented in a confusion matrix, which helps visualize the test's performance.