mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-03-14 13:06:14 +01:00
commit
06252781a6
174 changed files with 1505 additions and 21 deletions
|
@ -1 +0,0 @@
|
|||
S = (1/b)*ln(C/R)
|
|
@ -1 +0,0 @@
|
|||
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 = exp(-b*S), dove b è una opportuna costante note da dati storici aziendali. Quale sarà il costo dello sviluppo S di un software il cui costo della failure è C ed il rischio ammesso è R?
|
|
@ -1 +0,0 @@
|
|||
S = b*ln(R/C)
|
|
@ -1 +0,0 @@
|
|||
S = (1/b)*ln(R/C)
|
|
@ -1 +0,0 @@
|
|||
Plan driven
|
|
@ -1 +0,0 @@
|
|||
Un azienda ha un team di sviluppo in cui il 90% dei membri è junior (cioè con poca esperienza) ed il 10% è senior (cioè con molta esperienza). Con l'obiettivo di massimizzare il numero di progetti completati nell'unità di tempo, quale dei seguenti modelli di sviluppo software appare più opportuno.
|
|
@ -1 +0,0 @@
|
|||
Basato sul riuso
|
|
@ -1 +0,0 @@
|
|||
Iterativo
|
|
@ -1 +0,0 @@
|
|||
Gli utenti del sistema lavorano insieme al team di sviluppo per testare il software nel sito di sviluppo.
|
|
@ -1 +0,0 @@
|
|||
Quale delle seguenti affermazioni è vera riguardo all'alpha testing ?
|
|
@ -1 +0,0 @@
|
|||
Test automatizzati sono eseguiti sulla prima release del sistema.
|
|
@ -1 +0,0 @@
|
|||
Test automatizzati sono eseguiti su una versione preliminare del sistema.
|
|
@ -1 +0,0 @@
|
|||
Sviluppo Plan-driven.
|
|
@ -1 +0,0 @@
|
|||
Si pianifica lo sviluppo di un sistema software per controllare il sistema di anti-lock braking in un automobile. Quale dei seguenti è il tipico processo software usato per questo tipo di sistema software ?
|
|
@ -1 +0,0 @@
|
|||
Extreme programming.
|
|
@ -1 +0,0 @@
|
|||
Sviluppo Iterativo.
|
1
Ingegneria del Software/0721_1/correct.txt
Normal file
1
Ingegneria del Software/0721_1/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Per tutti gli istanti di tempo della forma 1 + 4*k (con k = 0, 1, 2, 3, ...) x vale 1.
|
13
Ingegneria del Software/0721_1/quest.txt
Normal file
13
Ingegneria del Software/0721_1/quest.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
Si consideri il seguente modello Modelica:
|
||||
<pre>
|
||||
class System
|
||||
Integer x;
|
||||
initial equation
|
||||
x = 0;
|
||||
equation
|
||||
when sample(0, 2) then
|
||||
x = 1 - pre(x);
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
||||
Quale delle seguenti affermazioni è vera per la variabile intera x?
|
1
Ingegneria del Software/0721_1/wrong1.txt
Normal file
1
Ingegneria del Software/0721_1/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Per tutti gli istanti di tempo della forma 3 + 4*k (con k = 0, 1, 2, 3, ...) x vale 1.
|
1
Ingegneria del Software/0721_1/wrong2.txt
Normal file
1
Ingegneria del Software/0721_1/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Per tutti gli istanti di tempo della forma 1 + 4*k (con k = 0, 1, 2, 3, ...) x vale 0.
|
1
Ingegneria del Software/0721_10/correct.txt
Normal file
1
Ingegneria del Software/0721_10/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Il performance testing è tipicamente eseguito una volta che il sistema è stato completamento integrato.
|
1
Ingegneria del Software/0721_10/quest.txt
Normal file
1
Ingegneria del Software/0721_10/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Quale delle seguenti affermazioni è vera riguardo al performance testing?
|
1
Ingegneria del Software/0721_10/wrong1.txt
Normal file
1
Ingegneria del Software/0721_10/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Il performance testing è tipicamente eseguito su un prototipo del sistema.
|
1
Ingegneria del Software/0721_10/wrong2.txt
Normal file
1
Ingegneria del Software/0721_10/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Il performance testing è tipicamente eseguito solo sulle componenti del sistema prima dell'integrazione.
|
15
Ingegneria del Software/0721_11/correct.txt
Normal file
15
Ingegneria del Software/0721_11/correct.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
5
Ingegneria del Software/0721_11/quest.txt
Normal file
5
Ingegneria del Software/0721_11/quest.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
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 ?
|
15
Ingegneria del Software/0721_11/wrong1.txt
Normal file
15
Ingegneria del Software/0721_11/wrong1.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
15
Ingegneria del Software/0721_11/wrong2.txt
Normal file
15
Ingegneria del Software/0721_11/wrong2.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
1
Ingegneria del Software/0721_12/correct.txt
Normal file
1
Ingegneria del Software/0721_12/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo, eseguirlo usando dati storici dai log di produzione e valutare la capacità del prototipo di ridurre gli scarti.
|
1
Ingegneria del Software/0721_12/quest.txt
Normal file
1
Ingegneria del Software/0721_12/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Una azienda manifatturiera desidera costruire un sistema software per monitorare (attraverso sensori) la produzione al fine di ridurre gli scarti. Quali delle seguenti attività contribuisce a validare i requisiti del sistema.
|
1
Ingegneria del Software/0721_12/wrong1.txt
Normal file
1
Ingegneria del Software/0721_12/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo, eseguirlo usando dati storici dai log di produzione e valutarne le performance.
|
1
Ingegneria del Software/0721_12/wrong2.txt
Normal file
1
Ingegneria del Software/0721_12/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo, eseguirlo usando dati storici dai log di produzione ed identificare errori di implementazione.
|
18
Ingegneria del Software/0721_13/correct.txt
Normal file
18
Ingegneria del Software/0721_13/correct.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
<pre>
|
||||
function next
|
||||
input Integer x;
|
||||
output Integer y;
|
||||
algorithm
|
||||
y := 1 - x;
|
||||
end next;
|
||||
|
||||
class System
|
||||
Integer x;
|
||||
initial equation
|
||||
x = 0;
|
||||
equation
|
||||
when sample(0, 1) then
|
||||
x = next(pre(x));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
4
Ingegneria del Software/0721_13/quest.txt
Normal file
4
Ingegneria del Software/0721_13/quest.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
Si consideri l'automa seguente:
|
||||
0->1 e 1->0
|
||||
|
||||
Quale dei seguenti modelli Modelica fornisce un modello ragionevole per l'automa di cui sopra.
|
18
Ingegneria del Software/0721_13/wrong1.txt
Normal file
18
Ingegneria del Software/0721_13/wrong1.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
<pre>
|
||||
function next
|
||||
input Integer x;
|
||||
output Integer y;
|
||||
algorithm
|
||||
y := 1 - x;
|
||||
end next;
|
||||
|
||||
class System
|
||||
Integer x;
|
||||
initial equation
|
||||
x = 0;
|
||||
equation
|
||||
when sample(0, 1) then
|
||||
x = next(pre(x));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
18
Ingegneria del Software/0721_13/wrong2.txt
Normal file
18
Ingegneria del Software/0721_13/wrong2.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
<pre>
|
||||
function next
|
||||
input Integer x;
|
||||
output Integer y;
|
||||
algorithm
|
||||
y := x;
|
||||
end next;
|
||||
|
||||
class System
|
||||
Integer x;
|
||||
initial equation
|
||||
x = 0;
|
||||
equation
|
||||
when sample(0, 1) then
|
||||
x = next(pre(x));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
17
Ingegneria del Software/0721_14/correct.txt
Normal file
17
Ingegneria del Software/0721_14/correct.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
3
Ingegneria del Software/0721_14/quest.txt
Normal file
3
Ingegneria del Software/0721_14/quest.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
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 ?
|
17
Ingegneria del Software/0721_14/wrong1.txt
Normal file
17
Ingegneria del Software/0721_14/wrong1.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
17
Ingegneria del Software/0721_14/wrong2.txt
Normal file
17
Ingegneria del Software/0721_14/wrong2.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
1
Ingegneria del Software/0721_15/correct.txt
Normal file
1
Ingegneria del Software/0721_15/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo, metterlo in esercizio ed accertarsi che i porti i benefici attesi.
|
1
Ingegneria del Software/0721_15/quest.txt
Normal file
1
Ingegneria del Software/0721_15/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Quali delle seguenti attività può contribuire a validare i requisiti di un sistema ?
|
1
Ingegneria del Software/0721_15/wrong1.txt
Normal file
1
Ingegneria del Software/0721_15/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo e valutarne attentamente le performance.
|
1
Ingegneria del Software/0721_15/wrong2.txt
Normal file
1
Ingegneria del Software/0721_15/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo e testarlo a fondo per evidenziare subito errori di implementazione.
|
1
Ingegneria del Software/0721_16/correct.txt
Normal file
1
Ingegneria del Software/0721_16/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Testare l'interazione tra le componenti del sistema (cioè, integrazione di molte unità di sistema).
|
1
Ingegneria del Software/0721_16/quest.txt
Normal file
1
Ingegneria del Software/0721_16/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Il system testing si concentra su:
|
1
Ingegneria del Software/0721_16/wrong1.txt
Normal file
1
Ingegneria del Software/0721_16/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Testare le interfacce per ciascuna componente.
|
1
Ingegneria del Software/0721_16/wrong2.txt
Normal file
1
Ingegneria del Software/0721_16/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Testare le funzionalità di unità software individuali, oggetti, classi o metodi.
|
1
Ingegneria del Software/0721_17/correct.txt
Normal file
1
Ingegneria del Software/0721_17/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Ad ogni istante di tempo della forma 1 + 4*k (k = 0, 1, 2, 3, ...), x vale "true".
|
13
Ingegneria del Software/0721_17/quest.txt
Normal file
13
Ingegneria del Software/0721_17/quest.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
Si consideri il seguente modello Modelica.
|
||||
<pre>
|
||||
class System
|
||||
Boolean x;
|
||||
initial equation
|
||||
x = false;
|
||||
equation
|
||||
when sample(0, 2) then
|
||||
x = not (pre(x));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
||||
Quale delle seguenti affermazioni vale per la variabile booleana x ?
|
1
Ingegneria del Software/0721_17/wrong1.txt
Normal file
1
Ingegneria del Software/0721_17/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
At time instants of form 1 + 4*k (with k = 0, 1, 2, 3, ...) x takes value "false".
|
1
Ingegneria del Software/0721_17/wrong2.txt
Normal file
1
Ingegneria del Software/0721_17/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Ad ogni istante di tempo della forma 3 + 4*k (k = 0, 1, 2, 3, ...), x vale "true".
|
16
Ingegneria del Software/0721_18/correct.txt
Normal file
16
Ingegneria del Software/0721_18/correct.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
<pre>
|
||||
model Env
|
||||
Integer x; // Pulsante premuto dall'utente
|
||||
Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
x := 0;
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
if (r1024 <= 0.6) then x := 0; else x := 1; end if;
|
||||
end when;
|
||||
end Env;
|
||||
</pre>
|
3
Ingegneria del Software/0721_18/quest.txt
Normal file
3
Ingegneria del Software/0721_18/quest.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
L'input ad un sistema è costituito da un utente (umano) che preme due pulsanti etichettati con 0 ed 1.
|
||||
Con probabilità 0.6 l'utente preme il pulsante 0, con probabilità 0.4 l'utente preme il pulsante 1.
|
||||
Quale dei seguenti modelli Modelica fornisce un modello ragionevole per l'utente di cui sopra?
|
16
Ingegneria del Software/0721_18/wrong1.txt
Normal file
16
Ingegneria del Software/0721_18/wrong1.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
<pre>
|
||||
model Env
|
||||
Integer x; // Pulsante premuto dall'utente
|
||||
Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
x := 0;
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
if (r1024 >= 0.6) then x := 0; else x := 1; end if;
|
||||
end when;
|
||||
end Env;
|
||||
</pre>
|
16
Ingegneria del Software/0721_18/wrong2.txt
Normal file
16
Ingegneria del Software/0721_18/wrong2.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
<pre>
|
||||
model Env
|
||||
Integer x; // Pulsante premuto dall'utente
|
||||
Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
x := 0;
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
if (r1024 <= 0.6) then x := 1; else x := 0; end if;
|
||||
end when;
|
||||
end Env;
|
||||
</pre>
|
35
Ingegneria del Software/0721_19/correct.txt
Normal file
35
Ingegneria del Software/0721_19/correct.txt
Normal file
|
@ -0,0 +1,35 @@
|
|||
<pre>
|
||||
model System
|
||||
parameter Integer F1 = 1;
|
||||
parameter Integer F2 = 2;
|
||||
parameter Integer F3 = 3;
|
||||
parameter Integer End = 4;
|
||||
parameter Real p = 0.3;
|
||||
parameter Real A[4, 4] =
|
||||
[
|
||||
0, 1, 0, 0;
|
||||
p, 0, 1-p, 0;
|
||||
0, p, 0, 1-p;
|
||||
0, 0, 0, 1
|
||||
];
|
||||
Integer x; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
x := F1;
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
if (r1024 <= A[x, F1]) then
|
||||
x := F1;
|
||||
elseif (r1024 <= A[x, F1] + A[x, F2]) then
|
||||
x := F2;
|
||||
elseif (r1024 <= A[x, F1] + A[x, F2] + A[x, F3]) then
|
||||
x := F3;
|
||||
else
|
||||
x := End;
|
||||
end if;
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
4
Ingegneria del Software/0721_19/quest.txt
Normal file
4
Ingegneria del Software/0721_19/quest.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
img=https://i.imgur.com/c4UjAQc.png
|
||||
Si consideri la seguente Markov Chain:
|
||||
|
||||
Quale dei seguenti modelli Modelica fornisce un modello ragionevole per la Markov Chain di cui sopra?
|
35
Ingegneria del Software/0721_19/wrong1.txt
Normal file
35
Ingegneria del Software/0721_19/wrong1.txt
Normal file
|
@ -0,0 +1,35 @@
|
|||
<pre>
|
||||
model System
|
||||
parameter Integer F1 = 1;
|
||||
parameter Integer F2 = 2;
|
||||
parameter Integer F3 = 3;
|
||||
parameter Integer End = 4;
|
||||
parameter Real p = 0.3;
|
||||
parameter Real A[4, 4] =
|
||||
[
|
||||
0, 1, 0, 0;
|
||||
p, 1-p, 0, 0;
|
||||
0, 0, p, 1-p;
|
||||
0, 0, 0, 1
|
||||
];
|
||||
Integer x; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
x := F1;
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
if (r1024 <= A[x, F1]) then
|
||||
x := F1;
|
||||
elseif (r1024 <= A[x, F1] + A[x, F2]) then
|
||||
x := F2;
|
||||
elseif (r1024 <= A[x, F1] + A[x, F2] + A[x, F3]) then
|
||||
x := F3;
|
||||
else
|
||||
x := End;
|
||||
end if;
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
35
Ingegneria del Software/0721_19/wrong2.txt
Normal file
35
Ingegneria del Software/0721_19/wrong2.txt
Normal file
|
@ -0,0 +1,35 @@
|
|||
<pre>
|
||||
model System
|
||||
parameter Integer F1 = 1;
|
||||
parameter Integer F2 = 2;
|
||||
parameter Integer F3 = 3;
|
||||
parameter Integer End = 4;
|
||||
parameter Real p = 0.3;
|
||||
parameter Real A[4, 4] =
|
||||
[
|
||||
0, 1, 0, 0;
|
||||
p, 0, 0, 1-p;
|
||||
0, 0, p, 1-p;
|
||||
0, 0, 0, 1
|
||||
];
|
||||
Integer x; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
x := F1;
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
if (r1024 <= A[x, F1]) then
|
||||
x := F1;
|
||||
elseif (r1024 <= A[x, F1] + A[x, F2]) then
|
||||
x := F2;
|
||||
elseif (r1024 <= A[x, F1] + A[x, F2] + A[x, F3]) then
|
||||
x := F3;
|
||||
else
|
||||
x := End;
|
||||
end if;
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
1
Ingegneria del Software/0721_2/correct.txt
Normal file
1
Ingegneria del Software/0721_2/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Una release del software è resa disponibile agli utenti (beta users) per permettergli di sperimentare e quindi segnalare eventuali problemi rilevati agli sviluppatori.
|
1
Ingegneria del Software/0721_2/quest.txt
Normal file
1
Ingegneria del Software/0721_2/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Quale delle seguenti affermazione è vera riguardo al beta testing ?
|
1
Ingegneria del Software/0721_2/wrong1.txt
Normal file
1
Ingegneria del Software/0721_2/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Test automatizzato sono eseguiti sulla versione finale del sistema presso il cliente.
|
1
Ingegneria del Software/0721_2/wrong2.txt
Normal file
1
Ingegneria del Software/0721_2/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Test automatizzato sono eseguiti sulla versione finale del sistema presso il sito di sviluppo del software.
|
17
Ingegneria del Software/0721_20/correct.txt
Normal file
17
Ingegneria del Software/0721_20/correct.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
3
Ingegneria del Software/0721_20/quest.txt
Normal file
3
Ingegneria del Software/0721_20/quest.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
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 ?
|
17
Ingegneria del Software/0721_20/wrong1.txt
Normal file
17
Ingegneria del Software/0721_20/wrong1.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
17
Ingegneria del Software/0721_20/wrong2.txt
Normal file
17
Ingegneria del Software/0721_20/wrong2.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
1
Ingegneria del Software/0721_21/correct.txt
Normal file
1
Ingegneria del Software/0721_21/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un modello di simulazione per i principali aspetti dei processi di business dell'azienda e per il sistema software da realizzare e valutare le migliorie apportate dal sistema software ai processi di business dell'azienda mediante simulazione.
|
1
Ingegneria del Software/0721_21/quest.txt
Normal file
1
Ingegneria del Software/0721_21/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Una azienda finanziaria desidera costruire un sistema software per ottimizzare i processi di business. Quali delle seguenti attività può contribuire a validare i requisiti del sistema ?
|
1
Ingegneria del Software/0721_21/wrong1.txt
Normal file
1
Ingegneria del Software/0721_21/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo del sistema e valutarne i requisiti non funzionali usando i dati storici dall'azienda.
|
1
Ingegneria del Software/0721_21/wrong2.txt
Normal file
1
Ingegneria del Software/0721_21/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Costruire un prototipo del sistema e testarlo rispetto ai requisiti funzionali usando i dati storici dall'azienda.
|
15
Ingegneria del Software/0721_22/correct.txt
Normal file
15
Ingegneria del Software/0721_22/correct.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
model System
|
||||
Integer y; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
equation
|
||||
y = if (r1024 <= 0.2) then -1 else if (r1024 <= 0.7) then 0 else 1;
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
1
Ingegneria del Software/0721_22/quest.txt
Normal file
1
Ingegneria del Software/0721_22/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Si consideri l'ambiente (use case) consistente di un utente che ad ogni unità di tempo (ad esempio, un secondo) invia al nostro sistema input -1 con probabilità 0.2, input 0 con probabilità 0.5 ed input 1 con probabilità 0.3. Quale dei seguenti modelli Modelica rappresenta correttamente tale ambiente.
|
15
Ingegneria del Software/0721_22/wrong1.txt
Normal file
15
Ingegneria del Software/0721_22/wrong1.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
model System
|
||||
Integer y; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
equation
|
||||
y = if (r1024 <= 0.2) then -1 else if (r1024 <= 0.5) then 0 else 1;
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
15
Ingegneria del Software/0721_22/wrong2.txt
Normal file
15
Ingegneria del Software/0721_22/wrong2.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
model System
|
||||
Integer y; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
equation
|
||||
y = if (r1024 <= 0.2) then -1 else if (r1024 <= 0.7) then 0 else 1;
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
15
Ingegneria del Software/0721_23/correct.txt
Normal file
15
Ingegneria del Software/0721_23/correct.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
5
Ingegneria del Software/0721_23/quest.txt
Normal file
5
Ingegneria del Software/0721_23/quest.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
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 ?
|
15
Ingegneria del Software/0721_23/wrong1.txt
Normal file
15
Ingegneria del Software/0721_23/wrong1.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
15
Ingegneria del Software/0721_23/wrong2.txt
Normal file
15
Ingegneria del Software/0721_23/wrong2.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
16
Ingegneria del Software/0721_24/correct.txt
Normal file
16
Ingegneria del Software/0721_24/correct.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
<pre>
|
||||
model System
|
||||
Integer y;
|
||||
Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
equation
|
||||
y = if (r1024 <= 0.3) then 1 else 0;
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
1
Ingegneria del Software/0721_24/quest.txt
Normal file
1
Ingegneria del Software/0721_24/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Si consideri l'ambiente (use case) che consiste di un utente che, ad ogni unità di tempo (ad esempio, un secondo) manda al nostro sistema input 1 (ad esempio, esegue una prenotazione) con probabilità 0.3 oppure input 0 con probabilità 0.7. Quale dei seguenti modelli Modelica rappresenta correttamente tale ambiente.
|
15
Ingegneria del Software/0721_24/wrong1.txt
Normal file
15
Ingegneria del Software/0721_24/wrong1.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
model System
|
||||
Integer y; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
equation
|
||||
y = if (r1024 >= 0.3) then 1 else 0;
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
15
Ingegneria del Software/0721_24/wrong2.txt
Normal file
15
Ingegneria del Software/0721_24/wrong2.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
<pre>
|
||||
model System
|
||||
Integer y; Real r1024;
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
equation
|
||||
y = if (r1024 <= 0.3) then 0 else 1;
|
||||
algorithm
|
||||
when initial() then
|
||||
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||||
r1024 := 0;
|
||||
elsewhen sample(0,1) then
|
||||
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||||
end when;
|
||||
end System;
|
||||
</pre>
|
17
Ingegneria del Software/0721_25/correct.txt
Normal file
17
Ingegneria del Software/0721_25/correct.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
class Monitor
|
||||
|
||||
InputReal x; // plant output
|
||||
OutputBoolean y;
|
||||
|
||||
Boolean z;
|
||||
initial equation
|
||||
y = false;
|
||||
equation
|
||||
z = (time > 0) and ((x > 5) or (x < 0));
|
||||
algorithm
|
||||
when edge(z) then
|
||||
y := true;
|
||||
end when;
|
||||
end Monitor;
|
||||
</pre>
|
3
Ingegneria del Software/0721_25/quest.txt
Normal file
3
Ingegneria del Software/0721_25/quest.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
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 ?
|
17
Ingegneria del Software/0721_25/wrong1.txt
Normal file
17
Ingegneria del Software/0721_25/wrong1.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
class Monitor
|
||||
|
||||
InputReal x; // plant output
|
||||
OutputBoolean y;
|
||||
|
||||
Boolean z;
|
||||
initial equation
|
||||
y = false;
|
||||
equation
|
||||
z = (time > 0) and (x > 0) and (x < 5);
|
||||
algorithm
|
||||
when edge(z) then
|
||||
y := true;
|
||||
end when;
|
||||
end Monitor;
|
||||
</pre>
|
17
Ingegneria del Software/0721_25/wrong2.txt
Normal file
17
Ingegneria del Software/0721_25/wrong2.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
<pre>
|
||||
class Monitor
|
||||
|
||||
InputReal x; // plant output
|
||||
OutputBoolean y;
|
||||
|
||||
Boolean z;
|
||||
initial equation
|
||||
y = false;
|
||||
equation
|
||||
z = (time > 0) and ((x > 0) or (x < 5));
|
||||
algorithm
|
||||
when edge(z) then
|
||||
y := true;
|
||||
end when;
|
||||
end Monitor;
|
||||
</pre>
|
20
Ingegneria del Software/0721_26/correct.txt
Normal file
20
Ingegneria del Software/0721_26/correct.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
<pre>
|
||||
block MarkovChain
|
||||
//external function myrandom() returns a random real number in [0, 1]
|
||||
parameter Integer x0 = 0;
|
||||
parameter Integer xmax = 100;
|
||||
OutputInteger x; // Connector
|
||||
algorithm
|
||||
when initial() then
|
||||
x := x0;
|
||||
elsewhen sample(0, 1) then
|
||||
if (x < xmax)
|
||||
then
|
||||
if (myrandom() <= 0.8)
|
||||
then
|
||||
x := x + 1;
|
||||
end if;
|
||||
end if;
|
||||
end when;
|
||||
end MarkovChain;
|
||||
</pre>
|
4
Ingegneria del Software/0721_26/quest.txt
Normal file
4
Ingegneria del Software/0721_26/quest.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
Un'azienda decide di organizzare il processo di sviluppo di un grosso software in 101 phasi sequenziali, numerate da 0 a 100. La phase 0 è quella iniziale. La phase 100 è quella finale in cui lo sviluppo è completato. Tutte le fasi hanno circa la stessa durata.
|
||||
Si decide di realizzare un approccio incrementale in cui, alla fine di ogni fase, si passa alla fase successiva solo nel caso in cui tutti i test per la fase vengono superati. In caso contrario bisogna ripetere la phase. Dai dati storici è noto che la probabilità che il team di sviluppo passi da una fase a quella successiva è 0.8.
|
||||
Allo scopo di stimare attraverso una simulazione MonteCarlo il valore atteso del tempo di completamento del progetto viene realizzato un modello Modelica delo processo di sviluppo descritto sopra.
|
||||
Quale dei seguenti modelli Modelica modella correttamente il processo di sviluppo descritto sopra?
|
20
Ingegneria del Software/0721_26/wrong1.txt
Normal file
20
Ingegneria del Software/0721_26/wrong1.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
<pre>
|
||||
block MarkovChain
|
||||
//external function myrandom() returns a random real number in [0, 1]
|
||||
parameter Integer x0 = 0;
|
||||
parameter Integer xmax = 100;
|
||||
OutputInteger x; // Connector
|
||||
algorithm
|
||||
when initial() then
|
||||
x := x0;
|
||||
elsewhen sample(0, 1) then
|
||||
if (x < xmax)
|
||||
then
|
||||
if (myrandom() >= 0.8)
|
||||
then
|
||||
x := x + 1;
|
||||
end if;
|
||||
end if;
|
||||
end when;
|
||||
end MarkovChain;
|
||||
</pre>
|
22
Ingegneria del Software/0721_26/wrong2.txt
Normal file
22
Ingegneria del Software/0721_26/wrong2.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
<pre>
|
||||
block MarkovChain
|
||||
//external function myrandom() returns a random real number in [0, 1]
|
||||
parameter Integer x0 = 0;
|
||||
parameter Integer xmax = 100;
|
||||
OutputInteger x; // Connector
|
||||
algorithm
|
||||
when initial() then
|
||||
x := x0;
|
||||
elsewhen sample(0, 1) then
|
||||
if (x < xmax)
|
||||
then
|
||||
if (myrandom() <= 0.8)
|
||||
then
|
||||
x := x + 1;
|
||||
else
|
||||
x := x - 1;
|
||||
end if;
|
||||
end if;
|
||||
end when;
|
||||
end MarkovChain;
|
||||
</pre>
|
16
Ingegneria del Software/0721_27/correct.txt
Normal file
16
Ingegneria del Software/0721_27/correct.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
4
Ingegneria del Software/0721_27/quest.txt
Normal file
4
Ingegneria del Software/0721_27/quest.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
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 ?
|
16
Ingegneria del Software/0721_27/wrong1.txt
Normal file
16
Ingegneria del Software/0721_27/wrong1.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
16
Ingegneria del Software/0721_27/wrong2.txt
Normal file
16
Ingegneria del Software/0721_27/wrong2.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
<pre>
|
||||
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;
|
||||
</pre>
|
23
Ingegneria del Software/0721_28/correct.txt
Normal file
23
Ingegneria del Software/0721_28/correct.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
<pre>
|
||||
block MarkovChain
|
||||
//external function myrandom() returns a random real number in [0, 1]
|
||||
parameter Real x0 = 1;
|
||||
OutputReal x;
|
||||
algorithm
|
||||
when initial() then
|
||||
x := x0;
|
||||
elsewhen sample(0, 1) then
|
||||
if (myrandom() <= 0.9)
|
||||
then
|
||||
if (myrandom() <= 0.7)
|
||||
then
|
||||
x := 1.1*x;
|
||||
else
|
||||
x := 0.9*x;
|
||||
end if;
|
||||
else
|
||||
x := 0.73*x;
|
||||
end if;
|
||||
end when;
|
||||
end MarkovChain;
|
||||
</pre>
|
2
Ingegneria del Software/0721_28/quest.txt
Normal file
2
Ingegneria del Software/0721_28/quest.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
L'input di un sistema software è costituito da un sensore che ogni unità di tempo (ad esempio, un secondo) invia un numero reale. Con probabilità 0.63 il valore inviato in una unità di tempo è maggiore del 10% rispetto quello inviato nell'unità di tempo precedente. Con probabilità 0.1 è inferiore del 27% rispetto al valore inviato nell'unità di tempo precedente. Con probabilità 0.27 è inferiore del 10% rispetto quello inviato nell'unità di tempo precedente.
|
||||
Quale dei seguenti modelli Modelica modella correttamente l'environment descritto sopra.
|
23
Ingegneria del Software/0721_28/wrong1.txt
Normal file
23
Ingegneria del Software/0721_28/wrong1.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
<pre>
|
||||
block MarkovChain
|
||||
//external function myrandom() returns a random real number in [0, 1]
|
||||
parameter Real x0 = 1;
|
||||
OutputReal x;
|
||||
algorithm
|
||||
when initial() then
|
||||
x := x0;
|
||||
elsewhen sample(0, 1) then
|
||||
if (myrandom() <= 0.9)
|
||||
then
|
||||
if (myrandom() <= 0.7)
|
||||
then
|
||||
x := 0.9*x;
|
||||
else
|
||||
x := 01.1*x;
|
||||
end if;
|
||||
else
|
||||
x := 0.73*x;
|
||||
end if;
|
||||
end when;
|
||||
end MarkovChain;
|
||||
</pre>
|
23
Ingegneria del Software/0721_28/wrong2.txt
Normal file
23
Ingegneria del Software/0721_28/wrong2.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
<pre>
|
||||
block MarkovChain
|
||||
//external function myrandom() returns a random real number in [0, 1]
|
||||
parameter Real x0 = 1;
|
||||
OutputReal x;
|
||||
algorithm
|
||||
when initial() then
|
||||
x := x0;
|
||||
elsewhen sample(0, 1) then
|
||||
if (myrandom() <= 0.7)
|
||||
then
|
||||
if (myrandom() <= 0.9)
|
||||
then
|
||||
x := 1.1*x;
|
||||
else
|
||||
x := 0.9*x;
|
||||
end if;
|
||||
else
|
||||
x := 0.73*x;
|
||||
end if;
|
||||
end when;
|
||||
end MarkovChain;
|
||||
</pre>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue