CS250 Test 2 Cram Guide - CS250 EXAM 2 CRAM GUIDE! *THIS...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS250 EXAM 2 CRAM GUIDE! ***THIS GUIDE IS A STUDENT CREATED DOCUMENT*** 1.6: Definitions Program Verification : attempts to ensure that a computer program is correct. Correct : A program is correct if it behaves in accordance with its specifications. o However, this does not necessarily mean that the program solves the problem that it was intended to solve; the program's specifications may be at odds with or not address all aspects of a client's requirements. Program Validation : attempts to ensure that the program indeed meets the client's original requirements. Program Testing : seeks to show that particular input values produce acceptable output values. o "testing can prove the presence of errors but never their absence." o Except for rather simple programs, multiple tests that reveal no bugs do not guarantee that the code is bug-free, that there is not some error lurking in the code waiting to strike under the right circumstances. Proof of Correctness : uses the techniques of a formal logic system to prove that if the input variables satisfy certain specified predicates or properties, the output variables produced by executing the program satisfy other specified properties. Hoare Triple : {Q} P {R} (where P stands for program P, Q is the precondition and R is the postcondition ) C onditional rule of inference : determines when a Hoare triple can be inserted in a proof sequence if si is a conditional statement. Assertions : predicates, often used in program verification methods that follow to the structure of a Hoare triple, that assert what is supposed to be true about the program variables at that point in the program. Examples: 1. (T/F) A provably correct program always gives the right answers to a given problem. 2. (T/F) If an assertion after an assignmnent is y > 4, then the precondition must be y ≥ 4. 3. (T/F) Proof of correctness involves careful development of test data sets. 4. (T/F) Using the conditional rule of inference in proof of correctness involves proving that two different Hoare triples are valid. 5. (T/F) the assertions used in proof of correctness can also be used as a program design aid before the program is written, and as program documentation. Answers: 1. False; It guarantees only that the output satisfies certain conditions, given that the input satisfies certain conditions. 2. False; Nothing much can be said about the precondition without knowing the assignment, but at any rate the strict inequality will not go away. 3. False; Program testing involves test data sets.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/06/2011 for the course CS 250 taught by Professor Staff during the Fall '08 term at University of Alabama at Birmingham.

Page1 / 5

CS250 Test 2 Cram Guide - CS250 EXAM 2 CRAM GUIDE! *THIS...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online