QuestionQ14

Agile software development and Test Techniques

A new Payroll system calculates the tax amount each employee must pay (TaxToPay) on their gross monthly salary (in €), along with the net salary (NetSal) they will receive after that tax has been deducted.

It also calculates the year-to-date (YTD) tax (TaxPdYTD) and net-salary (SalPdYTD) amounts by adding them to the stored values from the previous month (these are zero for month 1).

Inputs include Employee Id (Empld) and this month's Gross Salary (GrossSal). Tax Rate is looked up using Employee Id as the key; the YTD tax and net-salary amounts are looked up using (Employee Id and [month - 1]) as the key, except that they are zero for month 1.

If both employees were paid the same in month 1 as in the current month 2, for which tax must now be calculated, which data-driven input and expected-output table is correct for this situation?

Explanation

For month 2, tax is €300 and €440, and net salary is €1,700 and €1,760. Adding the identical month-1 results gives YTD tax totals of €600 and €880 and YTD net-salary totals of €3,400 and €3,520. Month, employee ID, and current gross salary are supplied to the calculation; tax rate and prior YTD values are obtained through the specified lookups.

Community Discussion

No comments yet. Be the first to start the discussion!