40 likes | 254 Views
(OO) Test Case Design. In the small Class-level (Unit testing) Generate (random) operation sequences on an object In the large (cluster based testing, use-case based testing) Objective: test class collaboration Integration testing. Test Case Example (Unit Testing).
E N D
(OO) Test Case Design • In the small • Class-level (Unit testing) • Generate (random) operation sequences on an object • In the large (cluster based testing, use-case based testing) • Objective: test class collaboration • Integration testing
Test Case Example(Unit Testing) • Example: BankAccount class • Some Random Operation Sequences • create.deposit.deposit.balance.withdraw. withdraw.close • create.withdraw.deposit.balance.withdraw.close • Enumerate input cases for each class method • ensure that operation sequences cover all the input/parameter cases • withdraw: balance >= 0, amt < balance, …
Integration Testing • Include collaborating classes • Example: BankAccount, ATMGui, and Customer • Formulate operations according to use case. e.g., • encode-customer-info, create-account, setup-pin, withdraw, deposit, get-balance.