Question
We want to test the static class EMath with the following public interface; + gcd(String x, String y): int + absolute(String x): int + module(String
We want to test the static class EMath with the following public interface;
+ gcd(String x, String y): int
+ absolute(String x): int
+ module(String x, String y ): int
Where the member methods of the class;
gcd(x, y) returns the greatest common divisor of the integer numbers x and y.
absolute(x) returns the absolute value of the number x.
modulo(x, y) returns x modulus y.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Emath.java source code:
package emath; public class EMath { public static int absolute(String s1){ int number=Integer.parseInt(s1); return((number>0)? number: -number); } public static int modulo(String sa, String sb){ int a=absolute(sa); int b=absolute(sb); return(a-(a/b)*b); } public static int gcd(String sa, String sb){ int numA=absolute(sa); int numB=absolute(sb); while (numA != numB) { if (numB > numA) numB -=numA; else numA -=numB; } return (numA); }}
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -
Code for testing:
- - - - - - - - - - - - - - - -
Question:
Explain step by step how to develop a bank of test using the tools NetBeans and JUnit for testing the right performance of Java objects of the class EMath using the code above.
Basically, explain how to create the project on Netbeans 8.2 and test it from there. Thank You.
unit. Test unit. Asse a weit Taue import s atic im pont s ath EN Math atti Test. Test asses Equals (4 Empth absdute C-4" Test blic Noid test modulo thut Excepti ases Equals 1, E modulo (4,2) Teat vond test Godo thsows Exception asseof Equals 1 Emmhhaad 42Step 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