Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

Software Testing & Verification Assignment 4 Group Activity Worksheet KEY University of Notre Dame MANAGEMENT ADBI4211

Beoordeling
-
Verkocht
-
Pagina's
4
Cijfer
A+
Geüpload op
02-04-2023
Geschreven in
2022/2023

Software Testing & Verification Assignment 4 Group Activity Worksheet KEY 1. (6 pts.) Which one of the following is the most appropriate interface specification based on pre- and post-conditions for a program that sets variable ILIK to the Index of the Last Instance of K in the non-empty, unsorted array A[1:N] (where N is an integer constant), or to -1 if K is not an instance of A. a. pre-condition: {N≥1 Λ for every 1≤jN, ¬(A[j]A[j+1] V A[j]A[j+1])} post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every ILIKj≤N, A[j]≠K) V (for every 1≤j≤N, ILIK=-1)] Λ UNCH(A,K)} b. pre-condition: {N≥1} post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every ILIKj≤N, A[j]≠K) V ILIK=-1] Λ UNCH(A,K)} c. pre-condition: {N≥1} post-condition: {[(for every 1≤j≤N, A[j]=K Λ ILIK=N) V (for every 1≤j≤N, A[j]≠K) Λ ILIK=-1] Λ UNCH(A,K)} d. pre-condition: {N≥1} post-condition: {[(ILIK=N Λ A[N]=K) V ILIK=-1] Λ UNCH(A,K)} e. pre-condition: {N≥1} post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every 1≤jILIK, A[j]≠K) V (for every 1≤j≤N, A[K]≠-1) Λ ILIK=-1] Λ UNCH(A,K)} f. pre-condition: {N≥1} post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every ILIKj≤N, A[j]≠K) V (for every 1≤j≤N, A[j]≠K Λ ILIK=-1)] Λ UNCH(A,K)} g. pre-condition: {N≥1} post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every 1≤jILIK, A[j]≠K) V (for every 1≤j≤N, A[j]≠K) Λ ILIK=-1] Λ UNCH(A,K)} 2. (4 pts.) Which one of the following most accurately reflects the meaning of the weak correctness predicate, "{P} S {Q}"? (Circle ONE only.) a. ( {P} S {Q} ) ≡ “P must hold before S executes and Q must hold when S terminates” b. “Q could be false when S terminates” ≡ ¬( {P} S {Q} ) c. If P holds before executing S, S must terminate in state Q. d. {P} S {Q} ≡ [(“P is false before S executes”) V (“S does not terminate”) V “Q must be true when S terminates given that P is true before S executes”) e. {P} S {Q} is true unless Q is always false when S terminates, given that P is true before S executes. f. (none of the above)

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Software Testing & Verification
Assignment 4 Group Activity Worksheet KEY

1. (6 pts.) Which one of the following is the most appropriate interface specification based on
pre- and post-conditions for a program that sets variable ILIK to the Index of the Last
Instance of K in the non-empty, unsorted array A[1:N] (where N is an integer constant), or to
-1 if K is not an instance of A.

a. pre-condition: {N≥1 Λ for every 1≤j<N, ¬(A[j]<A[j+1] V A[j]>A[j+1])}
post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every ILIK<j≤N, A[j]≠K) V
(for every 1≤j≤N, ILIK=-1)] Λ UNCH(A,K)}

b. pre-condition: {N≥1}
post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every ILIK<j≤N, A[j]≠K) V
ILIK=-1] Λ UNCH(A,K)}

c. pre-condition: {N≥1}
post-condition: {[(for every 1≤j≤N, A[j]=K Λ ILIK=N) V
(for every 1≤j≤N, A[j]≠K) Λ ILIK=-1] Λ UNCH(A,K)}

d. pre-condition: {N≥1}
post-condition: {[(ILIK=N Λ A[N]=K) V ILIK=-1] Λ UNCH(A,K)}

e. pre-condition: {N≥1}
post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every 1≤j<ILIK, A[j]≠K) V
(for every 1≤j≤N, A[K]≠-1) Λ ILIK=-1] Λ UNCH(A,K)}

f. pre-condition: {N≥1}
post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every ILIK<j≤N, A[j]≠K) V
(for every 1≤j≤N, A[j]≠K Λ ILIK=-1)] Λ UNCH(A,K)}

g. pre-condition: {N≥1}
post-condition: {[(1≤ILIK≤N Λ A[ILIK]=K Λ for every 1≤j<ILIK, A[j]≠K) V
(for every 1≤j≤N, A[j]≠K) Λ ILIK=-1] Λ UNCH(A,K)}


2. (4 pts.) Which one of the following most accurately reflects the meaning of the weak
correctness predicate, "{P} S {Q}"? (Circle ONE only.)

a. ( {P} S {Q} ) ≡ “P must hold before S executes and Q must hold when S terminates”

b. “Q could be false when S terminates” ≡ ¬( {P} S {Q} )
c. If P holds before executing S, S must terminate in state Q.
d. {P} S {Q} ≡ [(“P is false before S executes”) V (“S does not terminate”) V “Q must be
true when S terminates given that P is true before S executes”)
e. {P} S {Q} is true unless Q is always false when S terminates, given that P is true
before S executes.
f. (none of the above)



This study source was downloaded by 100000850872992 from CourseHero.com on 04-02-2023 01:22:32 GMT -05:00


https://www.coursehero.com/file/145153079/sp22-Assignment-4-worksheet-key-5pdf/

Geschreven voor

Vak

Documentinformatie

Geüpload op
2 april 2023
Aantal pagina's
4
Geschreven in
2022/2023
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$8.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
ExamsConnoisseur Self
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
587
Lid sinds
3 jaar
Aantal volgers
344
Documenten
1492
Laatst verkocht
2 weken geleden

4.2

68 beoordelingen

5
40
4
11
3
13
2
1
1
3

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen