Question: Question 2: (15 Marks) a. Write minimum test cases for statement coverage b. Write minimum test cases for branch coverage c. Find the cyclomatic complexity

Question 2: (15 Marks) a. Write minimum test cases for statement coverage b. Write minimum test cases for branch coverage c. Find the cyclomatic complexity of the graph using all the formulas we studied in class. d. Identify a set of basis paths for the graph and write its test cases. void main() { 1. float A,B,C; 2. clrscr(); 3. printf("Enter number 1: "); 4. scanf("%f", &A); 5. printf("Enter number 2: "); 6. scanf("%f", &B); 7. printf("Enter number 3: "); 8. scanf("%f", &C); 9. if(A>B) { 10. if(A>C) { 11. printf("The largest number is: % ",A); } else { 13. printf("The largest number is: %f ",C); } } 14. else { 15. if(C>B) { 16. printf("The largest number is: % ",C); } 17. else { 18. printf("The largest number is: % ",B); } } 19. getch(); } 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
