Test program The following program has been implemented for a newly proposed tax calculation formula for residents of a
Posted: Fri Jul 01, 2022 5:42 am
Test program
The following program has been implemented for a newly proposedtax calculation formula for residents of a fictitious country.
// incomeList[]: the array recording the individual incomeitems
// childList[]: the array recording the ages of childrensupported by this person
// parentList[]: the array recording the ages of parentssupported by this person
// calculate the income amount
// calculate the basic tax
// calculate the tax exemption from having children
23 numOfChild--; 24 }
// calculate the tax exemption from having parents
30 }
// the maximum tax exemption is 8000 each person
41}
Your Tasks
(1) Design test cases to achieve 100% branchcoverage on the function "computeTax" (list thebranches covered by each test case). If 100% branchcoverage is not feasible, explainthe reason.Use the minimumnumber of test cases to achieve100% branch coverage
The following program has been implemented for a newly proposedtax calculation formula for residents of a fictitious country.
// incomeList[]: the array recording the individual incomeitems
// childList[]: the array recording the ages of childrensupported by this person
// parentList[]: the array recording the ages of parentssupported by this person
// calculate the income amount
// calculate the basic tax
// calculate the tax exemption from having children
23 numOfChild--; 24 }
// calculate the tax exemption from having parents
30 }
// the maximum tax exemption is 8000 each person
41}
Your Tasks
(1) Design test cases to achieve 100% branchcoverage on the function "computeTax" (list thebranches covered by each test case). If 100% branchcoverage is not feasible, explainthe reason.Use the minimumnumber of test cases to achieve100% branch coverage