01-11-2012, 02:28 PM
Testing & Debugging
Testing.ppt (Size: 278.5 KB / Downloads: 24)
Program Design
Top town
Consider each major function or activity
What methods & classes are required to support this
How do you verify that function is performing as expected
Input, output, before and after states
As the design is resolved
Designing the supporting classes & methods
Consider how to test these
Unit Testing
The unit is a single class
Or sometimes even down to the method
The unit is generally the responsibility of an individual programmer
Since the system will be build out of components
We know the system won't work if these components don't work
Test Cases
Typical inputs
Exercise expected features
Boundary cases
Are there limits for the algorithm?
Are the nodes, cusps, inflections, discontinuities, etc?
Retain your test suite
Re-using your test suite to ensure no loss of previously established functionality
This is regression testing
Testing Strategies
White box Testing
Using the design & implementation to develop your test suite
Black box Testing
Designing the test suite without regard to the implementation
Coverage
Is every branch and method exercised
In complex systems this may be nearly impossible
Comparison
Oracle
Program Execution Tracing
You can put statements to display where the program is currently executing
Trace Statements
You are here!
Typically System.out.print()
Values of arguments, intermediate & local, & return values