mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-03-14 13:06:14 +01:00
9 lines
No EOL
506 B
Text
9 lines
No EOL
506 B
Text
Il branch coverage di un insieme di test cases è la percentuale di branch del programma che sono attraversati da almeno un test case.
|
|
Si consideri la seguente funzione C:
|
|
-----------
|
|
int f(int x, int y) {
|
|
if (x - y <= 0) { if (x + y - 2>= 0) return (1); else return (2); }
|
|
else {if (2*x + y - 1>= 0) return (3); else return (4); }
|
|
} /* f() */
|
|
Si considerino i seguenti test cases: {x=1, y=1}, {x=0, y=0}, {x=1, y=0}, {x=0, y=-1}.
|
|
Quale delle seguenti è la branch coverage conseguita? |