mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-05-06 11:39:37 +02:00
Add new ingsw questions
This commit is contained in:
parent
258ee4e2cf
commit
0873165c52
800 changed files with 5605 additions and 0 deletions
1
Ingegneria del Software/0324_5/correct.txt
Normal file
1
Ingegneria del Software/0324_5/correct.txt
Normal file
|
@ -0,0 +1 @@
|
|||
F(x, y, z) = if (x >= 0) then (z == pow(y, x)) else (z == 1)
|
10
Ingegneria del Software/0324_5/quest.txt
Normal file
10
Ingegneria del Software/0324_5/quest.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
Un test oracle per un programma P è una funzione booleana che ha come inputs gli inputs ed outputs di P e ritorna true se e solo se il valore di output di P (con i dati inputs) è quello atteso dalle specifiche.
|
||||
Si consideri la seguente funzione C:
|
||||
-----------
|
||||
int f(int x, int y) {
|
||||
int z, k;
|
||||
z = 1; k = 0;
|
||||
while (k < x) { z = y*z; k = k + 1; }
|
||||
return (z);
|
||||
}
|
||||
Siano x, y, gli inputs del programma (f nel nostro caso) e z l'output. Assumendo il programma corretto, quale delle seguenti funzioni booleane F(x, y, z) è un test oracle per la funzione f.
|
1
Ingegneria del Software/0324_5/wrong1.txt
Normal file
1
Ingegneria del Software/0324_5/wrong1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
F(x, y, z) = if (x >= 0) then (z == pow(y, x)) else (z == 0)
|
1
Ingegneria del Software/0324_5/wrong2.txt
Normal file
1
Ingegneria del Software/0324_5/wrong2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
F(x, y, z) = if (x >= 0) then (z == pow(y, x)) else (z == y)
|
Loading…
Add table
Add a link
Reference in a new issue