Program Verification (Rosen, Sections 5.5)
TOPICS
- Program Correctness
- Preconditions & Postconditions
- Program Verification
- Assignment Statements
- Conditional Statements
- Loops
- Composition Rule
Proofs about Programs
- Why make you study logic?
- Why make you do proofs?
- Because we want to prove properties of
programs:
– In particular, we want to prove properties of variables at specific points in a program. – For example, we may want prove that a program segment or method gets the right answer.
CS 160, Summer Semester 2016 2
Isn’t testing enough?
- Assuming the program compiles, we can go
ahead and perform some amount of testing.
- Testing shows that for specific examples (test
cases) the program is doing what was intended.
- Testing can only show existence of some bugs
but cannot exhaustively identify all of them.
- Program verification can be used to prove the
correctness of the program with any input.
CS 160, Summer Semester 2016 3
Software Testing
- Methods
– Black-box, white-box
- Levels
– Unit (Method), Module (Class), Integration, System
- Types
– Functionality, Configuration, Usability, Reliability, Performance, Compatibility, Error, Localization, …
- Processes
– Regression, Automation, Test-Driven Development, Code Coverage, …
CS160 - Summer Semester 2016 4