CSCE 121 Chapter 26
Jump to navigation
Jump to search
« previous | Monday, November 29, 2010 | next »
Testing
Correctness
Would you fly in a plane that depended on your code?
Software cannot be "proven" to be correct:
- Follow good design principles
- test, test, test, and then test some more!
Searching for Errors
Tools:
- Unit test frameworks
- Static code analysis
- Fault injection tools
"Test early and often"
- Think how you can test the code that you're writing.
- Whenever you make a change to the code
Dependencies
Make sure that functions can run in complete isolation with only the parameters that are passed to them.
Testing Classes and GUI
Test all derived classes at once, look for virtual overrides.
Human tester needed; only way to use a GUI
Measuring Efficiency
UNIX tool: time
C++ tool: clock()