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:

We want to test the static class EMath with the following public

- - - - - - - - - - - - - - - -

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 42

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!