Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The following files were submitted:
- ----------------------------------
- total 36K
- -rw-r--r-- 1 6.4K Mar 15 09:52 Board.java
- -rw-r--r-- 1 17K Mar 15 09:52 Solver.java
- -rw-r--r-- 1 5.1K Mar 15 09:52 studentSubmission.zip
- ******************************************************************************
- * compiling
- ******************************************************************************
- % javac Board.java
- *-----------------------------------------------------------
- ================================================================
- % javac Solver.java
- *-----------------------------------------------------------
- ================================================================
- % checkstyle *.java
- *-----------------------------------------------------------
- ================================================================
- % findbugs *.class
- *-----------------------------------------------------------
- M B NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT NP: Board$Cell.equals(Object) does not check for null argument At Board.java:[lines 29-30]
- M B BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS BC: Equals method for Board$Cell assumes the argument is of type Board$Cell At Board.java:[line 29]
- M B NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT NP: Board.equals(Object) does not check for null argument At Board.java:[lines 202-203]
- M B BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS BC: Equals method for Board assumes the argument is of type Board At Board.java:[line 202]
- M B NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT NP: Solver$Node.equals(Object) does not check for null argument At Solver.java:[lines 197-198]
- M B BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS BC: Equals method for Solver$Node assumes the argument is of type Solver$Node At Solver.java:[line 197]
- Warnings generated: 6
- ================================================================
- Testing the APIs of your programs.
- *-----------------------------------------------------------
- Board:
- Solver:
- ================================================================
- ******************************************************************************
- * correctness
- ******************************************************************************
- Testing methods in Board
- *-----------------------------------------------------------
- Running 18 total tests.
- Tests 6-9 and 17-18 rely upon toString() returning a board in the prescribed format.
- Test 1: Test hamming() with file inputs
- * puzzle04.txt
- * puzzle00.txt
- * puzzle07.txt
- * puzzle17.txt
- * puzzle27.txt
- * puzzle2x2-unsolvable1.txt
- ==> passed
- Test 2: Test hamming() with random N-by-N boards
- * 2-by-2
- * 3-by-3
- * 4-by-4
- * 5-by-5
- * 9-by-9
- * 10-by-10
- ==> passed
- Test 3: Test manhattan() with file inputs
- * puzzle04.txt
- * puzzle00.txt
- * puzzle07.txt
- * puzzle17.txt
- * puzzle27.txt
- * puzzle2x2-unsolvable1.txt
- ==> passed
- Test 4: Test manhattan() with random N-by-N boards
- * 2-by-2
- * 3-by-3
- * 4-by-4
- * 5-by-5
- * 9-by-9
- * 10-by-10
- ==> passed
- Test 5: Test dimension() with random N-by-N boards
- * 2-by-2
- * 3-by-3
- * 4-by-4
- * 5-by-5
- ==> passed
- Test 6: Test toString() with file inputs
- * puzzle04.txt
- * puzzle00.txt
- * puzzle06.txt
- * puzzle09.txt
- * puzzle23.txt
- * puzzle2x2-unsolvable1.txt
- ==> passed
- Test 7: Test neighbors() with file inputs to ensure that the correct neighbor board are generated
- * puzzle04.txt
- * puzzle00.txt
- * puzzle06.txt
- * puzzle09.txt
- * puzzle23.txt
- * puzzle2x2-unsolvable1.txt
- ==> passed
- Test 8: Test neighbors() with random N-by-N boards
- * 2-by-2
- * 3-by-3
- * 4-by-4
- * 5-by-5
- * 9-by-9
- * 10-by-10
- ==> passed
- Test 9: Test twin() with file inputs to ensure that a correct twin is generated
- * puzzle04.txt
- * puzzle00.txt
- * puzzle06.txt
- * puzzle09.txt
- * puzzle23.txt
- * puzzle2x2-unsolvable1.txt
- ==> passed
- Test 10: Test twin() with random N-by-N boards
- * 2-by-2
- * 3-by-3
- * 4-by-4
- * 5-by-5
- * 9-by-9
- * 10-by-10
- ==> passed
- Test 11: Test isGoal() on file inputs
- * puzzle00.txt
- * puzzle04.txt
- * puzzle16.txt
- * puzzle06.txt
- * puzzle09.txt
- * puzzle23.txt
- * puzzle2x2-unsolvable1.txt
- * puzzle3x3-unsolvable1.txt
- * puzzle3x3-00.txt
- * puzzle4x4-00.txt
- ==> passed
- Test 12: Test isGoal() on N-by-N goal boards
- * 2-by-2
- * 3-by-3
- * 4-by-4
- * 5-by-5
- * 6-by-6
- * 100-by-100
- ==> passed
- Test 13: Check whether two Board objects can be created at the same time
- * random boards of size 3-by-3 and 3-by-3
- * random boards of size 4-by-4 and 4-by-4
- * random boards of size 2-by-2 and 2-by-2
- * random boards of size 3-by-3 and 4-by-4
- * random boards of size 4-by-4 and 3-by-3
- ==> passed
- Test 14: Check equals()
- * reflexive
- * symmetric
- * checks that individual entries of array are equal
- * argument is object of type String
- java.lang.ClassCastException: java.lang.String cannot be cast to Board
- Board.equals(Board.java:202)
- TestBoard.test14(TestBoard.java:809)
- TestBoard.main(TestBoard.java:1244)
- - cannot check for equality with a String object
- * argument is object of type Object
- * argument is null
- java.lang.NullPointerException
- Board.equals(Board.java:203)
- TestBoard.test14(TestBoard.java:844)
- TestBoard.main(TestBoard.java:1244)
- - fails when argument is null
- * argument is Board of different dimension
- ==> FAILED
- Test 15: Check that Board is immutable by changing argument array after construction
- and making sure Board does not change
- ==> passed
- Test 16: Check that Board is immutable by testing whether methods
- return the same value, regardless of order in which called
- * puzzle10.txt
- * puzzle20.txt
- * puzzle30.txt
- * 2-by-2
- * 3-by-3
- * 4-by-4
- ==> passed
- Test 17: Call hamming() on a board that is kth-neighbor of a board
- * 0th neighbor of puzzle27.txt
- * 1th neighbor of puzzle27.txt
- * 2th neighbor of puzzle27.txt
- * 13th neighbor of puzzle27.txt
- * 13th neighbor of puzzle00.txt
- * 13th neighbor of puzzle2x2-unsolvable1.txt
- ==> passed
- Test 18: Call manhattan() on a board that is a kth-neighbor of a board
- * 0th neighbor of puzzle27.txt
- * 1th neighbor of puzzle27.txt
- * 2th neighbor of puzzle27.txt
- * 13th neighbor of puzzle27.txt
- * 13th neighbor of puzzle00.txt
- * 13th neighbor of puzzle2x2-unsolvable1.txt
- ==> passed
- Total: 17/18 tests passed!
- ================================================================
- ******************************************************************************
- * correctness (substituting reference Board.java)
- ******************************************************************************
- Testing methods in Solver
- *-----------------------------------------------------------
- Running 9 total tests.
- Test 1: Call moves() with file inputs to ensure that Solver solves the puzzle in the correct minimum number of moves
- * puzzle00.txt
- * puzzle01.txt
- * puzzle02.txt
- * puzzle03.txt
- * puzzle04.txt
- * puzzle05.txt
- * puzzle06.txt
- * puzzle07.txt
- * puzzle08.txt
- * puzzle09.txt
- * puzzle10.txt
- * puzzle11.txt
- * puzzle12.txt
- * puzzle13.txt
- ==> passed
- Test 2: Call solution() with file inputs to ensure that the correct sequence of moves is followed
- * puzzle00.txt
- * puzzle01.txt
- * puzzle02.txt
- * puzzle03.txt
- * puzzle04.txt
- * puzzle05.txt
- * puzzle06.txt
- * puzzle07.txt
- * puzzle08.txt
- * puzzle10.txt
- * puzzle15.txt
- ==> passed
- Test 3: Create multiple Solver objects at the same time and still correctly function
- * puzzle04.txt and puzzle04.txt
- * puzzle00.txt and puzzle04.txt
- * puzzle04.txt and puzzle00.txt
- ==> passed
- Test 4: Call isSolvable() with file inputs
- * puzzle01.txt
- * puzzle03.txt
- * puzzle04.txt
- * puzzle17.txt
- * puzzle3x3-unsolvable1.txt
- * puzzle3x3-unsolvable2.txt
- * puzzle4x4-unsolvable.txt
- ==> passed
- Test 5: Call isSolvable() on random 2-by-2 puzzles
- * 2-by-2
- ==> passed
- Test 6: Call moves() on unsolvable puzzles
- * puzzle2x2-unsolvable1.txt
- * puzzle2x2-unsolvable2.txt
- * puzzle3x3-unsolvable1.txt
- * puzzle3x3-unsolvable2.txt
- * puzzle4x4-unsolvable.txt
- ==> passed
- Test 7: Call solution() on unsolvable puzzles
- * puzzle2x2-unsolvable1.txt
- java.lang.UnsupportedOperationException
- Solver.solution(Solver.java:470)
- TestSolver.testUnsolvableSolution(TestSolver.java:158)
- TestSolver.test7(TestSolver.java:347)
- TestSolver.main(TestSolver.java:502)
- * puzzle2x2-unsolvable2.txt
- java.lang.UnsupportedOperationException
- Solver.solution(Solver.java:470)
- TestSolver.testUnsolvableSolution(TestSolver.java:158)
- TestSolver.test7(TestSolver.java:348)
- TestSolver.main(TestSolver.java:502)
- * puzzle3x3-unsolvable1.txt
- java.lang.UnsupportedOperationException
- Solver.solution(Solver.java:470)
- TestSolver.testUnsolvableSolution(TestSolver.java:158)
- TestSolver.test7(TestSolver.java:349)
- TestSolver.main(TestSolver.java:502)
- * puzzle3x3-unsolvable2.txt
- java.lang.UnsupportedOperationException
- Solver.solution(Solver.java:470)
- TestSolver.testUnsolvableSolution(TestSolver.java:158)
- TestSolver.test7(TestSolver.java:350)
- TestSolver.main(TestSolver.java:502)
- * puzzle4x4-unsolvable.txt
- java.lang.UnsupportedOperationException
- Solver.solution(Solver.java:470)
- TestSolver.testUnsolvableSolution(TestSolver.java:158)
- TestSolver.test7(TestSolver.java:351)
- TestSolver.main(TestSolver.java:502)
- ==> FAILED
- Test 8: Check that Solver is immutable by comparing the results of two calls
- each to moves(), isSolvable(), and solution(). The results of these
- two consecutive calls must match.
- ==> passed
- Test 9: Call moves() with file inputs
- * puzzle14.txt
- * puzzle15.txt
- * puzzle16.txt
- * puzzle17.txt
- * puzzle18.txt
- * puzzle19.txt
- * puzzle20.txt
- * puzzle21.txt
- * puzzle22.txt
- * puzzle23.txt
- * puzzle24.txt
- * puzzle25.txt
- * puzzle26.txt
- * puzzle27.txt
- * puzzle28.txt
- * puzzle29.txt
- * puzzle30.txt
- * puzzle31.txt
- ==> passed
- Total: 8/9 tests passed!
- ================================================================
- ******************************************************************************
- * memory
- ******************************************************************************
- Computing memory of Board
- *-----------------------------------------------------------
- Running 8 total tests.
- Memory usage of an N-by-N board
- N student (bytes) reference (bytes)
- ----------------------------------------------------------
- => FAILED 4 296 248
- => FAILED 8 616 568
- => FAILED 12 1064 1016
- => FAILED 16 1640 1592
- => FAILED 20 2344 2296
- => FAILED 36 6440 6392
- => FAILED 72 23144 23096
- => passed 120 61544 61496
- ==> 1/8 tests passed
- Total: 1/8 tests passed!
- Student memory = 4.00 N^2 + 32.00 N + 104.00 (R^2 = 1.000)
- Reference memory = 4.00 N^2 + 32.00 N + 56.00 (R^2 = 1.000)
- ================================================================
- ******************************************************************************
- * timing
- ******************************************************************************
- Timing Solver
- *-----------------------------------------------------------
- Running 17 total tests.
- Timing tests use your implementation of Board.java and Solver.java. Maximum allowed time per puzzle is 15 seconds.
- delMin()
- filename N seconds insert() + delMax() max PQ size
- ---------------------------------------------------------------------------------------------
- Aborting tests: puzzle20.txt took 15.724 seconds to complete.
- ==> 0/17 tests passed
- Total: 0/17 tests passed!
- ================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement