This laboratory exercise engages you in unit testing-based development of a simple Java method. You don't need to be a J

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

This laboratory exercise engages you in unit testing-based development of a simple Java method. You don't need to be a J

Post by answerhappygod »

This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 1
This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 1 (62.51 KiB) Viewed 25 times
This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 2
This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 2 (27.19 KiB) Viewed 25 times
This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 3
This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 3 (29.92 KiB) Viewed 25 times
This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 4
This Laboratory Exercise Engages You In Unit Testing Based Development Of A Simple Java Method You Don T Need To Be A J 4 (7.09 KiB) Viewed 25 times
This laboratory exercise engages you in unit testing-based development of a simple Java method. You don't need to be a Java expert to complete this exercise. Laboratory tasks: 1. Unit testing with JUnit for the method "basicSelectionSort" in SelectionSort.java class a. Create a new Java Project in Eclipse b. Add a new Java class "SelectionSort.java" in the project (initial source code in the next page) c. Add a JUnit Test Case "testSelectionSort.java" in the project d. Develop and execute the following unit tests 1) testPositives - testing a list of all positive integers 2) testNegatives - testing a list of all negative integers 3) testMixed - testing a list containing positive, negative and zeros. 4) testDuplicates - testing a list containing one or more duplicate number, for both positive and negative numbers 2. Git for Configuration management a. Create a new local repository containing original Selectionsort.java and testSelectionsort.java b. Create 2 branches, one working on testPositives and testNegatives methods, the other one working on testMixed and testDuplicates in testSelectionsort.java c. Use atom to edit codes in both branches d. After both branches pass the test, merge them into master and run test on master branch to make sure all test pass. e. Go to github.com to create a new repository f. Push the master branch to the github repository Report submission: Create a MS Word or PDF document containing the following: 1. Unit testing with JUnit a. Source code of initial SelectionSort.java class b. Source code of unit tests created and executed c. Outputs of unit tests. Include both failed and passed unit tests. In the case of failed unit tests, indicate what was wrong and what was done to fix the problem. d. Final outputs of all unit tests showing successful pass for all e. Source code of final SelectionSort.java class
2. Git for Configuration management a. Show screen shots github that contains Selectionsort.java and testSelectionsort.java b. Local git folder You are to submit your MS Word or PDF report and other required items on Canvas as a ZIP file. Source Codes: ****** **** public class SelectionSort { private int temp; /** Creates a new instance of SelectionSort */ public SelectionSort () { } /* A simple SelectionSort algorithm * pre-condition: post-condition: * inputs: * outputs: *special conditions: public int[] basicSelectionSort (int[] x) { for (int i = 0; i < x.length; ++i) { for (int j i+1; j < x.length; ++j) { if (x> x) { temp = x; x = x[j]; temp=x; } } // end of inner for loop } // end of outer for loop return x; } // end of basicSelectionSort method ****: } ******** 1* **** *********
*testSelectionSort.java * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ import static org.junit.Assert.*; import org.junit.Assert; import org.junit. Test; public class testSelectionSort { @Test public void test() { testPositive(); testNegative(); testMixed(); testDuplicates(); } public testSelection Sort() { } public void testPositive(){ int[] arr = new int[5]; arr[0] = 8; arr[1] = 9; arr[2] = 7; arr[3] = 10; arr[4] = 2; int[] Sortedarr = new int[5]; Sortedarr[0] = 2; Sortedarr[1] = 7; Sortedarr[2] = 8; Sortedarr[3] = 9; Sortedarr[4] = 10; /** add tests to check for this unit test **/ } public void testNegative(){ /** Test data contains negative values only **/ } public void testMixed(){
/** Test data contains with both positive, negative and zeros **/ } public void testDuplicates(){ /** Test data contains duplicates **/ } } ******* ***********
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply