Test Plans Test Driven Development Unit test plan
- Slides: 7
Test Plans • Test Driven Development – Unit test plan first • • Code coverage Automated Regression built as you go Debug is easier Serves as system doc – Still need system test on top – Legacy code might not have the plans
Test Plan levels • User Acceptance • System (integration) • Unit test (TDD concerned with these) • Regression
Type • Try to break it • Validate flows (from state to state) • Validate Specifications (including use cases and sequence diagrams) • Stress test • Code inspection • Black box vs white box – Black - From spec - no design knowledge – White - look at code to find decisions
A Good Test Case • Setup situation - environment to input into • Action to test - actual input • Assertion of result - what the environment looks like when you are done
Chose cases • Input / output partitions (similar characteristics) – One from each paritition; boundaries and null • Cause all failure types (every failure error msg) • Sequences: have only 1 in a sequence; have none in a sequence; also act on first, middle and last • Input / output buffer overflow • Try to force invalid outputs
Environments • Good test environments encourage good tests – Refresh periodically – One per user + One shared • Bypass Database with stubs to return from a DB call – Quick – Not complete
Testing Wrap UP Levels - unit / system / user Structure - situation / input / expected output TDD - code test before coding program Choose cases - partitions (border, null, sample) / sequences / buffer limits / force errors • You will be able to : • • – Write a user acceptance test plan – Write good test cases on paper