diff --git a/Ingegneria del Software/1/quest.txt b/Ingegneria del Software/1/quest.txt deleted file mode 100644 index 1d28ae0..0000000 --- a/Ingegneria del Software/1/quest.txt +++ /dev/null @@ -1,3 +0,0 @@ -Si consideri il seguente requisito: -RQ: Durante l'esecuzione del programma (cioè per tutti gli istanti di tempo positivi) la variabile x è sempre nell'intervallo [0, 5]. -Quale dei seguenti monitor meglio descrive il requisito RQ? \ No newline at end of file diff --git a/Ingegneria del Software/1122_1/correct.txt b/Ingegneria del Software/1122_1/correct.txt new file mode 100644 index 0000000..fd39f0f --- /dev/null +++ b/Ingegneria del Software/1122_1/correct.txt @@ -0,0 +1,44 @@ +
+block FSA // Finite State Automaton + +/* connector declarations outside this block: +connector InputInteger = input Integer; +connector OutputInteger = output Integer; +*/ + + +InputInteger u; // external input +OutputInteger x; // state +parameter Real T = 1; + + +algorithm + + +when initial() then +x := 0; + + +elsewhen sample(0,T) then + + +if (pre(x) == 0) and (pre(u) == 1) then x := 1; +elseif (pre(x) == 0) and (pre(u) == 2) then x := 1; +elseif (pre(x) == 1) and (pre(u) == 0) then x := 2; +elseif (pre(x) == 1) and (pre(u) == 1) then x := 4; +elseif (pre(x) == 1) and (pre(u) == 2) then x := 3; +elseif (pre(x) == 2) and (pre(u) == 0) then x := 0; +elseif (pre(x) == 2) and (pre(u) == 2) then x := 4; +elseif (pre(x) == 3) and (pre(u) == 0) then x := 0; +elseif (pre(x) == 3) and (pre(u) == 1) then x := 2; +elseif (pre(x) == 3) and (pre(u) == 2) then x := 4; +elseif (pre(x) == 4) and (pre(u) == 0) then x := 3; +elseif (pre(x) == 4) and (pre(u) == 1) then x := 1; +elseif (pre(x) == 4) and (pre(u) == 2) then x := 1; +else x := pre(x); // default +end if; + + +end when; +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_1/quest.txt b/Ingegneria del Software/1122_1/quest.txt new file mode 100644 index 0000000..df0e6be --- /dev/null +++ b/Ingegneria del Software/1122_1/quest.txt @@ -0,0 +1,2 @@ +img=https://i.imgur.com/jS97TUd.png +Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura? \ No newline at end of file diff --git a/Ingegneria del Software/1122_1/wrong 1.txt b/Ingegneria del Software/1122_1/wrong 1.txt new file mode 100644 index 0000000..febcca9 --- /dev/null +++ b/Ingegneria del Software/1122_1/wrong 1.txt @@ -0,0 +1,77 @@ +
+block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 1; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 3; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 3; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 1; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_1/wrong 2.txt b/Ingegneria del Software/1122_1/wrong 2.txt new file mode 100644 index 0000000..94279c9 --- /dev/null +++ b/Ingegneria del Software/1122_1/wrong 2.txt @@ -0,0 +1,67 @@ +
+block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 3; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 1; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_10/correct.txt b/Ingegneria del Software/1122_10/correct.txt new file mode 100644 index 0000000..e940faa --- /dev/null +++ b/Ingegneria del Software/1122_10/correct.txt @@ -0,0 +1,5 @@ +int f(in x, int y) +{ +assert( (x >= 0) && (y >= 0) && ((x > 3) || (y > 3)) ); +..... +} \ No newline at end of file diff --git a/Ingegneria del Software/1122_10/quest.txt b/Ingegneria del Software/1122_10/quest.txt new file mode 100644 index 0000000..c939cfb --- /dev/null +++ b/Ingegneria del Software/1122_10/quest.txt @@ -0,0 +1,7 @@ +Pre-condizioni, invarianti e post-condizioni di un programma possono essere definiti usando la macro del C assert() (in
+block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 2; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 3; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 3; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 0; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_12/wrong 1.txt b/Ingegneria del Software/1122_12/wrong 1.txt new file mode 100644 index 0000000..c737a86 --- /dev/null +++ b/Ingegneria del Software/1122_12/wrong 1.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/0yWuing.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_12/wrong 2.txt b/Ingegneria del Software/1122_12/wrong 2.txt new file mode 100644 index 0000000..27b6d1e --- /dev/null +++ b/Ingegneria del Software/1122_12/wrong 2.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/AmIbYTU.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_13/correct.txt b/Ingegneria del Software/1122_13/correct.txt new file mode 100644 index 0000000..f2bb2d0 --- /dev/null +++ b/Ingegneria del Software/1122_13/correct.txt @@ -0,0 +1 @@ +0.12 \ No newline at end of file diff --git a/Ingegneria del Software/1122_13/quest.txt b/Ingegneria del Software/1122_13/quest.txt new file mode 100644 index 0000000..d57a552 --- /dev/null +++ b/Ingegneria del Software/1122_13/quest.txt @@ -0,0 +1,8 @@ +img=https://i.imgur.com/pBLLwD1.png +Un processo software può essere rappesentato con uno state diagram in cui gli stati rappresentano le fasi (e loro iterazioni) del prcoesso software e gli archi le transizioni da una fase all'altra. Gli archi sono etichettati con le probabilità della transizione e gli stati sono etichettati con il costo per lasciare lo stato. + +Ad esempio lo state diagram in figura rappresenta un processo software con 2 fasi F1 ed F2. F1 ha costo 10000 EUR ed F2 ha costo 1000 EUR. F1 ha una probabilita dello 0.4 di dover essere ripetuta (a causa di errori) ed F2 ha una probabilità 0.2 di dover essere ripetuta (a causa di errori). + +Uno scenario è una sequenza di stati. + +Qual è la probabilità dello scenario: 1, 3, 4? In altri terminti, qual è la probabilità che non sia necessario ripetere la seconda fase (ma non la prima)? \ No newline at end of file diff --git a/Ingegneria del Software/1122_13/wrong 1.txt b/Ingegneria del Software/1122_13/wrong 1.txt new file mode 100644 index 0000000..b7bbee2 --- /dev/null +++ b/Ingegneria del Software/1122_13/wrong 1.txt @@ -0,0 +1 @@ +0.32 \ No newline at end of file diff --git a/Ingegneria del Software/1122_13/wrong 2.txt b/Ingegneria del Software/1122_13/wrong 2.txt new file mode 100644 index 0000000..2a47a95 --- /dev/null +++ b/Ingegneria del Software/1122_13/wrong 2.txt @@ -0,0 +1 @@ +0.08 \ No newline at end of file diff --git a/Ingegneria del Software/1122_14/correct.txt b/Ingegneria del Software/1122_14/correct.txt new file mode 100644 index 0000000..97f2744 --- /dev/null +++ b/Ingegneria del Software/1122_14/correct.txt @@ -0,0 +1,19 @@ +
+#define n 1000 +int TestOracle1(int *A, int *B) +{ +int i, j, D[n]; +//init + +for (i = 0; i < n; i++) D[i] = -1; + +// B is ordered +for (i = 0; i < n; i++) { for (j = i+1; j < n; j++) {if (B[j] < B[i]) {retun (0);}}} +// B is a permutation of A +for (i = 0; i < n; i++) { for (j = 0; j < n; j++) {if ((A[i] == B[j]) && (D[j] == -1)) {C[i][j] = 1; D[j] = 1; break;} + +for (i = 0; i < n; i++) {if (D[i] == -1) return (0);} +// B ok +return (1); +} +\ No newline at end of file diff --git a/Ingegneria del Software/1122_14/quest.txt b/Ingegneria del Software/1122_14/quest.txt new file mode 100644 index 0000000..bd20578 --- /dev/null +++ b/Ingegneria del Software/1122_14/quest.txt @@ -0,0 +1,7 @@ +Un test oracle per un programma P è una funzione booleana che ha come inputs gli inputs ed outputs di P e ritorna true se e solo se il valore di output di P (con i dati inputs) è quello atteso dalle specifiche. + +Si consideri la seguente specifica funzionale per la funzione f. + +La funzione f(int *A, int *B) prende come input un vettore A di dimensione n ritorna come output un vettore B ottenuto ordinando gli elementi di A in ordine crescente. + +Quale delle seguenti funzioni è un test oracle per la funzione f? \ No newline at end of file diff --git a/Ingegneria del Software/1122_14/wrong 1.txt b/Ingegneria del Software/1122_14/wrong 1.txt new file mode 100644 index 0000000..189d31d --- /dev/null +++ b/Ingegneria del Software/1122_14/wrong 1.txt @@ -0,0 +1,29 @@ +
+#define n 1000 + +int TestOracle2(int *A, int *B) + +{ + +int i, j, D[n]; + +//init + +for (i = 0; i < n; i++) D[i] = -1; + +// B is ordered + +for (i = 0; i < n; i++) { for (j = i+1; j < n; j++) {if (B[j] < B[i]) {retun (0);}}} + +// B is a permutation of A + +for (i = 0; i < n; i++) { for (j = 0; j < n; j++) {if ((A[i] == B[j]) && (D[j] == -1)) {C[i][j] = 1; break;} + +for (i = 0; i < n; i++) {if (D[i] == -1) return (0);} + +// B ok + +return (1); + +} +\ No newline at end of file diff --git a/Ingegneria del Software/1122_14/wrong 2.txt b/Ingegneria del Software/1122_14/wrong 2.txt new file mode 100644 index 0000000..4a9e2c8 --- /dev/null +++ b/Ingegneria del Software/1122_14/wrong 2.txt @@ -0,0 +1,29 @@ +
+#define n 1000 + +int TestOracle3(int *A, int *B) + +{ + +int i, j, D[n]; + +//init + +for (i = 0; i < n; i++) D[i] = -1; + +// B is ordered + +for (i = 0; i < n; i++) { for (j = i+1; j < n; j++) {if (B[j] < B[i]) {retun (0);}}} + +// B is a permutation of A + +for (i = 0; i < n; i++) { for (j = 0; j < n; j++) {if (A[i] == B[j]) {C[i][j] = 1; D[j] = 1; break;} + +for (i = 0; i < n; i++) {if (D[i] == -1) return (0);} + +// B ok + +return (1); + +} +\ No newline at end of file diff --git a/Ingegneria del Software/1122_15/correct.txt b/Ingegneria del Software/1122_15/correct.txt new file mode 100644 index 0000000..1a8a508 --- /dev/null +++ b/Ingegneria del Software/1122_15/correct.txt @@ -0,0 +1 @@ +State coverage: 50% \ No newline at end of file diff --git a/Ingegneria del Software/1122_15/quest.txt b/Ingegneria del Software/1122_15/quest.txt new file mode 100644 index 0000000..0d7fe08 --- /dev/null +++ b/Ingegneria del Software/1122_15/quest.txt @@ -0,0 +1,12 @@ +img=https://i.imgur.com/mMq2O4x.png +La state coverage di un insieme di test cases (cioè sequenze di inputs) per uno state diagram è la percentuale di stati (inclusi START ed END) raggiunti almeno una volta. + +Si consideri lo state diagram in figura +Si consideri il seguente insieme di test cases: + +Test case 1: act1 act2 act0 + +Test case 2: act0 act1 act0 act0 + +Test case 3: act1 act0 act2 act2 act0 +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/1122_15/wrong 1.txt b/Ingegneria del Software/1122_15/wrong 1.txt new file mode 100644 index 0000000..d4625fd --- /dev/null +++ b/Ingegneria del Software/1122_15/wrong 1.txt @@ -0,0 +1 @@ +State coverage: 100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_15/wrong 2.txt b/Ingegneria del Software/1122_15/wrong 2.txt new file mode 100644 index 0000000..973ef63 --- /dev/null +++ b/Ingegneria del Software/1122_15/wrong 2.txt @@ -0,0 +1 @@ +State coverage: 75% \ No newline at end of file diff --git a/Ingegneria del Software/1122_16/correct.txt b/Ingegneria del Software/1122_16/correct.txt new file mode 100644 index 0000000..7a6c6b9 --- /dev/null +++ b/Ingegneria del Software/1122_16/correct.txt @@ -0,0 +1 @@ +300000 EUR \ No newline at end of file diff --git a/Ingegneria del Software/1122_16/quest.txt b/Ingegneria del Software/1122_16/quest.txt new file mode 100644 index 0000000..db10798 --- /dev/null +++ b/Ingegneria del Software/1122_16/quest.txt @@ -0,0 +1,7 @@ +Il rischio R può essere calcolato come R = P*C, dove P è la probabilità dell'evento avverso (software failure nel nostro contesto) e C è il costo dell'occorrenza dell'evento avverso. + +Assumiamo che la probabilità P sia legata al costo di sviluppo S dalla formula + +P = 10^{(-b*S)} (cioè 10 elevato alla (-b*S)) + +dove b è una opportuna costante note da dati storici aziendali. Si assuma che b = 0.0001, C = 1000000, ed il rischio ammesso è R = 1000. Quale dei seguenti valori meglio approssima il costo S per lo sviluppo del software in questione. \ No newline at end of file diff --git a/Ingegneria del Software/1122_16/wrong 1.txt b/Ingegneria del Software/1122_16/wrong 1.txt new file mode 100644 index 0000000..2df501e --- /dev/null +++ b/Ingegneria del Software/1122_16/wrong 1.txt @@ -0,0 +1 @@ +500000 EUR \ No newline at end of file diff --git a/Ingegneria del Software/1122_16/wrong 2.txt b/Ingegneria del Software/1122_16/wrong 2.txt new file mode 100644 index 0000000..997967b --- /dev/null +++ b/Ingegneria del Software/1122_16/wrong 2.txt @@ -0,0 +1 @@ +700000 EUR \ No newline at end of file diff --git a/Ingegneria del Software/1/correct.txt b/Ingegneria del Software/1122_17/correct.txt similarity index 91% rename from Ingegneria del Software/1/correct.txt rename to Ingegneria del Software/1122_17/correct.txt index 0179ee7..b8bf06e 100644 --- a/Ingegneria del Software/1/correct.txt +++ b/Ingegneria del Software/1122_17/correct.txt @@ -5,9 +5,7 @@ InputReal x; // plant output OutputBoolean y; Boolean z; - initial equation - y = false; equation z = (time > 0) and ((x > 5) or (x < 0)); diff --git a/Ingegneria del Software/1122_17/quest.txt b/Ingegneria del Software/1122_17/quest.txt new file mode 100644 index 0000000..8255558 --- /dev/null +++ b/Ingegneria del Software/1122_17/quest.txt @@ -0,0 +1,5 @@ +Si consideri il seguente requisito: + +RQ: Durante l'esecuzione del programma (cioè per tutti gli istanti di tempo positivi) la variabile x è sempre nell'intervallo [0, 5]. + +Quale dei seguenti monitor meglio descrive il requisito RQ? \ No newline at end of file diff --git a/Ingegneria del Software/1/wrong 2.txt b/Ingegneria del Software/1122_17/wrong 1.txt similarity index 100% rename from Ingegneria del Software/1/wrong 2.txt rename to Ingegneria del Software/1122_17/wrong 1.txt diff --git a/Ingegneria del Software/1/wrong.txt b/Ingegneria del Software/1122_17/wrong 2.txt similarity index 100% rename from Ingegneria del Software/1/wrong.txt rename to Ingegneria del Software/1122_17/wrong 2.txt diff --git a/Ingegneria del Software/28/correct.txt b/Ingegneria del Software/1122_18/correct.txt similarity index 85% rename from Ingegneria del Software/28/correct.txt rename to Ingegneria del Software/1122_18/correct.txt index 8fda7cc..fc137ec 100644 --- a/Ingegneria del Software/28/correct.txt +++ b/Ingegneria del Software/1122_18/correct.txt @@ -1,15 +1,17 @@ -
-class Monitor -InputReal x, y; -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 60) and (delay(x, 10) > 0) and (y <= 0); -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor +InputReal x, y; +OutputBoolean wy; +Boolean wz; + +initial equation + +wy = false; +equation +wz = (time > 60) and (delay(x, 10) > 0) and (y <= 0); +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/28/quest.txt b/Ingegneria del Software/1122_18/quest.txt similarity index 64% rename from Ingegneria del Software/28/quest.txt rename to Ingegneria del Software/1122_18/quest.txt index 4786a89..0fece4c 100644 --- a/Ingegneria del Software/28/quest.txt +++ b/Ingegneria del Software/1122_18/quest.txt @@ -1,7 +1,9 @@ -Si consideri il seguente requisito: -RQ: Dopo 60 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà: -se 10 unità di tempo nel passato era stata richiesta una risorsa (variabile x positiva) allora ora è concesso l'accesso alla -risorsa (variabile y positiva) -Tenendo presente che, al tempo time, delay(z, w) ritorna 0 se time < w e ritorna il valore che z aveva al tempo (time - w), se time ->= w. -Quale dei seguenti monitor meglio descrive il requisito RQ ? \ No newline at end of file +Si consideri il seguente requisito: + +RQ: Dopo 60 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà: + +se 10 unità di tempo nel passato era stata richiesta una risorsa (variabile x positiva) allora ora è concesso l'accesso alla risorsa (variabile y positiva) + +Tenendo presente che, al tempo time, delay(z, w) ritorna 0 se time < w e ritorna il valore che z aveva al tempo (time - w), se time >= w. + +Quale dei seguenti monitor meglio descrive il requisito RQ? \ No newline at end of file diff --git a/Ingegneria del Software/28/wrong 2.txt b/Ingegneria del Software/1122_18/wrong 1.txt similarity index 84% rename from Ingegneria del Software/28/wrong 2.txt rename to Ingegneria del Software/1122_18/wrong 1.txt index 52459aa..dc0a5b5 100644 --- a/Ingegneria del Software/28/wrong 2.txt +++ b/Ingegneria del Software/1122_18/wrong 1.txt @@ -1,15 +1,19 @@ --class Monitor -InputReal x, y; -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 60) and (delay(x, 10) > 0) and (y > 0); -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor +InputReal x, y; +OutputBoolean wy; +Boolean wz; + +initial equation + +wy = false; +equation + +wz = (time > 60) and (delay(x, 10) > 0) and (y > 0); + +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_18/wrong 2.txt b/Ingegneria del Software/1122_18/wrong 2.txt new file mode 100644 index 0000000..093cf12 --- /dev/null +++ b/Ingegneria del Software/1122_18/wrong 2.txt @@ -0,0 +1,20 @@ ++class Monitor +InputReal x, y; +OutputBoolean wy; +Boolean wz; + +initial equation + +wy = false; +equation + +wz = (time > 60) or (delay(x, 10) > 0) or (y <= 0); + + +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_19/correct.txt b/Ingegneria del Software/1122_19/correct.txt new file mode 100644 index 0000000..e0bba82 --- /dev/null +++ b/Ingegneria del Software/1122_19/correct.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/EDqWXLf.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_19/quest.txt b/Ingegneria del Software/1122_19/quest.txt new file mode 100644 index 0000000..28aa70c --- /dev/null +++ b/Ingegneria del Software/1122_19/quest.txt @@ -0,0 +1,75 @@ +Si consideri il seguente modello Modelica. Quale dei seguenti state diagram lo rappresenta correttamente? + ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 3; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 3; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_19/wrong 1.txt b/Ingegneria del Software/1122_19/wrong 1.txt new file mode 100644 index 0000000..75dcbd7 --- /dev/null +++ b/Ingegneria del Software/1122_19/wrong 1.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/u6No1XI.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_19/wrong 2.txt b/Ingegneria del Software/1122_19/wrong 2.txt new file mode 100644 index 0000000..5e5c30f --- /dev/null +++ b/Ingegneria del Software/1122_19/wrong 2.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/SLOrqrl.png \ No newline at end of file diff --git a/Ingegneria del Software/28/wrong.txt b/Ingegneria del Software/1122_2/correct.txt similarity index 65% rename from Ingegneria del Software/28/wrong.txt rename to Ingegneria del Software/1122_2/correct.txt index 553e500..ad21063 100644 --- a/Ingegneria del Software/28/wrong.txt +++ b/Ingegneria del Software/1122_2/correct.txt @@ -1,15 +1,15 @@ --class Monitor -InputReal x, y; -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 60) or (delay(x, 10) > 0) or (y <= 0); -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor +InputReal x, y; +OutputBoolean wy; +Boolean wz; +initial equation +wy = false; +equation +wz = (time > 40) and (delay(x, 10) > 1) and (y < 0); +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_2/quest.txt b/Ingegneria del Software/1122_2/quest.txt new file mode 100644 index 0000000..2ef9a23 --- /dev/null +++ b/Ingegneria del Software/1122_2/quest.txt @@ -0,0 +1,9 @@ +Si consideri il seguente requisito: + +RQ: Dopo 40 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà: + +se 10 unità di tempo nel passato x era maggiore di 1 allora ora y è nonegativa. + +Tenendo presente che, al tempo time, delay(z, w) ritorna 0 se time <= w e ritorna il valore che z aveva al tempo (time - w), se time = w. + +Quale dei seguenti monitor meglio descrive il requisito RQ? \ No newline at end of file diff --git a/Ingegneria del Software/1122_2/wrong 1.txt b/Ingegneria del Software/1122_2/wrong 1.txt new file mode 100644 index 0000000..b0c70b4 --- /dev/null +++ b/Ingegneria del Software/1122_2/wrong 1.txt @@ -0,0 +1,17 @@ ++class Monitor +InputReal x, y; +OutputBoolean wy; +Boolean wz; + +initial equation + +wy = false; +equation +wz = (time > 40) and (delay(x, 10) > 1) and (y >= 0); +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_2/wrong 2.txt b/Ingegneria del Software/1122_2/wrong 2.txt new file mode 100644 index 0000000..50c4137 --- /dev/null +++ b/Ingegneria del Software/1122_2/wrong 2.txt @@ -0,0 +1,17 @@ ++class Monitor +InputReal x, y; +OutputBoolean wy; +Boolean wz; + +initial equation + +wy = false; +equation +wz = (time > 40) or (delay(x, 10) > 1) or (y < 0); +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_20/correct.txt b/Ingegneria del Software/1122_20/correct.txt new file mode 100644 index 0000000..81a4b93 --- /dev/null +++ b/Ingegneria del Software/1122_20/correct.txt @@ -0,0 +1 @@ +F(x, y, z) = if (x >= 0) then (z == pow(y, x)) else (z == 1) \ No newline at end of file diff --git a/Ingegneria del Software/1122_20/quest.txt b/Ingegneria del Software/1122_20/quest.txt new file mode 100644 index 0000000..139b0a2 --- /dev/null +++ b/Ingegneria del Software/1122_20/quest.txt @@ -0,0 +1,19 @@ +Un test oracle per un programma P è una funzione booleana che ha come inputs gli inputs ed outputs di P e ritorna true se e solo se il valore di output di P (con i dati inputs) è quello atteso dalle specifiche. + +Si consideri la seguente funzione C: + +----------- ++int f(int x, int y) { + +int z, k; + +z = 1; k = 0; + +while (k < x) { z = y*z; k = k + 1; } + +return (z); + +} ++Siano x, y, gli inputs del programma (f nel nostro caso) e z l'output. Assumendo il programma corretto, quale delle seguenti funzioni booleane F(x, y, z) è un test oracle per la funzione f. \ No newline at end of file diff --git a/Ingegneria del Software/1122_20/wrong 1.txt b/Ingegneria del Software/1122_20/wrong 1.txt new file mode 100644 index 0000000..f52d5ae --- /dev/null +++ b/Ingegneria del Software/1122_20/wrong 1.txt @@ -0,0 +1 @@ +F(x, y, z) = if (x >= 0) then (z == pow(y, x)) else (z == y) \ No newline at end of file diff --git a/Ingegneria del Software/1122_20/wrong 2.txt b/Ingegneria del Software/1122_20/wrong 2.txt new file mode 100644 index 0000000..d246b94 --- /dev/null +++ b/Ingegneria del Software/1122_20/wrong 2.txt @@ -0,0 +1 @@ +F(x, y, z) = if (x >= 0) then (z == pow(y, x)) else (z == 0) \ No newline at end of file diff --git a/Ingegneria del Software/27/correct.txt b/Ingegneria del Software/1122_21/correct.txt similarity index 55% rename from Ingegneria del Software/27/correct.txt rename to Ingegneria del Software/1122_21/correct.txt index cfa0931..e582263 100644 --- a/Ingegneria del Software/27/correct.txt +++ b/Ingegneria del Software/1122_21/correct.txt @@ -1,15 +1,17 @@ --class Monitor -InputReal x; // plant output -OutputBoolean y; -Boolean z; -initial equation -y = false; -equation -z = (time > 0) and ((x >= 5) or (x <= 0)) and ((x >= 15) or (x <= 10)) ; -algorithm -when edge(z) then -y := true; -end when; -end Monitor; ++class Monitor + +InputReal x; // plant output +OutputBoolean y; + +Boolean z; +initial equation +y = false; +equation +z = (time > 0) and ((x >= 5) or (x <= 0)) and ((x >= 15) or (x <= 10)) ; +algorithm +when edge(z) then +y := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_21/quest.txt b/Ingegneria del Software/1122_21/quest.txt new file mode 100644 index 0000000..9f10cbc --- /dev/null +++ b/Ingegneria del Software/1122_21/quest.txt @@ -0,0 +1,5 @@ +Si consideri il seguente requisito: + +RQ1: Durante l'esecuzione del programma (cioè per tutti gli istanti di tempo positivi) la variabile x è sempre nell'intervallo [0, 5] oppure [10, 15] + +Quale dei seguenti monitor meglio descrive il requisito RQ1 ? \ No newline at end of file diff --git a/Ingegneria del Software/27/wrong.txt b/Ingegneria del Software/1122_21/wrong 1.txt similarity index 54% rename from Ingegneria del Software/27/wrong.txt rename to Ingegneria del Software/1122_21/wrong 1.txt index 5f07b8b..93791b3 100644 --- a/Ingegneria del Software/27/wrong.txt +++ b/Ingegneria del Software/1122_21/wrong 1.txt @@ -1,15 +1,19 @@ --class Monitor -InputReal x; // plant output -OutputBoolean y; -Boolean z; -initial equation -y = false; -equation -z = (time > 0) and ((x >= 0) or (x <= 5)) and ((x >= 10) or (x <= 15)) ); -algorithm -when edge(z) then -y := true; -end when; -end Monitor; ++class Monitor + +InputReal x; // plant output +OutputBoolean y; + +Boolean z; + +initial equation + +y = false; +equation +z = (time > 0) and ( ((x >= 0) and (x <= 5)) or ((x >= 10) and (x <= 15)) ); +algorithm +when edge(z) then +y := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/27/wrong 2.txt b/Ingegneria del Software/1122_21/wrong 2.txt similarity index 54% rename from Ingegneria del Software/27/wrong 2.txt rename to Ingegneria del Software/1122_21/wrong 2.txt index 1bf9371..826c225 100644 --- a/Ingegneria del Software/27/wrong 2.txt +++ b/Ingegneria del Software/1122_21/wrong 2.txt @@ -1,15 +1,19 @@ --class Monitor -InputReal x; // plant output -OutputBoolean y; -Boolean z; -initial equation -y = false; -equation -z = (time > 0) and ( ((x >= 0) and (x <= 5)) or ((x >= 10) and (x <= 15)) ); -algorithm -when edge(z) then -y := true; -end when; -end Monitor; ++class Monitor + +InputReal x; // plant output +OutputBoolean y; + +Boolean z; + +initial equation + +y = false; +equation +z = (time > 0) and ((x >= 0) or (x <= 5)) and ((x >= 10) or (x <= 15)) ); +algorithm +when edge(z) then +y := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_22/correct.txt b/Ingegneria del Software/1122_22/correct.txt new file mode 100644 index 0000000..b110af1 --- /dev/null +++ b/Ingegneria del Software/1122_22/correct.txt @@ -0,0 +1 @@ +Transition coverage: 40% \ No newline at end of file diff --git a/Ingegneria del Software/1122_22/quest.txt b/Ingegneria del Software/1122_22/quest.txt new file mode 100644 index 0000000..a116140 --- /dev/null +++ b/Ingegneria del Software/1122_22/quest.txt @@ -0,0 +1,14 @@ +img=https://i.imgur.com/VZQnGCY.png +La transition coverage di un insieme di test cases (cioè sequenze 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: + +Test case 1: act1 act2 act0 act1 + +Test case 2: act1 act0 act1 act1 act2 act2 act0 + +Test case 3: act1 act2 act0 act0 + +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/1122_22/wrong 1.txt b/Ingegneria del Software/1122_22/wrong 1.txt new file mode 100644 index 0000000..cf27703 --- /dev/null +++ b/Ingegneria del Software/1122_22/wrong 1.txt @@ -0,0 +1 @@ +Transition coverage: 70% \ No newline at end of file diff --git a/Ingegneria del Software/1122_22/wrong 2.txt b/Ingegneria del Software/1122_22/wrong 2.txt new file mode 100644 index 0000000..eb5e1cd --- /dev/null +++ b/Ingegneria del Software/1122_22/wrong 2.txt @@ -0,0 +1 @@ +Transition coverage: 100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_23/correct.txt b/Ingegneria del Software/1122_23/correct.txt new file mode 100644 index 0000000..37bad47 --- /dev/null +++ b/Ingegneria del Software/1122_23/correct.txt @@ -0,0 +1 @@ +La variabile x è nell'intervallo [0, 5] \ No newline at end of file diff --git a/Ingegneria del Software/1122_23/quest.txt b/Ingegneria del Software/1122_23/quest.txt new file mode 100644 index 0000000..63f2e9f --- /dev/null +++ b/Ingegneria del Software/1122_23/quest.txt @@ -0,0 +1,29 @@ +Si consideri il monitor seguente che ritorna true appena i requisiti per il sistema monitorato sono violati. ++block Monitor + +input Real x; + +output Boolean y; + +Boolean w; + +initial equation + +y = false; + +equation + +w = ((x < 0) or (x > 5)); + +algorithm + +when edge(w) then + +y := true; + +end when; + +end Monitor; ++Quale delle seguenti affermazioni meglio descrive il requisito monitorato. \ No newline at end of file diff --git a/Ingegneria del Software/1122_23/wrong 1.txt b/Ingegneria del Software/1122_23/wrong 1.txt new file mode 100644 index 0000000..6fa1af9 --- /dev/null +++ b/Ingegneria del Software/1122_23/wrong 1.txt @@ -0,0 +1 @@ +La variabile x è fuori dall'intervallo [0, 5] \ No newline at end of file diff --git a/Ingegneria del Software/1122_23/wrong 2.txt b/Ingegneria del Software/1122_23/wrong 2.txt new file mode 100644 index 0000000..b383e07 --- /dev/null +++ b/Ingegneria del Software/1122_23/wrong 2.txt @@ -0,0 +1 @@ +La variable x è minore di 0 \ No newline at end of file diff --git a/Ingegneria del Software/36/correct.txt b/Ingegneria del Software/1122_24/correct.txt similarity index 82% rename from Ingegneria del Software/36/correct.txt rename to Ingegneria del Software/1122_24/correct.txt index 7f1e255..293ebbc 100644 --- a/Ingegneria del Software/36/correct.txt +++ b/Ingegneria del Software/1122_24/correct.txt @@ -1,15 +1,17 @@ --class Monitor -InputReal x, y; // plant output -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 10) and (x >= 10) and (x <= 20) and ((y < 0.5*x) or (y > 0.7*x)) ; -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor + +InputReal x, y; // plant output +OutputBoolean wy; + +Boolean wz; +initial equation +wy = false; +equation +wz = (time > 10) and (x >= 10) and (x <= 20) and ((y < 0.5*x) or (y > 0.7*x)) ; +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_24/quest.txt b/Ingegneria del Software/1122_24/quest.txt new file mode 100644 index 0000000..0accc5f --- /dev/null +++ b/Ingegneria del Software/1122_24/quest.txt @@ -0,0 +1,5 @@ +Si consideri il seguente requisito: + +RQ: Dopo 10 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà: se la variabile x è nell'intervallo [10, 20] allora la variabile y è compresa tra il 50% di x ed il 70% di x. + +Quale dei seguenti monitor meglio descrive il requisito RQ ? \ No newline at end of file diff --git a/Ingegneria del Software/36/wrong 2.txt b/Ingegneria del Software/1122_24/wrong 1.txt similarity index 75% rename from Ingegneria del Software/36/wrong 2.txt rename to Ingegneria del Software/1122_24/wrong 1.txt index a51ae0c..835a5ac 100644 --- a/Ingegneria del Software/36/wrong 2.txt +++ b/Ingegneria del Software/1122_24/wrong 1.txt @@ -1,15 +1,19 @@ --class Monitor -InputReal x, y; // plant output -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 10) and (x >= 10) and (x <= 20) and (y >= 0.5*x) and (y <= 0.7*x) ; -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor + +InputReal x, y; // plant output +OutputBoolean wy; + +Boolean wz; + +initial equation + +wy = false; +equation +wz = (time > 10) and (x >= 10) and (x <= 20) and (y >= 0.5*x) and (y <= 0.7*x) ; +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/36/wrong.txt b/Ingegneria del Software/1122_24/wrong 2.txt similarity index 81% rename from Ingegneria del Software/36/wrong.txt rename to Ingegneria del Software/1122_24/wrong 2.txt index a18541f..5a7d171 100644 --- a/Ingegneria del Software/36/wrong.txt +++ b/Ingegneria del Software/1122_24/wrong 2.txt @@ -1,15 +1,19 @@ --class Monitor -InputReal x, y; // plant output -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 10) and ((x < 10) or (x > 20)) and ((y < 0.5*x) or (y > 0.7*x)) ; -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor + +InputReal x, y; // plant output +OutputBoolean wy; + +Boolean wz; + +initial equation + +wy = false; +equation +wz = (time > 10) and ((x < 10) or (x > 20)) and ((y < 0.5*x) or (y > 0.7*x)) ; +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_25/correct.txt b/Ingegneria del Software/1122_25/correct.txt new file mode 100644 index 0000000..b9f32a6 --- /dev/null +++ b/Ingegneria del Software/1122_25/correct.txt @@ -0,0 +1 @@ +c(0)/(1 - p) \ No newline at end of file diff --git a/Ingegneria del Software/1122_25/quest.txt b/Ingegneria del Software/1122_25/quest.txt new file mode 100644 index 0000000..4087608 --- /dev/null +++ b/Ingegneria del Software/1122_25/quest.txt @@ -0,0 +1,10 @@ +img=https://i.imgur.com/jQT3J83.png +Si consideri il processo software con due fasi (0 ed 1) rappresentato con la Markov chain in figura. Lo stato iniziale 0 e p è in (0, 1). Il costo dello stato (fase) x è c(x). La fase 0 è la fase di design, che ha probabilità p di dover essere ripetuta causa errori. La fase 1 rappreenta il completamento del processo software, e quindi c(1) = 0. + +Il costo di una istanza del processo software descritto sopra è la somma dei costi degli stati attraversati (tenendo presente che si parte sempre dallo stato 0. + +Quindi il costo C(X) della sequenza di stati X = x(0), x(1), x(2), .... è C(X) = c(x(0)) + c(x(1)) + c(x(2)) + ... + +Ad esempio se X = 0, 1 abbiamo C(X) = c(0) + c(1) = c(0) (poichè c(1) = 0). + +Quale delle seguenti formule calcola il valore atteso del costo per completare il processo software di cui sopra \ No newline at end of file diff --git a/Ingegneria del Software/1122_25/wrong 1.txt b/Ingegneria del Software/1122_25/wrong 1.txt new file mode 100644 index 0000000..3143da9 --- /dev/null +++ b/Ingegneria del Software/1122_25/wrong 1.txt @@ -0,0 +1 @@ +c(0)/(p*(1 - p)) \ No newline at end of file diff --git a/Ingegneria del Software/1122_25/wrong 2.txt b/Ingegneria del Software/1122_25/wrong 2.txt new file mode 100644 index 0000000..b9f32a6 --- /dev/null +++ b/Ingegneria del Software/1122_25/wrong 2.txt @@ -0,0 +1 @@ +c(0)/(1 - p) \ No newline at end of file diff --git a/Ingegneria del Software/1122_26/correct.txt b/Ingegneria del Software/1122_26/correct.txt new file mode 100644 index 0000000..2f4c4c9 --- /dev/null +++ b/Ingegneria del Software/1122_26/correct.txt @@ -0,0 +1 @@ +Test set: {x=3, y=6}, {x=0, y=0}, {x=15, y=0}, {x=9, y=0} \ No newline at end of file diff --git a/Ingegneria del Software/1122_26/quest.txt b/Ingegneria del Software/1122_26/quest.txt new file mode 100644 index 0000000..514a3fa --- /dev/null +++ b/Ingegneria del Software/1122_26/quest.txt @@ -0,0 +1,15 @@ +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 - 6 <= 0) { if (x + y - 3 >= 0) return (1); else return (2); } + + else {if (x + 2*y -15 >= 0) return (3); else return (4); } + + } /* f() */ ++Quale dei seguenti test sets consegue una branch coverage del 100% ? \ No newline at end of file diff --git a/Ingegneria del Software/1122_26/wrong 1.txt b/Ingegneria del Software/1122_26/wrong 1.txt new file mode 100644 index 0000000..a82e779 --- /dev/null +++ b/Ingegneria del Software/1122_26/wrong 1.txt @@ -0,0 +1 @@ +Test set: {x=3, y=6}, {x=2, y=1}, {x=15, y=0}, {x=9, y=0} \ No newline at end of file diff --git a/Ingegneria del Software/1122_26/wrong 2.txt b/Ingegneria del Software/1122_26/wrong 2.txt new file mode 100644 index 0000000..82d4c38 --- /dev/null +++ b/Ingegneria del Software/1122_26/wrong 2.txt @@ -0,0 +1 @@ +Test set: {x=3, y=6}, {x=0, y=0}, {x=15, y=0}, {x=10, y=3} \ No newline at end of file diff --git a/Ingegneria del Software/1122_27/correct.txt b/Ingegneria del Software/1122_27/correct.txt new file mode 100644 index 0000000..8b0c318 --- /dev/null +++ b/Ingegneria del Software/1122_27/correct.txt @@ -0,0 +1 @@ +Transition coverage: 50% \ No newline at end of file diff --git a/Ingegneria del Software/1122_27/quest.txt b/Ingegneria del Software/1122_27/quest.txt new file mode 100644 index 0000000..59f8742 --- /dev/null +++ b/Ingegneria del Software/1122_27/quest.txt @@ -0,0 +1,13 @@ +img=https://i.imgur.com/TXCFgeI.png +La transition coverage di un insieme di test cases (cioè sequenze 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: + +Test case 1: act1 act2 act0 + +Test case 2: act2 act2 act2 act2 act2 act2 act0 + +Test case 3: act2 act0 act2 act0 act1 act2 act2 act2 act2 act2 act1 act0 act0 act2 act2 act2 act1 act2 act2 act2 act2 act2 act1 act2 act2 act2 act0 + +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/1122_27/wrong 1.txt b/Ingegneria del Software/1122_27/wrong 1.txt new file mode 100644 index 0000000..2ca9276 --- /dev/null +++ b/Ingegneria del Software/1122_27/wrong 1.txt @@ -0,0 +1 @@ +Transition coverage: 35% \ No newline at end of file diff --git a/Ingegneria del Software/1122_27/wrong 2.txt b/Ingegneria del Software/1122_27/wrong 2.txt new file mode 100644 index 0000000..6da4c51 --- /dev/null +++ b/Ingegneria del Software/1122_27/wrong 2.txt @@ -0,0 +1 @@ +Transition coverage: 90% \ No newline at end of file diff --git a/Ingegneria del Software/1122_28/correct.txt b/Ingegneria del Software/1122_28/correct.txt new file mode 100644 index 0000000..c3fc7c1 --- /dev/null +++ b/Ingegneria del Software/1122_28/correct.txt @@ -0,0 +1,9 @@ ++int f(in x, int y) + +{ +int z, w; +assert( (z + w < 1) || (z + w > 7)); +..... +} +\ No newline at end of file diff --git a/Ingegneria del Software/1122_28/quest.txt b/Ingegneria del Software/1122_28/quest.txt new file mode 100644 index 0000000..733c0cb --- /dev/null +++ b/Ingegneria del Software/1122_28/quest.txt @@ -0,0 +1,7 @@ +Pre-condizioni, invarianti e post-condizioni di un programma possono essere definiti usando la macro del C assert() (in). In particolare, assert(expre) non fa nulla se l'espressione expre vale TRUE (cioè non è 0), stampa un messaggio di errore su stderr e abortisce l'esecuzione del programma altrimenti. + +Si consideri la funzione C + +int f(int x, int y) { ..... } + +Quale delle seguenti assert esprime l'invariante che le variabili locali z e w di f() hanno somma minore di 1 oppure maggiore di 7 ? \ No newline at end of file diff --git a/Ingegneria del Software/1122_28/wrong 1.txt b/Ingegneria del Software/1122_28/wrong 1.txt new file mode 100644 index 0000000..1b8fa8b --- /dev/null +++ b/Ingegneria del Software/1122_28/wrong 1.txt @@ -0,0 +1,13 @@ + +int f(in x, int y) + +{ + +int z, w; + +assert( (z + w <= 1) || (z + w >= 7)); + +..... + +} +\ No newline at end of file diff --git a/Ingegneria del Software/1122_28/wrong 2.txt b/Ingegneria del Software/1122_28/wrong 2.txt new file mode 100644 index 0000000..b0705b4 --- /dev/null +++ b/Ingegneria del Software/1122_28/wrong 2.txt @@ -0,0 +1,13 @@ ++int f(in x, int y) + +{ + +int z, w; + +assert( (z + w > 1) || (z + w < 7)); + +..... + +} +\ No newline at end of file diff --git a/Ingegneria del Software/1122_29/correct.txt b/Ingegneria del Software/1122_29/correct.txt new file mode 100644 index 0000000..2d46409 --- /dev/null +++ b/Ingegneria del Software/1122_29/correct.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/SXM3yWp.png diff --git a/Ingegneria del Software/1122_29/quest.txt b/Ingegneria del Software/1122_29/quest.txt new file mode 100644 index 0000000..52863ce --- /dev/null +++ b/Ingegneria del Software/1122_29/quest.txt @@ -0,0 +1,70 @@ +Si consideri il seguente modello Modelica. Quale dei seguenti state diagram lo rappresenta correttamente ? ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 2; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 0; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_29/wrong 1.txt b/Ingegneria del Software/1122_29/wrong 1.txt new file mode 100644 index 0000000..b008b75 --- /dev/null +++ b/Ingegneria del Software/1122_29/wrong 1.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/CeDe2lF.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_29/wrong 2.txt b/Ingegneria del Software/1122_29/wrong 2.txt new file mode 100644 index 0000000..861967c --- /dev/null +++ b/Ingegneria del Software/1122_29/wrong 2.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/HBR1EoE.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_3/correct.txt b/Ingegneria del Software/1122_3/correct.txt new file mode 100644 index 0000000..6d02149 --- /dev/null +++ b/Ingegneria del Software/1122_3/correct.txt @@ -0,0 +1 @@ +Requisito funzionale \ No newline at end of file diff --git a/Ingegneria del Software/37/quest.txt b/Ingegneria del Software/1122_3/quest.txt similarity index 98% rename from Ingegneria del Software/37/quest.txt rename to Ingegneria del Software/1122_3/quest.txt index c5dbb4e..ddcf7c8 100644 --- a/Ingegneria del Software/37/quest.txt +++ b/Ingegneria del Software/1122_3/quest.txt @@ -1,2 +1,3 @@ -"Ogni giorno, per ciascuna clinica, il sistema genererà una lista dei pazienti che hanno un appuntamento quel giorno." +"Ogni giorno, per ciascuna clinica, il sistema genererà una lista dei pazienti che hanno un appuntamento quel giorno." + La frase precedente è un esempio di: \ No newline at end of file diff --git a/Ingegneria del Software/37/wrong 2.txt b/Ingegneria del Software/1122_3/wrong 1.txt similarity index 100% rename from Ingegneria del Software/37/wrong 2.txt rename to Ingegneria del Software/1122_3/wrong 1.txt diff --git a/Ingegneria del Software/1122_3/wrong 2.txt b/Ingegneria del Software/1122_3/wrong 2.txt new file mode 100644 index 0000000..2c39a1a --- /dev/null +++ b/Ingegneria del Software/1122_3/wrong 2.txt @@ -0,0 +1 @@ +Requisito di performance \ No newline at end of file diff --git a/Ingegneria del Software/1122_30/correct.txt b/Ingegneria del Software/1122_30/correct.txt new file mode 100644 index 0000000..2a2ecea --- /dev/null +++ b/Ingegneria del Software/1122_30/correct.txt @@ -0,0 +1 @@ +time(0)/(1 - p) \ No newline at end of file diff --git a/Ingegneria del Software/1122_30/quest.txt b/Ingegneria del Software/1122_30/quest.txt new file mode 100644 index 0000000..8b8cea7 --- /dev/null +++ b/Ingegneria del Software/1122_30/quest.txt @@ -0,0 +1,10 @@ +img=https://i.imgur.com/jQT3J83.png +Si consideri il processo software con due fasi (0 ed 1) rappresentato con la Markov chain in figura. Lo stato iniziale 0 e p è in (0, 1). Il tempo necessario per completare la fase x è time(x). La fase 0 è la fase di design, che ha probabilità p di dover essere ripetuta causa errori. La fase 1 rappreenta il completamento del processo software, e quindi time(1) = 0. + +Il tempo di una istanza del processo software descritto sopra è la somma dei tempi degli stati (fasi) attraversati (tenendo presente che si parte sempre dallo stato 0. + +Quindi il costo Time(X) della sequenza di stati X = x(0), x(1), x(2), .... è Time(X) = time(x(0)) + time(x(1)) + time(x(2)) + ... + +Ad esempio se X = 0, 1 abbiamo Time(X) = time(0) + time(1) = time(0) (poichè time(1) = 0). + +Quale delle seguenti formule calcola il valore atteso del costo per completare il processo software di cui sopra \ No newline at end of file diff --git a/Ingegneria del Software/1122_30/wrong 1.txt b/Ingegneria del Software/1122_30/wrong 1.txt new file mode 100644 index 0000000..9927a93 --- /dev/null +++ b/Ingegneria del Software/1122_30/wrong 1.txt @@ -0,0 +1 @@ +time(0)/(p*(1 - p)) \ No newline at end of file diff --git a/Ingegneria del Software/1122_30/wrong 2.txt b/Ingegneria del Software/1122_30/wrong 2.txt new file mode 100644 index 0000000..d68fd15 --- /dev/null +++ b/Ingegneria del Software/1122_30/wrong 2.txt @@ -0,0 +1 @@ +time(0)*(1 - p)/p \ No newline at end of file diff --git a/Ingegneria del Software/30/correct.txt b/Ingegneria del Software/1122_31/correct.txt similarity index 80% rename from Ingegneria del Software/30/correct.txt rename to Ingegneria del Software/1122_31/correct.txt index 427eb75..a98afd2 100644 --- a/Ingegneria del Software/30/correct.txt +++ b/Ingegneria del Software/1122_31/correct.txt @@ -1,15 +1,17 @@ --class Monitor -InputReal x; // plant output -OutputBoolean y; -Boolean z; -initial equation -y = false; -equation -z = (time > 20) and ((x >= 30) or (x <= 20)) ; -algorithm -when edge(z) then -y := true; -end when; -end Monitor; ++class Monitor + +InputReal x; // plant output +OutputBoolean y; + +Boolean z; +initial equation +y = false; +equation +z = (time > 20) and ((x >= 30) or (x <= 20)) ; +algorithm +when edge(z) then +y := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_31/quest.txt b/Ingegneria del Software/1122_31/quest.txt new file mode 100644 index 0000000..7314e2c --- /dev/null +++ b/Ingegneria del Software/1122_31/quest.txt @@ -0,0 +1,5 @@ +Si consideri il seguente requisito: + +RQ1: Dopo 20 unità di tempo dall'inizio dell'esecuzione la variabile x è sempre nell'intervallo [20, 30] . + +Quale dei seguenti monitor meglio descrive il requisito RQ1 ? \ No newline at end of file diff --git a/Ingegneria del Software/30/wrong.txt b/Ingegneria del Software/1122_31/wrong 1.txt similarity index 79% rename from Ingegneria del Software/30/wrong.txt rename to Ingegneria del Software/1122_31/wrong 1.txt index e324f25..8f1589e 100644 --- a/Ingegneria del Software/30/wrong.txt +++ b/Ingegneria del Software/1122_31/wrong 1.txt @@ -1,15 +1,19 @@ --class Monitor -InputReal x; // plant output -OutputBoolean y; -Boolean z; -initial equation -y = false; -equation -z = (time > 20) and (x >= 20) and (x <= 30) ; -algorithm -when edge(z) then -y := true; -end when; -end Monitor; ++class Monitor + +InputReal x; // plant output +OutputBoolean y; + +Boolean z; + +initial equation + +y = false; +equation +z = (time > 20) and (x >= 20) and (x <= 30) ; +algorithm +when edge(z) then +y := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/30/wrong 2.txt b/Ingegneria del Software/1122_31/wrong 2.txt similarity index 79% rename from Ingegneria del Software/30/wrong 2.txt rename to Ingegneria del Software/1122_31/wrong 2.txt index 5065310..8fd5deb 100644 --- a/Ingegneria del Software/30/wrong 2.txt +++ b/Ingegneria del Software/1122_31/wrong 2.txt @@ -1,15 +1,19 @@ --class Monitor -InputReal x; // plant output -OutputBoolean y; -Boolean z; -initial equation -y = false; -equation -z = (time > 20) or ((x >= 20) and (x <= 30)) ; -algorithm -when edge(z) then -y := true; -end when; -end Monitor; ++class Monitor + +InputReal x; // plant output +OutputBoolean y; + +Boolean z; + +initial equation + +y = false; +equation +z = (time > 20) or ((x >= 20) and (x <= 30)) ; +algorithm +when edge(z) then +y := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/18/correct.txt b/Ingegneria del Software/1122_32/correct.txt similarity index 80% rename from Ingegneria del Software/18/correct.txt rename to Ingegneria del Software/1122_32/correct.txt index 4a0e81e..1a8a50a 100644 --- a/Ingegneria del Software/18/correct.txt +++ b/Ingegneria del Software/1122_32/correct.txt @@ -1 +1 @@ -Per ciascun requisito, dovremmo essere in grado di scrivere un inseme di test che può dimostrare che il sistema sviluppato soddisfa il requisito considerato. +Per ciascun requisito, dovremmo essere in grado di scrivere un inseme di test che può dimostrare che il sistema sviluppato soddisfa il requisito considerato. \ No newline at end of file diff --git a/Ingegneria del Software/1122_32/quest.txt b/Ingegneria del Software/1122_32/quest.txt new file mode 100644 index 0000000..a3ca550 --- /dev/null +++ b/Ingegneria del Software/1122_32/quest.txt @@ -0,0 +1 @@ +Quale delle seguenti frasi meglio descrive il criterio di "requirements verifiability" che è parte della "requirements validation activity". \ No newline at end of file diff --git a/Ingegneria del Software/18/wrong.txt b/Ingegneria del Software/1122_32/wrong 1.txt similarity index 85% rename from Ingegneria del Software/18/wrong.txt rename to Ingegneria del Software/1122_32/wrong 1.txt index 99f80d4..3fdb31e 100644 --- a/Ingegneria del Software/18/wrong.txt +++ b/Ingegneria del Software/1122_32/wrong 1.txt @@ -1 +1 @@ -Per ciascuna componente del sistema, dovremmo essere in grado di scrivere un insieme di test che può dimostrare che essa soddisfa tutti i requisiti. +Per ciascuna componente del sistema, dovremmo essere in grado di scrivere un insieme di test che può dimostrare che essa soddisfa tutti i requisiti. \ No newline at end of file diff --git a/Ingegneria del Software/18/wrong 2.txt b/Ingegneria del Software/1122_32/wrong 2.txt similarity index 67% rename from Ingegneria del Software/18/wrong 2.txt rename to Ingegneria del Software/1122_32/wrong 2.txt index 4098e9d..fac8307 100644 --- a/Ingegneria del Software/18/wrong 2.txt +++ b/Ingegneria del Software/1122_32/wrong 2.txt @@ -1 +1 @@ -Per ciascuna coppia di componenti, dovremmo essere in grado di scrivere un insieme di test che può dimostrare che l'interazione tra le componenti soddisfa tutti i requisiti di interfaccia. +Per ciascuna coppia di componenti, dovremmo essere in grado di scrivere un insieme di test che può dimostrare che l'interazione tra le componenti soddisfa tutti i requisiti di interfaccia. \ No newline at end of file diff --git a/Ingegneria del Software/1122_33/correct.txt b/Ingegneria del Software/1122_33/correct.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/1122_33/correct.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_33/quest.txt b/Ingegneria del Software/1122_33/quest.txt new file mode 100644 index 0000000..301d989 --- /dev/null +++ b/Ingegneria del Software/1122_33/quest.txt @@ -0,0 +1,17 @@ +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: + +----------- += 0) return (1); else return (2); } + + else {if (x + 2*y - 5 >= 0) return (3); else return (4); } + + } /* f() */ ++Si considerino i seguenti test cases: {x=1, y=2}, {x=0, y=0}, {x=5, y=0}, {x=3, y=0}. + +Quale delle seguenti è la branch coverage conseguita? \ No newline at end of file diff --git a/Ingegneria del Software/1122_33/wrong 1.txt b/Ingegneria del Software/1122_33/wrong 1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/1122_33/wrong 1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/1122_33/wrong 2.txt b/Ingegneria del Software/1122_33/wrong 2.txt new file mode 100644 index 0000000..23e721f --- /dev/null +++ b/Ingegneria del Software/1122_33/wrong 2.txt @@ -0,0 +1 @@ +50% \ No newline at end of file diff --git a/Ingegneria del Software/1122_34/correct.txt b/Ingegneria del Software/1122_34/correct.txt new file mode 100644 index 0000000..bc5692f --- /dev/null +++ b/Ingegneria del Software/1122_34/correct.txt @@ -0,0 +1 @@ +State coverage: 87% \ No newline at end of file diff --git a/Ingegneria del Software/1122_34/quest.txt b/Ingegneria del Software/1122_34/quest.txt new file mode 100644 index 0000000..09970ee --- /dev/null +++ b/Ingegneria del Software/1122_34/quest.txt @@ -0,0 +1,13 @@ +img=https://i.imgur.com/cXPjiw9.png +La state coverage di un insieme di test cases (cioè sequenze di inputs) per uno state diagram è la percentuale di stati (inclusi START ed END) raggiunti almeno una volta. + +Si consideri lo state diagram in figura +Si consideri il seguente insieme di test cases: + +Test case 1: act2 act1 act1 act2 act1 act1 act0 + +Test case 2: act2 act0 act2 act2 act1 act1 act0 act2 act2 act2 act0 + +Test case 3: act1 act2 act2 act2 act1 act0 act1 act2 act2 act0 + +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/1122_34/wrong 1.txt b/Ingegneria del Software/1122_34/wrong 1.txt new file mode 100644 index 0000000..1a8a508 --- /dev/null +++ b/Ingegneria del Software/1122_34/wrong 1.txt @@ -0,0 +1 @@ +State coverage: 50% \ No newline at end of file diff --git a/Ingegneria del Software/1122_34/wrong 2.txt b/Ingegneria del Software/1122_34/wrong 2.txt new file mode 100644 index 0000000..d4625fd --- /dev/null +++ b/Ingegneria del Software/1122_34/wrong 2.txt @@ -0,0 +1 @@ +State coverage: 100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_35/correct.txt b/Ingegneria del Software/1122_35/correct.txt new file mode 100644 index 0000000..98939be --- /dev/null +++ b/Ingegneria del Software/1122_35/correct.txt @@ -0,0 +1 @@ +1/(1 - p) \ No newline at end of file diff --git a/Ingegneria del Software/1122_35/quest.txt b/Ingegneria del Software/1122_35/quest.txt new file mode 100644 index 0000000..215b21b --- /dev/null +++ b/Ingegneria del Software/1122_35/quest.txt @@ -0,0 +1,3 @@ +img=https://i.imgur.com/jQT3J83.png +Si consideri la Markov chain in figura con stato iniziale 0 e p in (0, 1). Quale delle seguenti formule calcola il valore atteso del numero di transizioni necessarie per lasciare lo stato 0. + diff --git a/Ingegneria del Software/1122_35/wrong 1.txt b/Ingegneria del Software/1122_35/wrong 1.txt new file mode 100644 index 0000000..56ea6ac --- /dev/null +++ b/Ingegneria del Software/1122_35/wrong 1.txt @@ -0,0 +1 @@ +1/(p*(1 - p)) \ No newline at end of file diff --git a/Ingegneria del Software/1122_35/wrong 2.txt b/Ingegneria del Software/1122_35/wrong 2.txt new file mode 100644 index 0000000..db2276d --- /dev/null +++ b/Ingegneria del Software/1122_35/wrong 2.txt @@ -0,0 +1 @@ +(1 - p)/p \ No newline at end of file diff --git a/Ingegneria del Software/1122_36/correct.txt b/Ingegneria del Software/1122_36/correct.txt new file mode 100644 index 0000000..a66c9ae --- /dev/null +++ b/Ingegneria del Software/1122_36/correct.txt @@ -0,0 +1 @@ +(a=200, b = 0, c = 1), (a=50, b = 5, c = 0), (a=50, b = 3, c = 0) \ No newline at end of file diff --git a/Ingegneria del Software/1122_36/quest.txt b/Ingegneria del Software/1122_36/quest.txt new file mode 100644 index 0000000..da5d010 --- /dev/null +++ b/Ingegneria del Software/1122_36/quest.txt @@ -0,0 +1,26 @@ +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 cases 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 un 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, int b, int c) +{ if ( (a - 100 >= 0) && (b - c - 1 <= 0) ) + return (1); // punto di uscita 1 + else if ((b - c - 1 <= 0) || (b + c - 5 >= 0) +) + then return (2); // punto di uscita 2 + else return (3); // punto di uscita 3 +} ++Quale dei seguenti test set soddisfa il criterio della Condition/Decision coverage? \ No newline at end of file diff --git a/Ingegneria del Software/1122_36/wrong 1.txt b/Ingegneria del Software/1122_36/wrong 1.txt new file mode 100644 index 0000000..abe0eaa --- /dev/null +++ b/Ingegneria del Software/1122_36/wrong 1.txt @@ -0,0 +1 @@ +(a=200, b = 0, c = 1), (a=50, b = 4, c = 0), (a=200, b = 4, c = 0) \ No newline at end of file diff --git a/Ingegneria del Software/1122_36/wrong 2.txt b/Ingegneria del Software/1122_36/wrong 2.txt new file mode 100644 index 0000000..ea25d73 --- /dev/null +++ b/Ingegneria del Software/1122_36/wrong 2.txt @@ -0,0 +1 @@ +(a=200, b = 0, c = 1), (a=50, b = 5, c = 0), (a=50, b = 0, c = 5) \ No newline at end of file diff --git a/Ingegneria del Software/7/correct.txt b/Ingegneria del Software/1122_37/correct.txt similarity index 100% rename from Ingegneria del Software/7/correct.txt rename to Ingegneria del Software/1122_37/correct.txt diff --git a/Ingegneria del Software/7/quest.txt b/Ingegneria del Software/1122_37/quest.txt similarity index 83% rename from Ingegneria del Software/7/quest.txt rename to Ingegneria del Software/1122_37/quest.txt index b99e2e2..843e4e9 100644 --- a/Ingegneria del Software/7/quest.txt +++ b/Ingegneria del Software/1122_37/quest.txt @@ -6,4 +6,4 @@ se 10 unità di tempo nel passato x era maggiore di 0 allora ora y è negativa. Tenendo presente che, al tempo time, delay(z, w) ritorna 0 se time <= w e ritorna il valore che z aveva al tempo (time - w), se time = w. -Quale dei seguenti monitor meglio descrive il requisito RQ? \ No newline at end of file +Quale dei seguenti monitor meglio descrive il requisito RQ ? \ No newline at end of file diff --git a/Ingegneria del Software/7/wrong.txt b/Ingegneria del Software/1122_37/wrong 1.txt similarity index 100% rename from Ingegneria del Software/7/wrong.txt rename to Ingegneria del Software/1122_37/wrong 1.txt diff --git a/Ingegneria del Software/7/wrong 2.txt b/Ingegneria del Software/1122_37/wrong 2.txt similarity index 100% rename from Ingegneria del Software/7/wrong 2.txt rename to Ingegneria del Software/1122_37/wrong 2.txt diff --git a/Ingegneria del Software/1122_38/correct.txt b/Ingegneria del Software/1122_38/correct.txt new file mode 100644 index 0000000..a7029bc --- /dev/null +++ b/Ingegneria del Software/1122_38/correct.txt @@ -0,0 +1 @@ +La variabile x è nell'intervallo [1, 4] oppure nell'intervallo [15, 20]. \ No newline at end of file diff --git a/Ingegneria del Software/1122_38/quest.txt b/Ingegneria del Software/1122_38/quest.txt new file mode 100644 index 0000000..24d3f68 --- /dev/null +++ b/Ingegneria del Software/1122_38/quest.txt @@ -0,0 +1,29 @@ +Si consideri il monitor seguente che ritorna true appena il sistema viola il requisito monitorato. ++block Monitor + +input Real x; + +output Boolean y; + +Boolean w; + +initial equation + +y = false; + +equation + +w = ((x < 1) or (x > 4)) and ((x < 15) or (x > 20)); + +algorithm + +when edge(w) then + +y := true; + +end when; + +end Monitor; ++Quale delle seguenti affermazioni meglio descrive il requisito monitorato? \ No newline at end of file diff --git a/Ingegneria del Software/1122_38/wrong 1.txt b/Ingegneria del Software/1122_38/wrong 1.txt new file mode 100644 index 0000000..710b111 --- /dev/null +++ b/Ingegneria del Software/1122_38/wrong 1.txt @@ -0,0 +1 @@ +La variabile x è fuori dall'intervallo [1, 4] e fuori dall'intervallo [15, 20]. \ No newline at end of file diff --git a/Ingegneria del Software/1122_38/wrong 2.txt b/Ingegneria del Software/1122_38/wrong 2.txt new file mode 100644 index 0000000..a82929b --- /dev/null +++ b/Ingegneria del Software/1122_38/wrong 2.txt @@ -0,0 +1 @@ +La variabile x è nell'intervallo [1, 4] e fuori dall'intervallo [15, 20]. \ No newline at end of file diff --git a/Ingegneria del Software/1122_39/correct.txt b/Ingegneria del Software/1122_39/correct.txt new file mode 100644 index 0000000..8bec3c6 --- /dev/null +++ b/Ingegneria del Software/1122_39/correct.txt @@ -0,0 +1 @@ +{x=1, y=1}, {x=0, y=0}, {x=2, y=1}, {x=2, y=0}. \ No newline at end of file diff --git a/Ingegneria del Software/1122_39/quest.txt b/Ingegneria del Software/1122_39/quest.txt new file mode 100644 index 0000000..5826af4 --- /dev/null +++ b/Ingegneria del Software/1122_39/quest.txt @@ -0,0 +1,14 @@ +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 - 1 >= 0) return (1); else return (2); } + + else {if (2*x + y - 5 >= 0) return (3); else return (4); } + + } /* f() */ ++Quale dei seguenti test sets consegue una branch coverage del 100% ? \ No newline at end of file diff --git a/Ingegneria del Software/1122_39/wrong 1.txt b/Ingegneria del Software/1122_39/wrong 1.txt new file mode 100644 index 0000000..08bfca1 --- /dev/null +++ b/Ingegneria del Software/1122_39/wrong 1.txt @@ -0,0 +1 @@ +{x=1, y=1}, {x=0, y=0}, {x=2, y=1}, {x=2, y=3}. \ No newline at end of file diff --git a/Ingegneria del Software/1122_39/wrong 2.txt b/Ingegneria del Software/1122_39/wrong 2.txt new file mode 100644 index 0000000..256a361 --- /dev/null +++ b/Ingegneria del Software/1122_39/wrong 2.txt @@ -0,0 +1 @@ +{x=1, y=1}, {x=2, y=2}, {x=2, y=1}, {x=2, y=0}. \ No newline at end of file diff --git a/Ingegneria del Software/1122_4/correct.txt b/Ingegneria del Software/1122_4/correct.txt new file mode 100644 index 0000000..9ddc3d7 --- /dev/null +++ b/Ingegneria del Software/1122_4/correct.txt @@ -0,0 +1,45 @@ ++block FSA // Finite State Automaton + + +/* connector declarations outside this block: +connector InputInteger = input Integer; +connector OutputInteger = output Integer; +*/ + + +InputInteger u; // external input +OutputInteger x; // state +parameter Real T = 1; + + +algorithm + + +when initial() then +x := 0; + + +elsewhen sample(0,T) then + + +if (pre(x) == 0) and (pre(u) == 0) then x := 3; +elseif (pre(x) == 0) and (pre(u) == 1) then x := 4; +elseif (pre(x) == 0) and (pre(u) == 2) then x := 1; +elseif (pre(x) == 1) and (pre(u) == 1) then x := 3; +elseif (pre(x) == 2) and (pre(u) == 0) then x := 4; +elseif (pre(x) == 2) and (pre(u) == 1) then x := 0; +elseif (pre(x) == 2) and (pre(u) == 2) then x := 0; +elseif (pre(x) == 3) and (pre(u) == 0) then x := 2; +elseif (pre(x) == 3) and (pre(u) == 1) then x := 0; +elseif (pre(x) == 3) and (pre(u) == 2) then x := 4; +elseif (pre(x) == 4) and (pre(u) == 0) then x := 3; +elseif (pre(x) == 4) and (pre(u) == 1) then x := 0; +elseif (pre(x) == 4) and (pre(u) == 2) then x := 2; +else x := pre(x); // default +end if; + + +end when; +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_4/quest.txt b/Ingegneria del Software/1122_4/quest.txt new file mode 100644 index 0000000..4181719 --- /dev/null +++ b/Ingegneria del Software/1122_4/quest.txt @@ -0,0 +1,2 @@ +img=https://i.imgur.com/1yUsW7d.png +Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura? \ No newline at end of file diff --git a/Ingegneria del Software/1122_4/wrong 1.txt b/Ingegneria del Software/1122_4/wrong 1.txt new file mode 100644 index 0000000..c92e243 --- /dev/null +++ b/Ingegneria del Software/1122_4/wrong 1.txt @@ -0,0 +1,67 @@ ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 3; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 2; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_4/wrong 2.txt b/Ingegneria del Software/1122_4/wrong 2.txt new file mode 100644 index 0000000..ef7bdb0 --- /dev/null +++ b/Ingegneria del Software/1122_4/wrong 2.txt @@ -0,0 +1,69 @@ ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 3; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 3; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_40/correct.txt b/Ingegneria del Software/1122_40/correct.txt new file mode 100644 index 0000000..6b560cf --- /dev/null +++ b/Ingegneria del Software/1122_40/correct.txt @@ -0,0 +1 @@ +Transition coverage: 25% \ No newline at end of file diff --git a/Ingegneria del Software/1122_40/quest.txt b/Ingegneria del Software/1122_40/quest.txt new file mode 100644 index 0000000..62c01e2 --- /dev/null +++ b/Ingegneria del Software/1122_40/quest.txt @@ -0,0 +1,13 @@ +img=https://i.imgur.com/ZjBToOi.png +La transition coverage di un insieme di test cases (cioè sequenze 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: + +Test case 1: act2 + +Test case 2: act1 act0 act1 act2 act1 act0 act0 act0 + + +Test case 3: act0 act0 + +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/1122_40/wrong 1.txt b/Ingegneria del Software/1122_40/wrong 1.txt new file mode 100644 index 0000000..d4b5815 --- /dev/null +++ b/Ingegneria del Software/1122_40/wrong 1.txt @@ -0,0 +1 @@ +Transition coverage: 75% \ No newline at end of file diff --git a/Ingegneria del Software/1122_40/wrong 2.txt b/Ingegneria del Software/1122_40/wrong 2.txt new file mode 100644 index 0000000..8b0c318 --- /dev/null +++ b/Ingegneria del Software/1122_40/wrong 2.txt @@ -0,0 +1 @@ +Transition coverage: 50% \ No newline at end of file diff --git a/Ingegneria del Software/42/correct.txt b/Ingegneria del Software/1122_41/correct.txt similarity index 80% rename from Ingegneria del Software/42/correct.txt rename to Ingegneria del Software/1122_41/correct.txt index 753671c..4c75070 100644 --- a/Ingegneria del Software/42/correct.txt +++ b/Ingegneria del Software/1122_41/correct.txt @@ -1,15 +1,16 @@ --class Monitor -InputReal x, y, z; // plant output -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 50) and (x < 0.6*y) and (x + y <= 0.3*z); -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor + +InputReal x, y, z; // plant output +OutputBoolean wy; +Boolean wz; +initial equation +wy = false; +equation +wz = (time > 50) and (x < 0.6*y) and (x + y <= 0.3*z); +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/42/quest.txt b/Ingegneria del Software/1122_41/quest.txt similarity index 69% rename from Ingegneria del Software/42/quest.txt rename to Ingegneria del Software/1122_41/quest.txt index c669df0..bd2d469 100644 --- a/Ingegneria del Software/42/quest.txt +++ b/Ingegneria del Software/1122_41/quest.txt @@ -1,4 +1,7 @@ -Si consideri il seguente requisito: -RQ: Dopo 50 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà: -se la variabile x è minore del 60% della variabile y allora la somma di x ed y è maggiore del 30% della variabile z +Si consideri il seguente requisito: + +RQ: Dopo 50 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà: + +se la variabile x è minore del 60% della variabile y allora la somma di x ed y è maggiore del 30% della variabile z + Quale dei seguenti monitor meglio descrive il requisito RQ ? \ No newline at end of file diff --git a/Ingegneria del Software/42/wrong.txt b/Ingegneria del Software/1122_41/wrong 1.txt similarity index 79% rename from Ingegneria del Software/42/wrong.txt rename to Ingegneria del Software/1122_41/wrong 1.txt index 03d64ee..b270f7e 100644 --- a/Ingegneria del Software/42/wrong.txt +++ b/Ingegneria del Software/1122_41/wrong 1.txt @@ -1,15 +1,18 @@ --class Monitor -InputReal x, y, z; // plant output -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 50) and (x >= 0.6*y) and (x + y <= 0.3*z); -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor + +InputReal x, y, z; // plant output +OutputBoolean wy; +Boolean wz; + +initial equation + +wy = false; +equation +wz = (time > 50) and (x >= 0.6*y) and (x + y <= 0.3*z); +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/42/wrong 2.txt b/Ingegneria del Software/1122_41/wrong 2.txt similarity index 79% rename from Ingegneria del Software/42/wrong 2.txt rename to Ingegneria del Software/1122_41/wrong 2.txt index baacdc3..6637a0f 100644 --- a/Ingegneria del Software/42/wrong 2.txt +++ b/Ingegneria del Software/1122_41/wrong 2.txt @@ -1,15 +1,18 @@ --class Monitor -InputReal x, y, z; // plant output -OutputBoolean wy; -Boolean wz; -initial equation -wy = false; -equation -wz = (time > 50) and (x < 0.6*y) and (x + y > 0.3*z); -algorithm -when edge(wz) then -wy := true; -end when; -end Monitor; ++class Monitor + +InputReal x, y, z; // plant output +OutputBoolean wy; +Boolean wz; + +initial equation + +wy = false; +equation +wz = (time > 50) and (x < 0.6*y) and (x + y > 0.3*z); +algorithm +when edge(wz) then +wy := true; +end when; +end Monitor;\ No newline at end of file diff --git a/Ingegneria del Software/1122_42/correct.txt b/Ingegneria del Software/1122_42/correct.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/1122_42/correct.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_42/quest.txt b/Ingegneria del Software/1122_42/quest.txt new file mode 100644 index 0000000..67b07dc --- /dev/null +++ b/Ingegneria del Software/1122_42/quest.txt @@ -0,0 +1,17 @@ +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? \ No newline at end of file diff --git a/Ingegneria del Software/1122_42/wrong 1.txt b/Ingegneria del Software/1122_42/wrong 1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/1122_42/wrong 1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/1122_42/wrong 2.txt b/Ingegneria del Software/1122_42/wrong 2.txt new file mode 100644 index 0000000..23e721f --- /dev/null +++ b/Ingegneria del Software/1122_42/wrong 2.txt @@ -0,0 +1 @@ +50% \ No newline at end of file diff --git a/Ingegneria del Software/1122_43/correct.txt b/Ingegneria del Software/1122_43/correct.txt new file mode 100644 index 0000000..bc5692f --- /dev/null +++ b/Ingegneria del Software/1122_43/correct.txt @@ -0,0 +1 @@ +State coverage: 87% \ No newline at end of file diff --git a/Ingegneria del Software/1122_43/quest.txt b/Ingegneria del Software/1122_43/quest.txt new file mode 100644 index 0000000..1045bb8 --- /dev/null +++ b/Ingegneria del Software/1122_43/quest.txt @@ -0,0 +1,11 @@ +img=https://i.imgur.com/5ZmMM3r.png +La state coverage di un insieme di test cases (cioè sequenze di inputs) per uno state diagram è la percentuale di stati (inclusi START ed END) raggiunti almeno una volta. + +Si consideri lo state diagram in figura +Si consideri il seguente insieme di test cases: + +Test case 1: act0 act2 act2 act1 act2 act2 act0 act2 act2 act0 act2 act0 act0 act2 act2 act2 act2 act1 + +Test case 2: act2 act1 act0 act2 act2 act0 act0 act1 + +Test case 3: act0 act1 act0 act0 act0 act2 act1 act0 act2 act2 act2 act0 act1 \ No newline at end of file diff --git a/Ingegneria del Software/1122_43/wrong 1.txt b/Ingegneria del Software/1122_43/wrong 1.txt new file mode 100644 index 0000000..d4625fd --- /dev/null +++ b/Ingegneria del Software/1122_43/wrong 1.txt @@ -0,0 +1 @@ +State coverage: 100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_43/wrong 2.txt b/Ingegneria del Software/1122_43/wrong 2.txt new file mode 100644 index 0000000..1a8a508 --- /dev/null +++ b/Ingegneria del Software/1122_43/wrong 2.txt @@ -0,0 +1 @@ +State coverage: 50% \ No newline at end of file diff --git a/Ingegneria del Software/1122_44/correct.txt b/Ingegneria del Software/1122_44/correct.txt new file mode 100644 index 0000000..2fd674f --- /dev/null +++ b/Ingegneria del Software/1122_44/correct.txt @@ -0,0 +1 @@ +60% \ No newline at end of file diff --git a/Ingegneria del Software/1122_44/quest.txt b/Ingegneria del Software/1122_44/quest.txt new file mode 100644 index 0000000..6428a0e --- /dev/null +++ b/Ingegneria del Software/1122_44/quest.txt @@ -0,0 +1,15 @@ +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 la seguente funzione C: + +int f1(int x) { return (2*x); } + +Si vuole testare la funzione f1(). A tal fine l'insieme degli interi viene partizionato come segue: + +{(-inf, -11], [-10, -1], {0}, [1, 50], [51, +inf)} + +Si consideri il seguente insieme di test cases: + +{x=-20, x= 10, x=60} + +Quale delle seguenti è la partition coverage conseguita? \ No newline at end of file diff --git a/Ingegneria del Software/1122_44/wrong 1.txt b/Ingegneria del Software/1122_44/wrong 1.txt new file mode 100644 index 0000000..a2507e5 --- /dev/null +++ b/Ingegneria del Software/1122_44/wrong 1.txt @@ -0,0 +1 @@ +80% \ No newline at end of file diff --git a/Ingegneria del Software/1122_44/wrong 2.txt b/Ingegneria del Software/1122_44/wrong 2.txt new file mode 100644 index 0000000..95bc750 --- /dev/null +++ b/Ingegneria del Software/1122_44/wrong 2.txt @@ -0,0 +1 @@ +100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_45/correct.txt b/Ingegneria del Software/1122_45/correct.txt new file mode 100644 index 0000000..3fb437d --- /dev/null +++ b/Ingegneria del Software/1122_45/correct.txt @@ -0,0 +1 @@ +0.56 \ No newline at end of file diff --git a/Ingegneria del Software/1122_45/quest.txt b/Ingegneria del Software/1122_45/quest.txt new file mode 100644 index 0000000..1454704 --- /dev/null +++ b/Ingegneria del Software/1122_45/quest.txt @@ -0,0 +1,8 @@ +img=https://i.imgur.com/47sr1ne.png +Un processo software può essere rappesentato con uno state diagram in cui gli stati rappresentano le fasi (e loro iterazioni) del prcoesso software e gli archi le transizioni da una fase all'altra. Gli archi sono etichettati con le probabilità della transizione e gli stati sono etichettati con il costo per lasciare lo stato. + +Ad esempio lo state diagram in figura rappresenta un processo software con 2 fasi F1 ed F2. F1 ha costo 10000 EUR ed F2 ha costo 1000 EUR. F1 ha una probabilita dello 0.3 di dover essere ripetuta (a causa di errori) ed F2 ha una probabilità 0.2 di dover essere ripetuta (a causa di errori). + +Uno scenario è una sequenza di stati. + +Qual è la probabilità dello scenario: 1, 3 ? In altri terminti, qual è la probabilità che non sia necessario ripetere nessuna fase? \ No newline at end of file diff --git a/Ingegneria del Software/1122_45/wrong 1.txt b/Ingegneria del Software/1122_45/wrong 1.txt new file mode 100644 index 0000000..fc54e00 --- /dev/null +++ b/Ingegneria del Software/1122_45/wrong 1.txt @@ -0,0 +1 @@ +0.24 \ No newline at end of file diff --git a/Ingegneria del Software/1122_45/wrong 2.txt b/Ingegneria del Software/1122_45/wrong 2.txt new file mode 100644 index 0000000..c64601b --- /dev/null +++ b/Ingegneria del Software/1122_45/wrong 2.txt @@ -0,0 +1 @@ +0.14 \ No newline at end of file diff --git a/Ingegneria del Software/1122_46/correct.txt b/Ingegneria del Software/1122_46/correct.txt new file mode 100644 index 0000000..973ef63 --- /dev/null +++ b/Ingegneria del Software/1122_46/correct.txt @@ -0,0 +1 @@ +State coverage: 75% \ No newline at end of file diff --git a/Ingegneria del Software/1122_46/quest.txt b/Ingegneria del Software/1122_46/quest.txt new file mode 100644 index 0000000..5bf1a08 --- /dev/null +++ b/Ingegneria del Software/1122_46/quest.txt @@ -0,0 +1,14 @@ +La state coverage di un insieme di test cases (cioè sequenze di inputs) per uno state diagram è la percentuale di stati (inclusi START ed END) raggiunti almeno una volta. + +Si consideri lo state diagram in figura +Si consideri il seguente insieme di test cases: + +Test case 1: act2 act1 act1 + +Test case 2: act0 act0 act2 act1 + +Test case 3: act2 act0 act2 act2 act0 + + + +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/1122_46/wrong 1.txt b/Ingegneria del Software/1122_46/wrong 1.txt new file mode 100644 index 0000000..d4625fd --- /dev/null +++ b/Ingegneria del Software/1122_46/wrong 1.txt @@ -0,0 +1 @@ +State coverage: 100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_46/wrong 2.txt b/Ingegneria del Software/1122_46/wrong 2.txt new file mode 100644 index 0000000..4e45af2 --- /dev/null +++ b/Ingegneria del Software/1122_46/wrong 2.txt @@ -0,0 +1 @@ +State coverage: 60% \ No newline at end of file diff --git a/Ingegneria del Software/1122_47/correct.txt b/Ingegneria del Software/1122_47/correct.txt new file mode 100644 index 0000000..475d1ef --- /dev/null +++ b/Ingegneria del Software/1122_47/correct.txt @@ -0,0 +1 @@ +{x = -150, x = -40, x = 0, x = 200, x = 600} \ No newline at end of file diff --git a/Ingegneria del Software/1122_47/quest.txt b/Ingegneria del Software/1122_47/quest.txt new file mode 100644 index 0000000..3631f63 --- /dev/null +++ b/Ingegneria del Software/1122_47/quest.txt @@ -0,0 +1,11 @@ +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 la seguente funzione C: + +int f1(int x) { return (x + 7); } + +Si vuole testare la funzione f1(). A tal fine l'insieme degli interi viene partizionato come segue: + +{(-inf, -101], [-100, -1], {0}, [1, 500], [501, +inf)} + +Quale dei seguenti test cases consegue una partition coverage del 100% ? \ No newline at end of file diff --git a/Ingegneria del Software/1122_47/wrong 1.txt b/Ingegneria del Software/1122_47/wrong 1.txt new file mode 100644 index 0000000..0aaedb8 --- /dev/null +++ b/Ingegneria del Software/1122_47/wrong 1.txt @@ -0,0 +1 @@ +{x = -200, x = -50, x = 0, x = 100, x = 500} \ No newline at end of file diff --git a/Ingegneria del Software/1122_47/wrong 2.txt b/Ingegneria del Software/1122_47/wrong 2.txt new file mode 100644 index 0000000..a6df32d --- /dev/null +++ b/Ingegneria del Software/1122_47/wrong 2.txt @@ -0,0 +1 @@ +{x = -200, x = -150, x = 0, x = 100, x = 700} \ No newline at end of file diff --git a/Ingegneria del Software/1122_48/correct.txt b/Ingegneria del Software/1122_48/correct.txt new file mode 100644 index 0000000..f293f3e --- /dev/null +++ b/Ingegneria del Software/1122_48/correct.txt @@ -0,0 +1 @@ +(a = 6, b = 0, c = 1), (a = 0, b = 5, c = 0), (a = 0, b = 3, c = 0) \ No newline at end of file diff --git a/Ingegneria del Software/1122_48/quest.txt b/Ingegneria del Software/1122_48/quest.txt new file mode 100644 index 0000000..4fc3c18 --- /dev/null +++ b/Ingegneria del Software/1122_48/quest.txt @@ -0,0 +1,24 @@ +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 cases 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 un 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, int b, int c) +{ if ( (a + b - 6 >= 0) && (b - c - 1 <= 0) ) + return (1); // punto di uscita 1 + else if ((b - c - 1 <= 0) || (b + c - 5 >= 0)) + then return (2); // punto di uscita 2 + else return (3); // punto di uscita 3 +} + Quale dei seguenti test set soddisfa il criterio della Condition/Decision coverage ? +\ No newline at end of file diff --git a/Ingegneria del Software/1122_48/wrong 1.txt b/Ingegneria del Software/1122_48/wrong 1.txt new file mode 100644 index 0000000..fc010a3 --- /dev/null +++ b/Ingegneria del Software/1122_48/wrong 1.txt @@ -0,0 +1 @@ +(a = 5, b = 0, c = 1), (a = 0, b = 5, c = 0), (a = 0, b = 3, c = 0) \ No newline at end of file diff --git a/Ingegneria del Software/1122_48/wrong 2.txt b/Ingegneria del Software/1122_48/wrong 2.txt new file mode 100644 index 0000000..eafabb1 --- /dev/null +++ b/Ingegneria del Software/1122_48/wrong 2.txt @@ -0,0 +1 @@ +(a = 6, b = 0, c = 1), (a = 0, b = 5, c = 0), (a = 0, b = 3, c = 2) \ No newline at end of file diff --git a/Ingegneria del Software/1122_49/correct.txt b/Ingegneria del Software/1122_49/correct.txt new file mode 100644 index 0000000..d4b5815 --- /dev/null +++ b/Ingegneria del Software/1122_49/correct.txt @@ -0,0 +1 @@ +Transition coverage: 75% \ No newline at end of file diff --git a/Ingegneria del Software/1122_49/quest.txt b/Ingegneria del Software/1122_49/quest.txt new file mode 100644 index 0000000..e591c8c --- /dev/null +++ b/Ingegneria del Software/1122_49/quest.txt @@ -0,0 +1,12 @@ +img=https://i.imgur.com/rZnqUL9.png +La transition coverage di un insieme di test cases (cioè sequenze 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: + +Test case 1: act1 act0 act2 act0 act0 act0 act2 act1 act1 act0 act2 act0 act2 act2 act1 act1 act0 act2 act2 act2 act1 act1 act2 act0 act1 act0 act1 act2 + +Test case 2: act1 act0 act0 act0 act2 act2 act2 act2 act2 act1 act1 act0 act0 act0 act2 act2 act2 act0 act1 act1 act1 act0 act2 act0 act0 act0 act1 act1 act2 act0 act1 act0 act0 act0 act2 act0 act1 act2 act2 act2 act0 act1 act2 act0 act1 act0 act1 act2 + +Test case 3: act1 act0 act0 act1 act1 act1 act1 act2 act2 act0 act1 act2 + +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/1122_49/wrong 1.txt b/Ingegneria del Software/1122_49/wrong 1.txt new file mode 100644 index 0000000..eb5e1cd --- /dev/null +++ b/Ingegneria del Software/1122_49/wrong 1.txt @@ -0,0 +1 @@ +Transition coverage: 100% \ No newline at end of file diff --git a/Ingegneria del Software/1122_49/wrong 2.txt b/Ingegneria del Software/1122_49/wrong 2.txt new file mode 100644 index 0000000..8b0c318 --- /dev/null +++ b/Ingegneria del Software/1122_49/wrong 2.txt @@ -0,0 +1 @@ +Transition coverage: 50% \ No newline at end of file diff --git a/Ingegneria del Software/1122_5/correct.txt b/Ingegneria del Software/1122_5/correct.txt new file mode 100644 index 0000000..f64e200 --- /dev/null +++ b/Ingegneria del Software/1122_5/correct.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/t6Yscfv.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_5/quest.txt b/Ingegneria del Software/1122_5/quest.txt new file mode 100644 index 0000000..bcbb3d8 --- /dev/null +++ b/Ingegneria del Software/1122_5/quest.txt @@ -0,0 +1,68 @@ +Si consideri il seguente modello Modelica. Quale dei seguenti state diagram lo rappresenta correttamente? ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 3; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_5/wrong 1.txt b/Ingegneria del Software/1122_5/wrong 1.txt new file mode 100644 index 0000000..03aeaee --- /dev/null +++ b/Ingegneria del Software/1122_5/wrong 1.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/AZ8nnvv.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_5/wrong 2.txt b/Ingegneria del Software/1122_5/wrong 2.txt new file mode 100644 index 0000000..ade29f4 --- /dev/null +++ b/Ingegneria del Software/1122_5/wrong 2.txt @@ -0,0 +1 @@ +img=https://i.imgur.com/flqJ7iy.png \ No newline at end of file diff --git a/Ingegneria del Software/1122_50/correct.txt b/Ingegneria del Software/1122_50/correct.txt new file mode 100644 index 0000000..7470aaf --- /dev/null +++ b/Ingegneria del Software/1122_50/correct.txt @@ -0,0 +1,69 @@ ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 2; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 1; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 3; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 1; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_50/quest.txt b/Ingegneria del Software/1122_50/quest.txt new file mode 100644 index 0000000..971e607 --- /dev/null +++ b/Ingegneria del Software/1122_50/quest.txt @@ -0,0 +1,2 @@ +img=https://i.imgur.com/fyv5jqF.png +Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura? \ No newline at end of file diff --git a/Ingegneria del Software/1122_50/wrong 1.txt b/Ingegneria del Software/1122_50/wrong 1.txt new file mode 100644 index 0000000..e77e043 --- /dev/null +++ b/Ingegneria del Software/1122_50/wrong 1.txt @@ -0,0 +1,69 @@ ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 2) then x := 1; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 3; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 3; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 1; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_50/wrong 2.txt b/Ingegneria del Software/1122_50/wrong 2.txt new file mode 100644 index 0000000..03c4dea --- /dev/null +++ b/Ingegneria del Software/1122_50/wrong 2.txt @@ -0,0 +1,71 @@ ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 1; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 2; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 1; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_6/correct.txt b/Ingegneria del Software/1122_6/correct.txt new file mode 100644 index 0000000..cf8581f --- /dev/null +++ b/Ingegneria del Software/1122_6/correct.txt @@ -0,0 +1 @@ +Costruire un prototipo, metterlo in esercizio ed accertarsi che i porti i benefici attesi \ No newline at end of file diff --git a/Ingegneria del Software/1122_6/quest.txt b/Ingegneria del Software/1122_6/quest.txt new file mode 100644 index 0000000..b17d629 --- /dev/null +++ b/Ingegneria del Software/1122_6/quest.txt @@ -0,0 +1 @@ +Quali delle seguenti attività può contribuire a validare i requisiti di un sistema? \ No newline at end of file diff --git a/Ingegneria del Software/1122_6/wrong 1.txt b/Ingegneria del Software/1122_6/wrong 1.txt new file mode 100644 index 0000000..2cddbca --- /dev/null +++ b/Ingegneria del Software/1122_6/wrong 1.txt @@ -0,0 +1 @@ +Costruire un prototipo e valutarne attentamente le performance \ No newline at end of file diff --git a/Ingegneria del Software/1122_6/wrong 2.txt b/Ingegneria del Software/1122_6/wrong 2.txt new file mode 100644 index 0000000..04f8a5e --- /dev/null +++ b/Ingegneria del Software/1122_6/wrong 2.txt @@ -0,0 +1 @@ +Costruire un prototipo e testarlo a fondo per evidenziare subito errori di implementazione \ No newline at end of file diff --git a/Ingegneria del Software/1122_7/correct.txt b/Ingegneria del Software/1122_7/correct.txt new file mode 100644 index 0000000..ce9968f --- /dev/null +++ b/Ingegneria del Software/1122_7/correct.txt @@ -0,0 +1 @@ +0.28 \ No newline at end of file diff --git a/Ingegneria del Software/1122_7/quest.txt b/Ingegneria del Software/1122_7/quest.txt new file mode 100644 index 0000000..8db1ade --- /dev/null +++ b/Ingegneria del Software/1122_7/quest.txt @@ -0,0 +1,10 @@ +img=https://i.imgur.com/5TP66IN.png +Un processo software può essere rappesentato con uno state diagram in cui gli stati rappresentano le fasi (e loro iterazioni) del processo software e gli archi le transizioni da una fase all'altra. Gli archi sono etichettati con le probabilità della transizione e gli stati sono etichettati con il costo per lasciare lo stato. + +Ad esempio lo state diagram in figura rappresenta un processo software con 2 fasi F1 ed F2. +F1 ha costo 10000 EUR ed F2 ha costo 1000 EUR. +F1 ha una probabilita dello 0.4 di dover essere ripetuta (a causa di errori) ed F2 ha una probabilità 0.3 di dover essere ripetuta (a causa di errori). + +Uno scenario è una sequenza di stati. + +Qual è la probabilità dello scenario: 1, 2, 3? In altri terminti, qual è la probabilità che non sia necessario ripetere la prima fase (ma non la seconda)? \ No newline at end of file diff --git a/Ingegneria del Software/1122_7/wrong 1.txt b/Ingegneria del Software/1122_7/wrong 1.txt new file mode 100644 index 0000000..e8f9017 --- /dev/null +++ b/Ingegneria del Software/1122_7/wrong 1.txt @@ -0,0 +1 @@ +0.42 \ No newline at end of file diff --git a/Ingegneria del Software/1122_7/wrong 2.txt b/Ingegneria del Software/1122_7/wrong 2.txt new file mode 100644 index 0000000..f2bb2d0 --- /dev/null +++ b/Ingegneria del Software/1122_7/wrong 2.txt @@ -0,0 +1 @@ +0.12 \ No newline at end of file diff --git a/Ingegneria del Software/1122_8/correct.txt b/Ingegneria del Software/1122_8/correct.txt new file mode 100644 index 0000000..1c7da8c --- /dev/null +++ b/Ingegneria del Software/1122_8/correct.txt @@ -0,0 +1 @@ +0.03 \ No newline at end of file diff --git a/Ingegneria del Software/1122_8/quest.txt b/Ingegneria del Software/1122_8/quest.txt new file mode 100644 index 0000000..1f66143 --- /dev/null +++ b/Ingegneria del Software/1122_8/quest.txt @@ -0,0 +1,8 @@ +img=https://i.imgur.com/5TP66IN.png +Un processo software può essere rappesentato con uno state diagram in cui gli stati rappresentano le fasi (e loro iterazioni) del prcoesso software e gli archi le transizioni da una fase all'altra. Gli archi sono etichettati con le probabilità della transizione e gli stati sono etichettati con il costo per lasciare lo stato. + +Ad esempio lo state diagram in figura rappresenta un processo software con 2 fasi F1 ed F2. F1 ha costo 10000 EUR ed F2 ha costo 1000 EUR. F1 ha una probabilita dello 0.3 di dover essere ripetuta (a causa di errori) ed F2 ha una probabilità 0.1 di dover essere ripetuta (a causa di errori). + +Uno scenario è una sequenza di stati. + +Qual è la probabilità dello scenario: 1, 2, 3, 4 ? In altri terminti, qual è la probabilità che sia necessario ripetere sia la fase 1 che la fase 2? \ No newline at end of file diff --git a/Ingegneria del Software/1122_8/wrong 1.txt b/Ingegneria del Software/1122_8/wrong 1.txt new file mode 100644 index 0000000..7eb6830 --- /dev/null +++ b/Ingegneria del Software/1122_8/wrong 1.txt @@ -0,0 +1 @@ +0.27 \ No newline at end of file diff --git a/Ingegneria del Software/1122_8/wrong 2.txt b/Ingegneria del Software/1122_8/wrong 2.txt new file mode 100644 index 0000000..8a346b7 --- /dev/null +++ b/Ingegneria del Software/1122_8/wrong 2.txt @@ -0,0 +1 @@ +0.07 \ No newline at end of file diff --git a/Ingegneria del Software/1122_9/correct.txt b/Ingegneria del Software/1122_9/correct.txt new file mode 100644 index 0000000..a7a3133 --- /dev/null +++ b/Ingegneria del Software/1122_9/correct.txt @@ -0,0 +1,44 @@ ++block FSA // Finite State Automaton + + +/* connector declarations outside this block: +connector InputInteger = input Integer; +connector OutputInteger = output Integer; +*/ + + +InputInteger u; // external input +OutputInteger x; // state +parameter Real T = 1; + + +algorithm + + +when initial() then +x := 0; + + +elsewhen sample(0,T) then + + +if (pre(x) == 0) and (pre(u) == 0) then x := 3; +elseif (pre(x) == 0) and (pre(u) == 1) then x := 1; +elseif (pre(x) == 1) and (pre(u) == 0) then x := 3; +elseif (pre(x) == 1) and (pre(u) == 1) then x := 0; +elseif (pre(x) == 1) and (pre(u) == 2) then x := 0; +elseif (pre(x) == 2) and (pre(u) == 0) then x := 3; +elseif (pre(x) == 2) and (pre(u) == 2) then x := 4; +elseif (pre(x) == 3) and (pre(u) == 0) then x := 4; +elseif (pre(x) == 3) and (pre(u) == 1) then x := 4; +elseif (pre(x) == 3) and (pre(u) == 2) then x := 1; +elseif (pre(x) == 4) and (pre(u) == 1) then x := 1; +elseif (pre(x) == 4) and (pre(u) == 2) then x := 0; +else x := pre(x); // default +end if; + + +end when; +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_9/quest.txt b/Ingegneria del Software/1122_9/quest.txt new file mode 100644 index 0000000..0e4c593 --- /dev/null +++ b/Ingegneria del Software/1122_9/quest.txt @@ -0,0 +1,2 @@ +img=https://i.imgur.com/Jq6EzV9.png +Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura? \ No newline at end of file diff --git a/Ingegneria del Software/1122_9/wrong 1.txt b/Ingegneria del Software/1122_9/wrong 1.txt new file mode 100644 index 0000000..ea67dd7 --- /dev/null +++ b/Ingegneria del Software/1122_9/wrong 1.txt @@ -0,0 +1,71 @@ ++block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 2; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 3; + +elseif (pre(x) == 1) and (pre(u) == 0) then x := 3; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 2; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 1; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 1; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 3; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/1122_9/wrong 2.txt b/Ingegneria del Software/1122_9/wrong 2.txt new file mode 100644 index 0000000..578bb6b --- /dev/null +++ b/Ingegneria del Software/1122_9/wrong 2.txt @@ -0,0 +1,76 @@ ++ +block FSA // Finite State Automaton + + + +/* connector declarations outside this block: + +connector InputInteger = input Integer; + +connector OutputInteger = output Integer; + +*/ + + + +InputInteger u; // external input + +OutputInteger x; // state + +parameter Real T = 1; + + + +algorithm + + + +when initial() then + +x := 0; + + + +elsewhen sample(0,T) then + + + +if (pre(x) == 0) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 0) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 0) and (pre(u) == 2) then x := 4; + +elseif (pre(x) == 1) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 1) and (pre(u) == 2) then x := 3; + +elseif (pre(x) == 2) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 2) and (pre(u) == 1) then x := 3; + +elseif (pre(x) == 2) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 3) and (pre(u) == 0) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 1) then x := 4; + +elseif (pre(x) == 3) and (pre(u) == 2) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 0) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 1) then x := 0; + +elseif (pre(x) == 4) and (pre(u) == 2) then x := 2; + +else x := pre(x); // default + +end if; + + + +end when; + +end FSA; +\ No newline at end of file diff --git a/Ingegneria del Software/18/quest.txt b/Ingegneria del Software/18/quest.txt deleted file mode 100644 index dac6767..0000000 --- a/Ingegneria del Software/18/quest.txt +++ /dev/null @@ -1,2 +0,0 @@ -Quale delle seguenti frasi meglio descrive il criterio di "requirements verifiability" che è parte della "requirements -validation activity". \ No newline at end of file diff --git a/Ingegneria del Software/27/quest.txt b/Ingegneria del Software/27/quest.txt deleted file mode 100644 index bb0692c..0000000 --- a/Ingegneria del Software/27/quest.txt +++ /dev/null @@ -1,4 +0,0 @@ -Si consideri il seguente requisito: -RQ1: Durante l'esecuzione del programma (cioè per tutti gli istanti di tempo positivi) la variabile x è sempre nell'intervallo -[0, 5] oppure [10, 15] -Quale dei seguenti monitor meglio descrive il requisito RQ1 ? \ No newline at end of file diff --git a/Ingegneria del Software/30/quest.txt b/Ingegneria del Software/30/quest.txt deleted file mode 100644 index f2ab4c4..0000000 --- a/Ingegneria del Software/30/quest.txt +++ /dev/null @@ -1,3 +0,0 @@ -Si consideri il seguente requisito: -RQ1: Dopo 20 unità di tempo dall'inizio dell'esecuzione la variabile x è sempre nell'intervallo [20, 30] . -Quale dei seguenti monitor meglio descrive il requisito RQ1 ? \ No newline at end of file diff --git a/Ingegneria del Software/36/quest.txt b/Ingegneria del Software/36/quest.txt deleted file mode 100644 index efd8c1c..0000000 --- a/Ingegneria del Software/36/quest.txt +++ /dev/null @@ -1,4 +0,0 @@ -Si consideri il seguente requisito: -RQ: Dopo 10 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà: se la variabile x è nell'intervallo [10, 20] -allora la variabile y è compresa tra il 50% di x ed il 70% di x. -Quale dei seguenti monitor meglio descrive il requisito RQ ? \ No newline at end of file diff --git a/Ingegneria del Software/37/correct.txt b/Ingegneria del Software/37/correct.txt deleted file mode 100644 index 0902686..0000000 --- a/Ingegneria del Software/37/correct.txt +++ /dev/null @@ -1 +0,0 @@ -Requisito funzionale. \ No newline at end of file diff --git a/Ingegneria del Software/37/wrong.txt b/Ingegneria del Software/37/wrong.txt deleted file mode 100644 index 396c8d3..0000000 --- a/Ingegneria del Software/37/wrong.txt +++ /dev/null @@ -1 +0,0 @@ -Requisito di performance. \ No newline at end of file