mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-05-06 16:19:38 +02:00
Refactor repo structure
This commit is contained in:
parent
36ac339086
commit
8fc89fbc03
1732 changed files with 3812 additions and 67 deletions
1
Data/Questions/ingsw/0222_35/correct.txt
Normal file
1
Data/Questions/ingsw/0222_35/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
100%
|
52
Data/Questions/ingsw/0222_35/quest.txt
Normal file
52
Data/Questions/ingsw/0222_35/quest.txt
Normal file
|
@ -0,0 +1,52 @@
|
|||
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 il seguente programma C:
|
||||
|
||||
-----------
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#define N 1 /* number of test cases */
|
||||
|
||||
int f(int x) { int y = 0;
|
||||
|
||||
LOOP: if (abs(x) - y <= 2)
|
||||
|
||||
{return ;}
|
||||
|
||||
else {y = y + 1; goto LOOP;}
|
||||
|
||||
} /* f() */
|
||||
|
||||
int main() { int i, y; int x[N];
|
||||
|
||||
// define test cases
|
||||
|
||||
x[0] = 3;
|
||||
|
||||
// testing
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
|
||||
y = f(x[i]); // function under testing
|
||||
|
||||
assert(y == (abs(x[i]) <= 2) ? 0 : (abs(x[i]) - 2)); // oracle
|
||||
|
||||
}
|
||||
|
||||
printf("All %d test cases passed\n", N);
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
-----------
|
||||
|
||||
Il programma main() sopra realizza il nostro testing per la funzione f(). I test cases sono i valori in x1[i] ed x2[i].
|
||||
|
||||
Quale delle seguenti è la branch coverage conseguita?
|
1
Data/Questions/ingsw/0222_35/wrong1.txt
Normal file
1
Data/Questions/ingsw/0222_35/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
50%
|
1
Data/Questions/ingsw/0222_35/wrong2.txt
Normal file
1
Data/Questions/ingsw/0222_35/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
80%
|
Loading…
Add table
Add a link
Reference in a new issue