move legacy code to separate branch
27
.github/workflows/update-data.yml
vendored
|
@ -1,27 +0,0 @@
|
||||||
name: Update bot data
|
|
||||||
|
|
||||||
# Configures this workflow to run every time a change is pushed to the branch called `release`.
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ['main']
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
validate-questions:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Validate questions
|
|
||||||
run: python scripts/validate_questions.py
|
|
||||||
shell: sh
|
|
||||||
|
|
||||||
update-data:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Configure custom DNS resolver
|
|
||||||
run: echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
|
|
||||||
|
|
||||||
- name: Call webhook
|
|
||||||
run: curl -X POST ${{secrets.DEPLOY_WEBHOOK}}
|
|
15
.github/workflows/validate-questions.yml
vendored
|
@ -1,15 +0,0 @@
|
||||||
name: Validate questions
|
|
||||||
|
|
||||||
# Configures this workflow to run every time a change is pushed to the branch called `release`.
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
validate-questions:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Validate questions
|
|
||||||
run: python scripts/validate_questions.py
|
|
||||||
shell: sh
|
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 506 KiB After Width: | Height: | Size: 506 KiB |
Before Width: | Height: | Size: 1 MiB After Width: | Height: | Size: 1 MiB |
Before Width: | Height: | Size: 353 KiB After Width: | Height: | Size: 353 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 216 KiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 310 KiB After Width: | Height: | Size: 310 KiB |
Before Width: | Height: | Size: 251 KiB After Width: | Height: | Size: 251 KiB |
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 141 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
@ -1,11 +1,11 @@
|
||||||
img=https://unspectacular-subdi.000webhostapp.com/0120_domanda_0.png
|
img=https://unspectacular-subdi.000webhostapp.com/0120_domanda_0.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.
|
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
|
Si consideri lo state diagram in figura
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ed il seguente insieme di test cases:
|
ed il seguente insieme di test cases:
|
||||||
Test case 1: act2 act1
|
Test case 1: act2 act1
|
||||||
Test case 2: act1 act0 act1 act0 act2
|
Test case 2: act1 act0 act1 act0 act2
|
||||||
Test case 3: act0 act2 act2 act1
|
Test case 3: act0 act2 act2 act1
|
||||||
Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra?
|
Quale delle seguenti è la migliore stima della transition coverage per i test cases di cui sopra?
|
|
@ -1,17 +1,17 @@
|
||||||
<pre>
|
<pre>
|
||||||
class Monitor
|
class Monitor
|
||||||
|
|
||||||
InputReal x, y; // plant output
|
InputReal x, y; // plant output
|
||||||
OutputBoolean wy;
|
OutputBoolean wy;
|
||||||
|
|
||||||
Boolean wz;
|
Boolean wz;
|
||||||
initial equation
|
initial equation
|
||||||
wy = false;
|
wy = false;
|
||||||
equation
|
equation
|
||||||
wz = (time > 10) and (x >= 10) and (x <= 20) and ((y <pre 0.5*x) or (y > 0.7*x)) ;
|
wz = (time > 10) and (x >= 10) and (x <= 20) and ((y <pre 0.5*x) or (y > 0.7*x)) ;
|
||||||
algorithm
|
algorithm
|
||||||
when edge(wz) then
|
when edge(wz) then
|
||||||
wy := true;
|
wy := true;
|
||||||
end when;
|
end when;
|
||||||
end Monitor;
|
end Monitor;
|
||||||
</pre>
|
</pre>
|
|
@ -1,3 +1,3 @@
|
||||||
Si consideri il seguente requisito:
|
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.
|
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 ?
|
Quale dei seguenti monitor meglio descrive il requisito RQ ?
|
|
@ -1,17 +1,17 @@
|
||||||
<pre>
|
<pre>
|
||||||
class Monitor
|
class Monitor
|
||||||
|
|
||||||
InputReal x, y; // plant output
|
InputReal x, y; // plant output
|
||||||
OutputBoolean wy;
|
OutputBoolean wy;
|
||||||
|
|
||||||
Boolean wz;
|
Boolean wz;
|
||||||
initial equation
|
initial equation
|
||||||
wy = false;
|
wy = false;
|
||||||
equation
|
equation
|
||||||
wz = (time > 10) and ((x < 10) or (x > 20)) and ((y < 0.5*x) or (y > 0.7*x)) ;
|
wz = (time > 10) and ((x < 10) or (x > 20)) and ((y < 0.5*x) or (y > 0.7*x)) ;
|
||||||
algorithm
|
algorithm
|
||||||
when edge(wz) then
|
when edge(wz) then
|
||||||
wy := true;
|
wy := true;
|
||||||
end when;
|
end when;
|
||||||
end Monitor;
|
end Monitor;
|
||||||
</pre>
|
</pre>
|
|
@ -1,17 +1,17 @@
|
||||||
<pre>
|
<pre>
|
||||||
class Monitor
|
class Monitor
|
||||||
|
|
||||||
InputReal x, y; // plant output
|
InputReal x, y; // plant output
|
||||||
OutputBoolean wy;
|
OutputBoolean wy;
|
||||||
|
|
||||||
Boolean wz;
|
Boolean wz;
|
||||||
initial equation
|
initial equation
|
||||||
wy = false;
|
wy = false;
|
||||||
equation
|
equation
|
||||||
wz = (time > 10) and (x >= 10) and (x <= 20) and (y >= 0.5*x) and (y <= 0.7*x) ;
|
wz = (time > 10) and (x >= 10) and (x <= 20) and (y >= 0.5*x) and (y <= 0.7*x) ;
|
||||||
algorithm
|
algorithm
|
||||||
when edge(wz) then
|
when edge(wz) then
|
||||||
wy := true;
|
wy := true;
|
||||||
end when;
|
end when;
|
||||||
end Monitor;
|
end Monitor;
|
||||||
</pre>
|
</pre>
|
|
@ -1,16 +1,16 @@
|
||||||
<pre>
|
<pre>
|
||||||
class Monitor
|
class Monitor
|
||||||
|
|
||||||
InputReal x, y, z; // plant output
|
InputReal x, y, z; // plant output
|
||||||
OutputBoolean wy;
|
OutputBoolean wy;
|
||||||
Boolean wz;
|
Boolean wz;
|
||||||
initial equation
|
initial equation
|
||||||
wy = false;
|
wy = false;
|
||||||
equation
|
equation
|
||||||
wz = (time > 50) and (x < 0.6*y) and (x + y <= 0.3*z);
|
wz = (time > 50) and (x < 0.6*y) and (x + y <= 0.3*z);
|
||||||
algorithm
|
algorithm
|
||||||
when edge(wz) then
|
when edge(wz) then
|
||||||
wy := true;
|
wy := true;
|
||||||
end when;
|
end when;
|
||||||
end Monitor;
|
end Monitor;
|
||||||
</pre>
|
</pre>
|
|
@ -1,4 +1,4 @@
|
||||||
Si consideri il seguente requisito:
|
Si consideri il seguente requisito:
|
||||||
RQ: Dopo 50 unità di tempo dall'inizio dell'esecuzione vale la seguente proprietà:
|
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
|
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 ?
|
Quale dei seguenti monitor meglio descrive il requisito RQ ?
|
|
@ -1,16 +1,16 @@
|
||||||
<pre>
|
<pre>
|
||||||
class Monitor
|
class Monitor
|
||||||
|
|
||||||
InputReal x, y, z; // plant output
|
InputReal x, y, z; // plant output
|
||||||
OutputBoolean wy;
|
OutputBoolean wy;
|
||||||
Boolean wz;
|
Boolean wz;
|
||||||
initial equation
|
initial equation
|
||||||
wy = false;
|
wy = false;
|
||||||
equation
|
equation
|
||||||
wz = (time > 50) and (x >= 0.6*y) and (x + y <= 0.3*z);
|
wz = (time > 50) and (x >= 0.6*y) and (x + y <= 0.3*z);
|
||||||
algorithm
|
algorithm
|
||||||
when edge(wz) then
|
when edge(wz) then
|
||||||
wy := true;
|
wy := true;
|
||||||
end when;
|
end when;
|
||||||
end Monitor;
|
end Monitor;
|
||||||
</pre>
|
</pre>
|
|
@ -1,16 +1,16 @@
|
||||||
<pre>
|
<pre>
|
||||||
class Monitor
|
class Monitor
|
||||||
|
|
||||||
InputReal x, y, z; // plant output
|
InputReal x, y, z; // plant output
|
||||||
OutputBoolean wy;
|
OutputBoolean wy;
|
||||||
Boolean wz;
|
Boolean wz;
|
||||||
initial equation
|
initial equation
|
||||||
wy = false;
|
wy = false;
|
||||||
equation
|
equation
|
||||||
wz = (time > 50) and (x < 0.6*y) and (x + y > 0.3*z);
|
wz = (time > 50) and (x < 0.6*y) and (x + y > 0.3*z);
|
||||||
algorithm
|
algorithm
|
||||||
when edge(wz) then
|
when edge(wz) then
|
||||||
wy := true;
|
wy := true;
|
||||||
end when;
|
end when;
|
||||||
end Monitor;
|
end Monitor;
|
||||||
</pre>
|
</pre>
|
|
@ -1,6 +1,6 @@
|
||||||
img=https://unspectacular-subdi.000webhostapp.com/0120_domanda_12.png
|
img=https://unspectacular-subdi.000webhostapp.com/0120_domanda_12.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.
|
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.
|
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)) + ...
|
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).
|
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
|
Quale delle seguenti formule calcola il valore atteso del costo per completare il processo software di cui sopra
|
|
@ -1,9 +1,9 @@
|
||||||
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.
|
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:
|
Si consideri la seguente funzione C:
|
||||||
-----------
|
-----------
|
||||||
int f(int x, int y) {
|
int f(int x, int y) {
|
||||||
int z = x;
|
int z = x;
|
||||||
while ( (x <= z) && (z <= y) ) { z = z + 1; }
|
while ( (x <= z) && (z <= y) ) { z = z + 1; }
|
||||||
return (z);
|
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.
|
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.
|
|
@ -1,6 +1,6 @@
|
||||||
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.
|
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:
|
Si consideri la seguente funzione C:
|
||||||
int f1(int x) { return (x + 7); }
|
int f1(int x) { return (x + 7); }
|
||||||
Si vuole testare la funzione f1(). A tal fine l'insieme degli interi viene partizionato come segue:
|
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)}
|
{(-inf, -101], [-100, -1], {0}, [1, 500], [501, +inf)}
|
||||||
Quale dei seguenti test cases consegue una partition coverage del 100% ?
|
Quale dei seguenti test cases consegue una partition coverage del 100% ?
|
|
@ -1,2 +1,2 @@
|
||||||
"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:
|
La frase precedente è un esempio di:
|