number of executed statements
-------------------------------
total number of statements
print_sum(int a, int b) {
int result = a + b;
if (result > 0) {
println("%s", "red");
} else if (result < 0) {
println("%s", "blue");
}
}
Input:
a = 3, b = 9Coverage:
7 / 9 = 77.8%
✅ print_sum(int a, int b) {
✅ int result = a + b;
✅
✅ if (result > 0) {
✅ println("%s", "red");
❌ } else if (result < 0) {
❌ println("%s", "blue");
✅ }
✅ }
Input:
a = -5, b = -8Coverage:
8 / 9 = 88.9%
✅ print_sum(int a, int b) {
✅ int result = a + b;
✅
✅ if (result > 0) {
❌ println("%s", "red");
✅ } else if (result < 0) {
✅ println("%s", "blue");
✅ }
✅ }
