An Example (continued)

The module is to compute the tax for an employee. Tax is 10% of salary if salary is less than $10,000, or 15% of salary if salary is greater than or equal to $10,000. Paycheck is to be prepared.

Functional Tests

Test Id     Input (Salary)     Output (pay check)  
 101          7,000            6,300       
 102         11,000            9,350       

Integration Tests

A payroll application will compute the tax deductions, prepare the paychecks, compute total tax deductions and make tax payment to IRS.

If we use top-down approach, we will test the payroll application first, with the two stubs for (1) employee tax deduction and (2) total tax payment to IRS. The stubs are then replaced by the actual modules for further integration testing.

If we use bottom-up approach, we will test the individual modules first, and then the payroll application system.

Class Discussion: Discuss the advantages of each approach.