{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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.
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern