1. Generate the test cases for the following code with statement testing, branch testing and path testing. Describe the
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
1. Generate the test cases for the following code with statement testing, branch testing and path testing. Describe the
1. Generate the test cases for the following code with statement testing, branch testing and path testing. Describe the procedures in test case generation. //This program is supposed to calculate the sum from //m to n (inclusive). If n is smaller than m, switch //them first. The following code is not tested yet. #include<stdio.h> int main() { int i = 1, sum 0; int m, n, temp; scanf("%d%d", &m, n); if (m>n) { temp-n; n - m; m-temp; } i = m; while (i<n) { sum += i; i++; } printf ("sum %d\n", sum); return 0;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!