diff --git a/Ingegneria del Software/0222_24/correct.txt b/Ingegneria del Software/0222_24/correct.txt new file mode 100644 index 0000000..1e091a3 --- /dev/null +++ b/Ingegneria del Software/0222_24/correct.txt @@ -0,0 +1 @@ +90% \ No newline at end of file diff --git a/Ingegneria del Software/0222_24/quest.txt b/Ingegneria del Software/0222_24/quest.txt new file mode 100644 index 0000000..ce59bae --- /dev/null +++ b/Ingegneria del Software/0222_24/quest.txt @@ -0,0 +1,12 @@ +img=https://i.imgur.com/6m6ALRb.png +La state coverage di un insieme di test cases (cioè sequeze di inputs) per uno state diagram è la percentuale di stati (inclusi START ed END) rggiunti almeno una volta. + +Si consideri lo state diagram in figura  +ed il seguente insieme di test cases: + +1) Start PIN validation, card inserted, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2 + +2) Start PIN validation, card inserted, PIN Entered, Cancel 2, End PIN Validation 2 + + +Quale delle seguenti è la migliore stima della state coverage per i test cases di cui sopra \ No newline at end of file diff --git a/Ingegneria del Software/0222_24/wrong1.txt b/Ingegneria del Software/0222_24/wrong1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_24/wrong1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_24/wrong2.txt b/Ingegneria del Software/0222_24/wrong2.txt new file mode 100644 index 0000000..2fd674f --- /dev/null +++ b/Ingegneria del Software/0222_24/wrong2.txt @@ -0,0 +1 @@ +60% \ No newline at end of file diff --git a/Ingegneria del Software/0222_27/correct.txt b/Ingegneria del Software/0222_27/correct.txt new file mode 100644 index 0000000..1e091a3 --- /dev/null +++ b/Ingegneria del Software/0222_27/correct.txt @@ -0,0 +1 @@ +90% \ No newline at end of file diff --git a/Ingegneria del Software/0222_27/quest.txt b/Ingegneria del Software/0222_27/quest.txt new file mode 100644 index 0000000..b1548b4 --- /dev/null +++ b/Ingegneria del Software/0222_27/quest.txt @@ -0,0 +1,13 @@ +img=https://i.imgur.com/6m6ALRb.png +La state coverage di un insieme di test cases (cioè sequeze di inputs) per uno state diagram è la percentuale di stati (inclusi START ed END) rggiunti almeno una volta. + +Si consideri lo state diagram in figura  ed il seguente insieme di test cases: + +1) Start PIN validation, card inserted, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2; + +2) Start PIN validation, card inserted, PIN Entered, Invalid PIN, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2; + +3) Start PIN validation, card inserted, PIN Entered, Invalid PIN, PIN Entered, Invalid PIN, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2. + + +Quale delle seguenti è la migliore stima della state coverage per i test cases di cui sopra \ No newline at end of file diff --git a/Ingegneria del Software/0222_27/wrong1.txt b/Ingegneria del Software/0222_27/wrong1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_27/wrong1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_27/wrong2.txt b/Ingegneria del Software/0222_27/wrong2.txt new file mode 100644 index 0000000..2fd674f --- /dev/null +++ b/Ingegneria del Software/0222_27/wrong2.txt @@ -0,0 +1 @@ +60% \ No newline at end of file diff --git a/Ingegneria del Software/0222_33/correct.txt b/Ingegneria del Software/0222_33/correct.txt new file mode 100644 index 0000000..2fd674f --- /dev/null +++ b/Ingegneria del Software/0222_33/correct.txt @@ -0,0 +1 @@ +60% \ No newline at end of file diff --git a/Ingegneria del Software/0222_33/quest.txt b/Ingegneria del Software/0222_33/quest.txt new file mode 100644 index 0000000..857057e --- /dev/null +++ b/Ingegneria del Software/0222_33/quest.txt @@ -0,0 +1,45 @@ +Il partition coverage di un insieme di test cases è la percentuale di elementi della partition inclusi nei test cases. La partition è una partizione finita dell'insieme di input della funzione che si sta testando. + +Si consideri il seguente programma C: + +----------- + +#include + +#include + +#include + +#define N 5 /* number of test cases */ + +int f1(int x)  { return (2*x); } + +int main() {  int i, y; int x[N]; + + // define test cases + + x[0] = 0; x[1] = 1; x[2] = -1; x[3] = 10; x[4] = -10; + +// testing + +for (i = 0; i < N; i++) { + + y = f1(x[i]); // function under testing + + assert(y == 2*x[i]); // oracle + + } + + printf("All %d test cases passed\n", N); + + return (0);  + +} + +Si vuole testare la funzione f1(). A tal fine l'insieme degli interi viene partizionato come segue:  + +{(-inf, -21], [-20, -1], {0}, [1, 20], [21, +inf)} + +Il programma main() sopra realizza il nostro testing per la funzione f1(). I test cases sono i valori in x[i]. + +Quale delle seguenti è la partition coverage conseguita? \ No newline at end of file diff --git a/Ingegneria del Software/0222_33/wrong1.txt b/Ingegneria del Software/0222_33/wrong1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_33/wrong1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_33/wrong2.txt b/Ingegneria del Software/0222_33/wrong2.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/0222_33/wrong2.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/0222_35/correct.txt b/Ingegneria del Software/0222_35/correct.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/0222_35/correct.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/0222_35/quest.txt b/Ingegneria del Software/0222_35/quest.txt new file mode 100644 index 0000000..533f7bc --- /dev/null +++ b/Ingegneria del Software/0222_35/quest.txt @@ -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 + +#include + +#include + +#define N 1 /* number of test cases */ + +int f(int x)  { int y = 0; + +  LOOP: if (abs(x) - y <= 2) + + {return Sì ;} + + 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? \ No newline at end of file diff --git a/Ingegneria del Software/0222_35/wrong1.txt b/Ingegneria del Software/0222_35/wrong1.txt new file mode 100644 index 0000000..23e721f --- /dev/null +++ b/Ingegneria del Software/0222_35/wrong1.txt @@ -0,0 +1 @@ +50% \ No newline at end of file diff --git a/Ingegneria del Software/0222_35/wrong2.txt b/Ingegneria del Software/0222_35/wrong2.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_35/wrong2.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_39/correct.txt b/Ingegneria del Software/0222_39/correct.txt new file mode 100644 index 0000000..23e721f --- /dev/null +++ b/Ingegneria del Software/0222_39/correct.txt @@ -0,0 +1 @@ +50% \ No newline at end of file diff --git a/Ingegneria del Software/0222_39/quest.txt b/Ingegneria del Software/0222_39/quest.txt new file mode 100644 index 0000000..0e6f9c0 --- /dev/null +++ b/Ingegneria del Software/0222_39/quest.txt @@ -0,0 +1,55 @@ +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 + +#include + +#include + +#define N 4 /* number of test cases */ + + +int f(int x1, int x2) + +{ + + if (x1 + x2 <= 2) + + return (1); + + else return (2); + +} + + +int main() { int i, y; int x1[N], x2[N]; + + // define test cases + + x1[0] = 3; x2[0] = -2; x1[1] = 4; x2[1] = -3; x1[2] = 5; x2[2] = -4; x1[3] = 6; x2[3] = -5;  + + // testing + + for (i = 0; i < N; i++) { + + y = f(x1[i], x2[i]); // function under testing + + assert(y ==(x1[i], x2[i] <= 2) ? 1 : 2); // oracle + + } + + printf("All %d test cases passed\n", N); + + return (0);    + +} + +----------- + +Il programma main() sopra realizza il nostro testing per la funzione f1(). I test cases sono i valori in x1[i] ed x2[i]. + +Quale delle seguenti è la branch coverage conseguita? \ No newline at end of file diff --git a/Ingegneria del Software/0222_39/wrong1.txt b/Ingegneria del Software/0222_39/wrong1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_39/wrong1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_39/wrong2.txt b/Ingegneria del Software/0222_39/wrong2.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/0222_39/wrong2.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/0222_41/correct.txt b/Ingegneria del Software/0222_41/correct.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/0222_41/correct.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/0222_41/quest.txt b/Ingegneria del Software/0222_41/quest.txt new file mode 100644 index 0000000..77ee0c6 --- /dev/null +++ b/Ingegneria del Software/0222_41/quest.txt @@ -0,0 +1,55 @@ +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 + +#include + +#include + +#define N 4 /* number of test cases */ + + +int f(int x1, int x2) + +{ + + if (x1 + x2 <= 2) + + return (1); + + else return (2); + +} + + +int main() { int i, y; int x1[N], x2[N]; + + // define test cases + + x1[0] = 3; x2[0] = -2; x1[1] = 4; x2[1] = -3; x1[2] = 7; x2[2] = -4; x1[3] = 8; x2[3] = -5;  + + // testing + + for (i = 0; i < N; i++) { + + y = f(x1[i], x2[i]); // function under testing + + assert(y ==(x1[i], x2[i] <= 2) ? 1 : 2); // oracle + + } + + printf("All %d test cases passed\n", N); + + return (0);    + +} + +----------- + +Il programma main() sopra realizza il nostro testing per la funzione f1(). I test cases sono i valori in x1[i] ed x2[i]. + +Quale delle seguenti è la branch coverage conseguita? \ No newline at end of file diff --git a/Ingegneria del Software/0222_41/wrong1.txt b/Ingegneria del Software/0222_41/wrong1.txt new file mode 100644 index 0000000..23e721f --- /dev/null +++ b/Ingegneria del Software/0222_41/wrong1.txt @@ -0,0 +1 @@ +50% \ No newline at end of file diff --git a/Ingegneria del Software/0222_41/wrong2.txt b/Ingegneria del Software/0222_41/wrong2.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_41/wrong2.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_5/correct.txt b/Ingegneria del Software/0222_5/correct.txt new file mode 100644 index 0000000..2fd674f --- /dev/null +++ b/Ingegneria del Software/0222_5/correct.txt @@ -0,0 +1 @@ +60% \ No newline at end of file diff --git a/Ingegneria del Software/0222_5/quest.txt b/Ingegneria del Software/0222_5/quest.txt new file mode 100644 index 0000000..52b1367 --- /dev/null +++ b/Ingegneria del Software/0222_5/quest.txt @@ -0,0 +1,15 @@ +img=https://i.imgur.com/6m6ALRb.png +La transition coverage di un insieme di test cases (cioè sequeze di inputs) per uno state diagram è la percentuale di transizioni (archi nel grafo dello state diagram) percorsi almeno una volta. + +Si consideri lo state diagram in figura  + +ed il seguente insieme di test cases: + +1) Start PIN validation, card inserted, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2; + +2) Start PIN validation, card inserted, PIN Entered, Invalid PIN, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2; + +3) Start PIN validation, card inserted, PIN Entered, Invalid PIN, PIN Entered, Invalid PIN, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2. + + +Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra \ No newline at end of file diff --git a/Ingegneria del Software/0222_5/wrong1.txt b/Ingegneria del Software/0222_5/wrong1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_5/wrong1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_5/wrong2.txt b/Ingegneria del Software/0222_5/wrong2.txt new file mode 100644 index 0000000..711ba55 --- /dev/null +++ b/Ingegneria del Software/0222_5/wrong2.txt @@ -0,0 +1 @@ +40% \ No newline at end of file diff --git a/Ingegneria del Software/0222_50/correct.txt b/Ingegneria del Software/0222_50/correct.txt new file mode 100644 index 0000000..1e091a3 --- /dev/null +++ b/Ingegneria del Software/0222_50/correct.txt @@ -0,0 +1 @@ +90% \ No newline at end of file diff --git a/Ingegneria del Software/0222_50/quest.txt b/Ingegneria del Software/0222_50/quest.txt new file mode 100644 index 0000000..a3effb0 --- /dev/null +++ b/Ingegneria del Software/0222_50/quest.txt @@ -0,0 +1,14 @@ +img=https://i.imgur.com/6m6ALRb.png +La transition coverage di un insieme di test cases (cioè sequeze di inputs) per uno state diagram è la percentuale di transizioni (archi nel grafo dello state diagram) percorsi almeno una volta. + +Si consideri lo state diagram in figura ed il seguente insieme di test cases: + + +1) Start PIN validation, card inserted, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2 + +2) Start PIN validation, card inserted, PIN Entered, Valid PIN, Cancel 2, End PIN Validation 2 + +3) Start PIN validation, card inserted, PIN Entered, Invalid PIN, PIN Entered, Invalid PIN, PIN Entered, Invalid PIN, PIN Entered, Invalid PIN, More than 3 failed..., END PIN validation 1; + + +Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra \ No newline at end of file diff --git a/Ingegneria del Software/0222_50/wrong1.txt b/Ingegneria del Software/0222_50/wrong1.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/0222_50/wrong1.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/0222_50/wrong2.txt b/Ingegneria del Software/0222_50/wrong2.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_50/wrong2.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0222_7/correct.txt b/Ingegneria del Software/0222_7/correct.txt new file mode 100644 index 0000000..2fd674f --- /dev/null +++ b/Ingegneria del Software/0222_7/correct.txt @@ -0,0 +1 @@ +60% \ No newline at end of file diff --git a/Ingegneria del Software/0222_7/quest.txt b/Ingegneria del Software/0222_7/quest.txt new file mode 100644 index 0000000..97e921b --- /dev/null +++ b/Ingegneria del Software/0222_7/quest.txt @@ -0,0 +1,13 @@ +img=https://i.imgur.com/6m6ALRb.png +La transition coverage di un insieme di test cases (cioè sequeze di inputs) per uno state diagram è la percentuale di transizioni (archi nel grafo dello state diagram) percorsi almeno una volta. + +Si consideri lo state diagram in figura  + +ed il seguente insieme di test cases: + +1) Start PIN validation, card inserted, PIN Entered, Valid PIN, Cancel 3, End PIN Validation 2 + +2) Start PIN validation, card inserted, PIN Entered, Cancel 2, End PIN Validation 2 + + +Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra diff --git a/Ingegneria del Software/0222_7/wrong1.txt b/Ingegneria del Software/0222_7/wrong1.txt new file mode 100644 index 0000000..711ba55 --- /dev/null +++ b/Ingegneria del Software/0222_7/wrong1.txt @@ -0,0 +1 @@ +40% \ No newline at end of file diff --git a/Ingegneria del Software/0222_7/wrong2.txt b/Ingegneria del Software/0222_7/wrong2.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0222_7/wrong2.txt @@ -0,0 +1 @@ +80% \ No newline at end of file