CMPSC 16 Lecture Notes - Lecture 10: Boolean Expression, Speedstep, Ope
Document Summary
Testing and debugging, i/o streams, and intro to oop concepts. Each function should be tested as a separate unit: facilitates finding mistakes (cid:862)dri(cid:448)er progra(cid:373)s(cid:863) allo(cid:449) testing of individual functions. Once a function is tested, it can be used in the driver program to test other functions. When a function being tested calls other functions that are not yet tested, use a stub. A stub is a simplified version of a function. Stubs usually provide values for testing rather than perform the intended calculation. Should be simple enough that you are confident they will perform correctly. Test every function in a program in which every other function in that program has already been fully tested and debugged. Check for common errors: local vs reference parameters, = vs =, && vs || Localize the error: narrow down bugs by using cout statements to reveal internal (hidden) values of variables.