Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 ) Details You are given Arthmatic.java You must write JUnit tests for all of the methods in the class. At least 5 different
Question Details
You are given Arthmatic.java You must write JUnit tests for all of the methods in the class. At least different tests for each method. Once you write one of the tests for a specific method, the other can be easily produced by copyingpasting the first one and adjusting the inputoutput parameters. it is important to test boundary inputs as most of the bugs are usually
found in those edge cases. If your tests cases are failing, because there is a bug in the given code, then it is okay. You are not required to fix the code; you just need to write the test cases for this assignment.
public class Arthmatic
public int multiplyint operand int operand
return operand operand;
public int subtractint operand int operand
return operand operand;
public int addint operand int operand
return operand operand;
public int divideint operand int operand
ifdivideByZerooperand
return a integer flag
return Integer.MAXVALUE;
else
return operandoperand;
public boolean divideByZeroint operand
ifoperand
return true;
else
return false;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started