By looking at a method, is there a rule or a way in which we can determine the statement coverage (or the number of tests) that would be required for a method?
int v(int c, int d) {
if (c>d) {
return c;
}
int x=0;
for (int i=c;i<=d;++i) {
if (i%2==0) {
x+=c;
}
x+=c;
}
return x;
}
Aucun commentaire:
Enregistrer un commentaire