Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

=+designing international assignment C&B packages.

Answered: 1 week ago