Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

(1) Design test cases to achieve the statement coverage on the function “computeTax” (list the statements covered by each test case using the line number of each statement). If it is not feasible,...

1 answer below »
(1) Design test cases to achieve the statement coverage on the function “computeTax” (list the statements covered by each test case using the line number of each statement). If it is not feasible, explain the reason. Use the minimum number of test cases to achieve the statement coverage. (2) Design test cases to achieve path coverage on the function “computeTax” (list the path covered by each test case). If it is not feasible, explain the reason. Use the minimum number of test cases to achieve the path coverage. (3) Design test cases to achieve loop coverage (see below) on the function “computeTax” (list the loops covered by each test case). If it is not feasible, explain the reason. Try your best to use the minimum number of test cases to achieve the loop coverage. Consider a loop covered if at least in one test the loop body was executed 0 times, in a second test the body was executed exactly once, and in another test the body was executed more than once
Answered 61 days After Dec 25, 2021

Solution

Swapnil answered on Feb 25 2022
114 Votes
Design test cases to achieve the statement coverage on the function “computeTax”.
function computeTax(x, y)
{
const taxRate = 0.12;
eturn `Welcome ${x},
Amount: $${y}
Tax: $${0.12 * y}
Total: $${y + 0.12 * y}
}
Functionality:
Description: The code should be written different functions. So here we have taken the computeTax function with using the x, y variables.
Test Step: Test case step will give the unique representation of amount and tax.
Result: So the result will have calculated for total where it will...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here