4/8/2009 2:56 PM
1
GUI Programming GUI Programming
OUTLINE OUTLINE
Assertions and Loop Assertions and Loop Invariants Invariants E t E t O i t d O i t d Event Event-Oriented Oriented Programming Programming GUI GUI – – first look first look
Reasoning about Programs: Reasoning about Programs: Assertions and Loop Assertions and Loop Invariants Invariants
Assertions: logical statements about a Assertions: logical statements about a program that are claimed to be true; program that are claimed to be true; generally written as a comment generally written as a comment Preconditions and Preconditions and postconditions postconditions are are assertions assertions A loop invariant is an assertion A loop invariant is an assertion
Helps prove that a loop meets it specification Helps prove that a loop meets it specification True before loop begins, at the beginning of True before loop begins, at the beginning of each repetition of the loop body, and just after each repetition of the loop body, and just after loop exit loop exit
Assertions and Loop Assertions and Loop Invariants Example Invariants Example Testing Testing
Test Test drivers and stubs are tools used drivers and stubs are tools used in testing in testing
Test drivers exercise a method or class Stubs stand in for called methods Stubs stand in for called methods
Intro to Event Intro to Event-
- Oriented
Oriented Programming Programming
Batch Batch-
- Processing
Processing Request Request-
- Response Programming
Response Programming Event Event-
- Oriented Programming