Generate test cases for the following code by using Basic Path
Testing.
void sort(int a[ ],int N)
{ int i,j,p,t;
for(i=0;i<N-1;i++)
{ p=i;
for(j=i+1;j<N;j++)
if(a[j]>a[p])
p=j;
if(p!=i)
{ t=a[p]; a[p]=a[i]; a[i]=t; }
}
}
a) Draw CFG.
b) How many basic paths
for the CFG?
c) List the basic
paths.
d) Generate test cases
from it.
Answer-
Get Answers For Free
Most questions answered within 1 hours.