Home /
Expert Answers /
Computer Science /
question-5-testing-software-processes-and-measurements-15-marks-junit-is-a-unit-testing-fram-pa308
(Solved):
Question 5 - Testing, Software Processes and Measurements [15 marks] JUnit is a unit testing fram ...
Question 5 - Testing, Software Processes and Measurements [15 marks] JUnit is a unit testing framework for the Java programming language. It provides a class named Assert, which provides a bunch of assertion methods useful in writing test cases and to detect test failure. One of the most commonly used assertion methods is assertEquals (expected, actual) that tests for the equality of the expected output and the actual output of a program. A test is passed if two outputs are equal or otherwise the test is failed. For example, consider a method that computes the sum of two numbers. We can write a test case in this way: assertEquals (15, sum (7,8));< Given that sum () is the method that adds two numbers 7 and 8 and then returns the sum. If the sum returned is 15, which is matched with the expected output 15 then the test is passed.< Consider a scenario of an online store and answer the following questions. An online store is now on sales and gives different discount rates based on the purchase amount according to the table below. Purchase Amount (S)< Discount (%) >= 3000 30 >= 2000< 250 >= 1500 20 >= 1000< 15 >= 500 10 >= 200 54 <200< 0 The store has developed a method called calDiscount () that computes the discount rate (in integer percentage) according to an input parameter (purchase amount). For instance, if the purchase amount is $1000, then a call with input argument to the method calDiscount (1000) should return 15.
(a) Apply equivalence partitioning to decide what testing data to use. You should first identify the partitions and then choose an input value from each partition. Write a minimal set of test cases to test the calDiscount () method. [9 marks] assertEquals (30, calDiscount (9999)); // a given test case H (b) Explain how Scrum works as a project management method. You should appropriately mention the following terms in your explanation: user stories, product backlog, sprint, Scrum master, product owner, fully tested and ready-to-be-shipped. [6 marks] t t ??
??In case you find the solution helpful, please give an UPVOTE !!!?? Please do not downvote me sir/mam???????????????????????????????????????????????????????????????????????????????????? I really don't know