diff --git a/Ingegneria del Software/0000_102/correct.txt b/Ingegneria del Software/0000_102/correct.txt new file mode 100644 index 0000000..6613ca3 --- /dev/null +++ b/Ingegneria del Software/0000_102/correct.txt @@ -0,0 +1 @@ +(a=100, b=false, c=true), (a=90, b=true, c=false) \ No newline at end of file diff --git a/Ingegneria del Software/0000_102/quest.txt b/Ingegneria del Software/0000_102/quest.txt new file mode 100644 index 0000000..e13f059 --- /dev/null +++ b/Ingegneria del Software/0000_102/quest.txt @@ -0,0 +1,20 @@ +Una Condition è una proposizione booleana, cioè una espressione con valore booleano che non può essere decomposta in espressioni boolean più semplici. Ad esempio, (x + y <= 3) è una condition. + +Una Decision è una espressione booleana composta da conditions e zero o più operatori booleani. Ad esempio, sono decisions: +(x + y <= 3) +((x + y <= 3) || (x - y > 7)) + +Un insieme di test T soddisfa il criterio di Condition/Decision coverage se tutte le seguenti condizioni sono soddisfatte: + +1) Ciascun punto di entrata ed uscita nel programma è eseguito in almeno un test; +2) Per ogni decision d nel programma, per ogni condition c in d, esiste un test in T in cui c è true ed un test in T in cui c è false. +3) Per ogni decision d nel programma, esiste in test in T in cui d è true ed un test in T in cui d è false. + +Si consideri la seguente funzione: + +int f(int a, bool b, bool c) +{ if ( (a == 100) && (b || c) ) + { return (1); } + else { return (2);} +} +Quale dei seguenti test set soddisfa il criterio della Condition/Decision coverage? \ No newline at end of file diff --git a/Ingegneria del Software/0000_102/wrong1.txt b/Ingegneria del Software/0000_102/wrong1.txt new file mode 100644 index 0000000..9e9ca26 --- /dev/null +++ b/Ingegneria del Software/0000_102/wrong1.txt @@ -0,0 +1 @@ +(a=100, b=false, c=false), (a=90, b=true, c=true) \ No newline at end of file diff --git a/Ingegneria del Software/0000_102/wrong2.txt b/Ingegneria del Software/0000_102/wrong2.txt new file mode 100644 index 0000000..2a2414b --- /dev/null +++ b/Ingegneria del Software/0000_102/wrong2.txt @@ -0,0 +1 @@ +(a=100, b=false, c=true), (a=90, b=false, c=true) \ No newline at end of file diff --git a/Ingegneria del Software/0000_2/correct.txt b/Ingegneria del Software/0000_2/correct.txt new file mode 100644 index 0000000..23e721f --- /dev/null +++ b/Ingegneria del Software/0000_2/correct.txt @@ -0,0 +1 @@ +50% \ No newline at end of file diff --git a/Ingegneria del Software/0000_2/quest.txt b/Ingegneria del Software/0000_2/quest.txt new file mode 100644 index 0000000..c5fe9fb --- /dev/null +++ b/Ingegneria del Software/0000_2/quest.txt @@ -0,0 +1,57 @@ +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] = 5; x2[0] = -2; x1[1] = 6; 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/0000_2/wrong1.txt b/Ingegneria del Software/0000_2/wrong1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/0000_2/wrong1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/0000_2/wrong2.txt b/Ingegneria del Software/0000_2/wrong2.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/0000_2/wrong2.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/0000_4/correct.txt b/Ingegneria del Software/0000_4/correct.txt new file mode 100644 index 0000000..998dfca --- /dev/null +++ b/Ingegneria del Software/0000_4/correct.txt @@ -0,0 +1 @@ +Customers should be closely involved throughout the development process. \ No newline at end of file diff --git a/Ingegneria del Software/0000_4/quest.txt b/Ingegneria del Software/0000_4/quest.txt new file mode 100644 index 0000000..7d22084 --- /dev/null +++ b/Ingegneria del Software/0000_4/quest.txt @@ -0,0 +1 @@ +Which of the following is an agile principle? \ No newline at end of file diff --git a/Ingegneria del Software/0000_4/wrong1.txt b/Ingegneria del Software/0000_4/wrong1.txt new file mode 100644 index 0000000..b34acfc --- /dev/null +++ b/Ingegneria del Software/0000_4/wrong1.txt @@ -0,0 +1 @@ +Customers should just provide requirements and verify them when the project is completed. \ No newline at end of file diff --git a/Ingegneria del Software/0000_4/wrong2.txt b/Ingegneria del Software/0000_4/wrong2.txt new file mode 100644 index 0000000..9cfa092 --- /dev/null +++ b/Ingegneria del Software/0000_4/wrong2.txt @@ -0,0 +1 @@ +Customers should not interfere with the software development. \ No newline at end of file