mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-03-14 12:46:15 +01:00
ingsw: Add 09-22
This commit is contained in:
parent
fb2aa7120e
commit
1b1633659c
64 changed files with 1312 additions and 0 deletions
69
Ingegneria del Software/0922_10/correct.txt
Normal file
69
Ingegneria del Software/0922_10/correct.txt
Normal file
|
@ -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) == 0) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 0) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 2) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 0) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
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 := 0;
|
||||||
|
|
||||||
|
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;
|
2
Ingegneria del Software/0922_10/quest.txt
Normal file
2
Ingegneria del Software/0922_10/quest.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
img=https://i.imgur.com/okpLYQL.png
|
||||||
|
Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura ?
|
67
Ingegneria del Software/0922_10/wrong 1.txt
Normal file
67
Ingegneria del Software/0922_10/wrong 1.txt
Normal file
|
@ -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 := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
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 := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 2) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 1) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 2) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 2) then x := 0;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
69
Ingegneria del Software/0922_10/wrong 2.txt
Normal file
69
Ingegneria del Software/0922_10/wrong 2.txt
Normal file
|
@ -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 := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
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) == 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) == 2) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 0) then x := 0;
|
||||||
|
|
||||||
|
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 := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 1) then x := 1;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
1
Ingegneria del Software/0922_11/correct.txt
Normal file
1
Ingegneria del Software/0922_11/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
60%
|
19
Ingegneria del Software/0922_11/quest.txt
Normal file
19
Ingegneria del Software/0922_11/quest.txt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
img=https://i.imgur.com/im1GU0x.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 act1 act2 act2
|
||||||
|
|
||||||
|
Test case 2: act2 act2 act1 act2 act1 act2 act1 act2 act1 act2 act2 act1 act1 act2 act1 act2 act2 act2
|
||||||
|
|
||||||
|
Test case 3: act2 act2 act0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra?
|
1
Ingegneria del Software/0922_11/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_11/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
100%
|
1
Ingegneria del Software/0922_11/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_11/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
80%
|
1
Ingegneria del Software/0922_12/correct.txt
Normal file
1
Ingegneria del Software/0922_12/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
90%
|
17
Ingegneria del Software/0922_12/quest.txt
Normal file
17
Ingegneria del Software/0922_12/quest.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
img=https://i.imgur.com/rWKWcCt.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 act0 act2 act2 act0 act1 act1 act0 act0 act2 act0 act2 act2 act2 act1 act2 act2 act0 act0 act2 act1 act0 act0 act2 act2 act2 act0 act2 act2 act0 act2 act0 act1 act2 act1 act1 act1 act1 act0 act1 act0 act1 act2 act1 act2 act0
|
||||||
|
|
||||||
|
Test case 2: act0
|
||||||
|
|
||||||
|
Test case 3: act2 act0 act2 act2 act0 act2 act0 act2 act2 act2 act0 act0 act1 act2 act0 act2 act2 act0 act2 act2 act0 act2 act0 act2 act2 act2 act0 act1 act1 act1 act0 act0 act1 act1 act2 act0 act0 act2 act1 act0 act2 act2 act0 act2 act2 act0 act0 act2 act0 act1 act0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra?
|
1
Ingegneria del Software/0922_12/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_12/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
100%
|
1
Ingegneria del Software/0922_12/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_12/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
50%
|
1
Ingegneria del Software/0922_13/correct.txt
Normal file
1
Ingegneria del Software/0922_13/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
50%
|
15
Ingegneria del Software/0922_13/quest.txt
Normal file
15
Ingegneria del Software/0922_13/quest.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
img=https://i.imgur.com/em6ovKG.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 act0
|
||||||
|
|
||||||
|
Test case 2: act2 act1 act2 act0 act0 act0 act1 act0 act0 act1 act0
|
||||||
|
|
||||||
|
Test case 3: act2 act0
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra?
|
1
Ingegneria del Software/0922_13/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_13/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
100%
|
1
Ingegneria del Software/0922_13/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_13/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
35%
|
71
Ingegneria del Software/0922_14/correct.txt
Normal file
71
Ingegneria del Software/0922_14/correct.txt
Normal file
|
@ -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 := 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) == 0) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 1) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 0) then x := 3;
|
||||||
|
|
||||||
|
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) == 2) then x := 1;
|
||||||
|
|
||||||
|
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;
|
2
Ingegneria del Software/0922_14/quest.txt
Normal file
2
Ingegneria del Software/0922_14/quest.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
img=https://i.imgur.com/512MuK3.png
|
||||||
|
Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura ?
|
71
Ingegneria del Software/0922_14/wrong 1.txt
Normal file
71
Ingegneria del Software/0922_14/wrong 1.txt
Normal file
|
@ -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 := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 1) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 0) then x := 1;
|
||||||
|
|
||||||
|
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 := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 1) then x := 1;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
||||||
|
|
69
Ingegneria del Software/0922_14/wrong 2.txt
Normal file
69
Ingegneria del Software/0922_14/wrong 2.txt
Normal file
|
@ -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 := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 1) then x := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 2) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 0) then x := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 1) 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 := 0;
|
||||||
|
|
||||||
|
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 := 2;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
1
Ingegneria del Software/0922_15/correct.txt
Normal file
1
Ingegneria del Software/0922_15/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
60%
|
16
Ingegneria del Software/0922_15/quest.txt
Normal file
16
Ingegneria del Software/0922_15/quest.txt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
img=https://i.imgur.com/02dquYj.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: act0
|
||||||
|
|
||||||
|
Test case 2: act1 act0 act2 act2 act2 act0 act2 act1 act2 act0 act1 act0
|
||||||
|
|
||||||
|
Test case 3: act2 act0
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra?
|
1
Ingegneria del Software/0922_15/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_15/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
75%
|
1
Ingegneria del Software/0922_15/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_15/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
90%
|
1
Ingegneria del Software/0922_16/correct.txt
Normal file
1
Ingegneria del Software/0922_16/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/Zzrmwyx.png
|
75
Ingegneria del Software/0922_16/quest.txt
Normal file
75
Ingegneria del Software/0922_16/quest.txt
Normal file
|
@ -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 := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 1) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 2) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 1) then x := 2;
|
||||||
|
|
||||||
|
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 := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 0) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 0) then x := 1;
|
||||||
|
|
||||||
|
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;
|
1
Ingegneria del Software/0922_16/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_16/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/3ANMdkr.png
|
1
Ingegneria del Software/0922_16/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_16/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/2RoLmLS.png
|
69
Ingegneria del Software/0922_17/correct.txt
Normal file
69
Ingegneria del Software/0922_17/correct.txt
Normal file
|
@ -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) == 1) then x := 4;
|
||||||
|
|
||||||
|
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) == 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) == 2) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 0) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 1) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
2
Ingegneria del Software/0922_17/quest.txt
Normal file
2
Ingegneria del Software/0922_17/quest.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
img=https://i.imgur.com/WSvoelw.png
|
||||||
|
Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura ?
|
74
Ingegneria del Software/0922_17/wrong 1.txt
Normal file
74
Ingegneria del Software/0922_17/wrong 1.txt
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
|
||||||
|
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) == 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 := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 0) then x := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 1) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
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) == 0) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 1) 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;
|
69
Ingegneria del Software/0922_17/wrong 2.txt
Normal file
69
Ingegneria del Software/0922_17/wrong 2.txt
Normal file
|
@ -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) == 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 := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 1) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 2) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 0) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 1) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 0) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 1) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 2) then x := 0;
|
||||||
|
|
||||||
|
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;
|
1
Ingegneria del Software/0922_18/correct.txt
Normal file
1
Ingegneria del Software/0922_18/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/WRn8QOi.png
|
75
Ingegneria del Software/0922_18/quest.txt
Normal file
75
Ingegneria del Software/0922_18/quest.txt
Normal file
|
@ -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 := 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) == 0) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 1) then x := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 2) 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) == 0) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 1) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 2) then x := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 0) then x := 2;
|
||||||
|
|
||||||
|
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;
|
1
Ingegneria del Software/0922_18/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_18/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/oUj28ho.png
|
1
Ingegneria del Software/0922_18/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_18/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/eVnEYDY.png
|
1
Ingegneria del Software/0922_3/correct.txt
Normal file
1
Ingegneria del Software/0922_3/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/VgLa2I6.png
|
77
Ingegneria del Software/0922_3/quest.txt
Normal file
77
Ingegneria del Software/0922_3/quest.txt
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
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 := 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 := 1;
|
||||||
|
|
||||||
|
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 := 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 := 1;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
1
Ingegneria del Software/0922_3/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_3/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/5MjNRI5.png
|
1
Ingegneria del Software/0922_3/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_3/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/ugOv25D.png
|
1
Ingegneria del Software/0922_4/correct.txt
Normal file
1
Ingegneria del Software/0922_4/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
75%
|
16
Ingegneria del Software/0922_4/quest.txt
Normal file
16
Ingegneria del Software/0922_4/quest.txt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
img=https://i.imgur.com/PkKCYTb.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 act0 act1 act1 act0 act2 act1 act2 act2 act1 act2 act0 act1 act2 act0 act2 act2 act0 act1 act1 act2 act2 act0 act0 act2 act2 act2 act0 act2 act0 act1 act1 act0 act2 act1 act2 act1 act0 act0 act0 act0 act2 act2 act1 act1 act1 act1 act0
|
||||||
|
|
||||||
|
Test case 2: act1 act2 act0 act2 act2 act1 act1 act0 act1 act2 act2 act0
|
||||||
|
|
||||||
|
Test case 3: act1 act1 act2 act0 act1 act0
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della state coverage per i test cases di cui sopra
|
1
Ingegneria del Software/0922_4/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_4/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
100%
|
1
Ingegneria del Software/0922_4/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_4/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
60%
|
67
Ingegneria del Software/0922_5/correct.txt
Normal file
67
Ingegneria del Software/0922_5/correct.txt
Normal file
|
@ -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 := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
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) == 1) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 0) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 0) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 1) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
2
Ingegneria del Software/0922_5/quest.txt
Normal file
2
Ingegneria del Software/0922_5/quest.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
img=https://i.imgur.com/XthureL.png
|
||||||
|
Quale dei seguenti modelli Modelica rappresenta lo state diagram in figura ?
|
69
Ingegneria del Software/0922_5/wrong 1.txt
Normal file
69
Ingegneria del Software/0922_5/wrong 1.txt
Normal file
|
@ -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) == 2) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 0) then x := 3;
|
||||||
|
|
||||||
|
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 := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 1) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
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 := 3;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
71
Ingegneria del Software/0922_5/wrong 2.txt
Normal file
71
Ingegneria del Software/0922_5/wrong 2.txt
Normal file
|
@ -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) == 1) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 2) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 0) then x := 3;
|
||||||
|
|
||||||
|
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) == 2) and (pre(u) == 0) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 1) then x := 4;
|
||||||
|
|
||||||
|
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) == 2) then x := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 0) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 1) then x := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 4) and (pre(u) == 2) then x := 0;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
1
Ingegneria del Software/0922_6/correct.txt
Normal file
1
Ingegneria del Software/0922_6/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/2GmgSsg.png
|
73
Ingegneria del Software/0922_6/quest.txt
Normal file
73
Ingegneria del Software/0922_6/quest.txt
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
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 := 2;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 1) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 0) and (pre(u) == 2) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 1) and (pre(u) == 0) then x := 3;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 0) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 1) then x := 4;
|
||||||
|
|
||||||
|
elseif (pre(x) == 2) and (pre(u) == 2) then x := 1;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 0) then x := 0;
|
||||||
|
|
||||||
|
elseif (pre(x) == 3) and (pre(u) == 1) then x := 4;
|
||||||
|
|
||||||
|
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) == 2) then x := 0;
|
||||||
|
|
||||||
|
else x := pre(x); // default
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end when;
|
||||||
|
|
||||||
|
end FSA;
|
1
Ingegneria del Software/0922_6/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_6/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/vB4iDg8.png
|
1
Ingegneria del Software/0922_6/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_6/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
img=https://i.imgur.com/5Mtuh64.png
|
1
Ingegneria del Software/0922_7/correct.txt
Normal file
1
Ingegneria del Software/0922_7/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 85%
|
15
Ingegneria del Software/0922_7/quest.txt
Normal file
15
Ingegneria del Software/0922_7/quest.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
img=https://i.imgur.com/YoZA1G0.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 act2 act1 act2 act1 act1 act0 act1 act2 act0 act1 act2 act1 act2 act1 act0 act0 act2 act2 act0 act1 act1 act2 act2 act2 act0 act1 act2 act2 act1
|
||||||
|
|
||||||
|
Test case 2: act1 act2 act0 act0 act2 act2 act2 act2 act2 act1 act2 act0 act0 act2 act1 act2 act2 act2 act0 act0 act2 act1 act2 act2 act2 act0 act0 act1
|
||||||
|
|
||||||
|
Test case 3: act1 act1
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della state coverage per i test cases di cui sopra
|
1
Ingegneria del Software/0922_7/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_7/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 60%
|
1
Ingegneria del Software/0922_7/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_7/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 100%
|
1
Ingegneria del Software/0922_8/correct.txt
Normal file
1
Ingegneria del Software/0922_8/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 60%
|
18
Ingegneria del Software/0922_8/quest.txt
Normal file
18
Ingegneria del Software/0922_8/quest.txt
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
img=https://i.imgur.com/PqUZdeV.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
|
||||||
|
|
||||||
|
Test case 2: act0 act0 act1 act1 act0 act1 act2 act0 act0 act1 act1 act2 act1 act2 act0 act0 act0 act2
|
||||||
|
|
||||||
|
|
||||||
|
Test case 3: act2 act0 act1 act2 act2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della state coverage per i test cases di cui sopra
|
1
Ingegneria del Software/0922_8/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_8/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 75%
|
1
Ingegneria del Software/0922_8/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_8/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 90%
|
1
Ingegneria del Software/0922_9/correct.txt
Normal file
1
Ingegneria del Software/0922_9/correct.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 75%
|
17
Ingegneria del Software/0922_9/quest.txt
Normal file
17
Ingegneria del Software/0922_9/quest.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
img=https://i.imgur.com/dIi2Wn7.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 act0 act2 act1 act2 act0 act2 act0 act0 act0 act0 act0 act2
|
||||||
|
|
||||||
|
Test case 2: act1 act2 act1 act2 act0 act2 act1 act2 act2
|
||||||
|
|
||||||
|
Test case 3: act2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Quale delle seguenti è la migliore stima della state coverage per i test cases di cui sopra
|
1
Ingegneria del Software/0922_9/wrong 1.txt
Normal file
1
Ingegneria del Software/0922_9/wrong 1.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 90%
|
1
Ingegneria del Software/0922_9/wrong 2.txt
Normal file
1
Ingegneria del Software/0922_9/wrong 2.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
State coverage: 60%
|
Loading…
Reference in a new issue