Advertisement
Guest User

Untitled

a guest
Mar 15th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.28 KB | None | 0 0
  1. The following files were submitted:
  2. ----------------------------------
  3. total 36K
  4. -rw-r--r-- 1 6.4K Mar 15 09:52 Board.java
  5. -rw-r--r-- 1 17K Mar 15 09:52 Solver.java
  6. -rw-r--r-- 1 5.1K Mar 15 09:52 studentSubmission.zip
  7.  
  8.  
  9. ******************************************************************************
  10. * compiling
  11. ******************************************************************************
  12.  
  13.  
  14. % javac Board.java
  15. *-----------------------------------------------------------
  16. ================================================================
  17.  
  18. % javac Solver.java
  19. *-----------------------------------------------------------
  20. ================================================================
  21.  
  22.  
  23.  
  24. % checkstyle *.java
  25. *-----------------------------------------------------------
  26. ================================================================
  27.  
  28.  
  29. % findbugs *.class
  30. *-----------------------------------------------------------
  31. 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]
  32. 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]
  33. M B NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT NP: Board.equals(Object) does not check for null argument At Board.java:[lines 202-203]
  34. 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]
  35. 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]
  36. 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]
  37. Warnings generated: 6
  38. ================================================================
  39.  
  40.  
  41. Testing the APIs of your programs.
  42. *-----------------------------------------------------------
  43. Board:
  44.  
  45. Solver:
  46.  
  47. ================================================================
  48.  
  49.  
  50. ******************************************************************************
  51. * correctness
  52. ******************************************************************************
  53.  
  54. Testing methods in Board
  55. *-----------------------------------------------------------
  56. Running 18 total tests.
  57.  
  58. Tests 6-9 and 17-18 rely upon toString() returning a board in the prescribed format.
  59.  
  60. Test 1: Test hamming() with file inputs
  61. * puzzle04.txt
  62. * puzzle00.txt
  63. * puzzle07.txt
  64. * puzzle17.txt
  65. * puzzle27.txt
  66. * puzzle2x2-unsolvable1.txt
  67. ==> passed
  68.  
  69. Test 2: Test hamming() with random N-by-N boards
  70. * 2-by-2
  71. * 3-by-3
  72. * 4-by-4
  73. * 5-by-5
  74. * 9-by-9
  75. * 10-by-10
  76. ==> passed
  77.  
  78. Test 3: Test manhattan() with file inputs
  79. * puzzle04.txt
  80. * puzzle00.txt
  81. * puzzle07.txt
  82. * puzzle17.txt
  83. * puzzle27.txt
  84. * puzzle2x2-unsolvable1.txt
  85. ==> passed
  86.  
  87. Test 4: Test manhattan() with random N-by-N boards
  88. * 2-by-2
  89. * 3-by-3
  90. * 4-by-4
  91. * 5-by-5
  92. * 9-by-9
  93. * 10-by-10
  94. ==> passed
  95.  
  96. Test 5: Test dimension() with random N-by-N boards
  97. * 2-by-2
  98. * 3-by-3
  99. * 4-by-4
  100. * 5-by-5
  101. ==> passed
  102.  
  103. Test 6: Test toString() with file inputs
  104. * puzzle04.txt
  105. * puzzle00.txt
  106. * puzzle06.txt
  107. * puzzle09.txt
  108. * puzzle23.txt
  109. * puzzle2x2-unsolvable1.txt
  110. ==> passed
  111.  
  112. Test 7: Test neighbors() with file inputs to ensure that the correct neighbor board are generated
  113. * puzzle04.txt
  114. * puzzle00.txt
  115. * puzzle06.txt
  116. * puzzle09.txt
  117. * puzzle23.txt
  118. * puzzle2x2-unsolvable1.txt
  119. ==> passed
  120.  
  121. Test 8: Test neighbors() with random N-by-N boards
  122. * 2-by-2
  123. * 3-by-3
  124. * 4-by-4
  125. * 5-by-5
  126. * 9-by-9
  127. * 10-by-10
  128. ==> passed
  129.  
  130. Test 9: Test twin() with file inputs to ensure that a correct twin is generated
  131. * puzzle04.txt
  132. * puzzle00.txt
  133. * puzzle06.txt
  134. * puzzle09.txt
  135. * puzzle23.txt
  136. * puzzle2x2-unsolvable1.txt
  137. ==> passed
  138.  
  139. Test 10: Test twin() with random N-by-N boards
  140. * 2-by-2
  141. * 3-by-3
  142. * 4-by-4
  143. * 5-by-5
  144. * 9-by-9
  145. * 10-by-10
  146. ==> passed
  147.  
  148. Test 11: Test isGoal() on file inputs
  149. * puzzle00.txt
  150. * puzzle04.txt
  151. * puzzle16.txt
  152. * puzzle06.txt
  153. * puzzle09.txt
  154. * puzzle23.txt
  155. * puzzle2x2-unsolvable1.txt
  156. * puzzle3x3-unsolvable1.txt
  157. * puzzle3x3-00.txt
  158. * puzzle4x4-00.txt
  159. ==> passed
  160.  
  161. Test 12: Test isGoal() on N-by-N goal boards
  162. * 2-by-2
  163. * 3-by-3
  164. * 4-by-4
  165. * 5-by-5
  166. * 6-by-6
  167. * 100-by-100
  168. ==> passed
  169.  
  170. Test 13: Check whether two Board objects can be created at the same time
  171. * random boards of size 3-by-3 and 3-by-3
  172. * random boards of size 4-by-4 and 4-by-4
  173. * random boards of size 2-by-2 and 2-by-2
  174. * random boards of size 3-by-3 and 4-by-4
  175. * random boards of size 4-by-4 and 3-by-3
  176. ==> passed
  177.  
  178. Test 14: Check equals()
  179. * reflexive
  180. * symmetric
  181. * checks that individual entries of array are equal
  182. * argument is object of type String
  183. java.lang.ClassCastException: java.lang.String cannot be cast to Board
  184. Board.equals(Board.java:202)
  185. TestBoard.test14(TestBoard.java:809)
  186. TestBoard.main(TestBoard.java:1244)
  187.  
  188. - cannot check for equality with a String object
  189. * argument is object of type Object
  190. * argument is null
  191. java.lang.NullPointerException
  192. Board.equals(Board.java:203)
  193. TestBoard.test14(TestBoard.java:844)
  194. TestBoard.main(TestBoard.java:1244)
  195.  
  196. - fails when argument is null
  197. * argument is Board of different dimension
  198. ==> FAILED
  199.  
  200. Test 15: Check that Board is immutable by changing argument array after construction
  201. and making sure Board does not change
  202. ==> passed
  203.  
  204. Test 16: Check that Board is immutable by testing whether methods
  205. return the same value, regardless of order in which called
  206. * puzzle10.txt
  207. * puzzle20.txt
  208. * puzzle30.txt
  209. * 2-by-2
  210. * 3-by-3
  211. * 4-by-4
  212. ==> passed
  213.  
  214. Test 17: Call hamming() on a board that is kth-neighbor of a board
  215. * 0th neighbor of puzzle27.txt
  216. * 1th neighbor of puzzle27.txt
  217. * 2th neighbor of puzzle27.txt
  218. * 13th neighbor of puzzle27.txt
  219. * 13th neighbor of puzzle00.txt
  220. * 13th neighbor of puzzle2x2-unsolvable1.txt
  221. ==> passed
  222.  
  223. Test 18: Call manhattan() on a board that is a kth-neighbor of a board
  224. * 0th neighbor of puzzle27.txt
  225. * 1th neighbor of puzzle27.txt
  226. * 2th neighbor of puzzle27.txt
  227. * 13th neighbor of puzzle27.txt
  228. * 13th neighbor of puzzle00.txt
  229. * 13th neighbor of puzzle2x2-unsolvable1.txt
  230. ==> passed
  231.  
  232.  
  233. Total: 17/18 tests passed!
  234.  
  235. ================================================================
  236.  
  237. ******************************************************************************
  238. * correctness (substituting reference Board.java)
  239. ******************************************************************************
  240.  
  241. Testing methods in Solver
  242. *-----------------------------------------------------------
  243. Running 9 total tests.
  244.  
  245. Test 1: Call moves() with file inputs to ensure that Solver solves the puzzle in the correct minimum number of moves
  246. * puzzle00.txt
  247. * puzzle01.txt
  248. * puzzle02.txt
  249. * puzzle03.txt
  250. * puzzle04.txt
  251. * puzzle05.txt
  252. * puzzle06.txt
  253. * puzzle07.txt
  254. * puzzle08.txt
  255. * puzzle09.txt
  256. * puzzle10.txt
  257. * puzzle11.txt
  258. * puzzle12.txt
  259. * puzzle13.txt
  260. ==> passed
  261.  
  262. Test 2: Call solution() with file inputs to ensure that the correct sequence of moves is followed
  263. * puzzle00.txt
  264. * puzzle01.txt
  265. * puzzle02.txt
  266. * puzzle03.txt
  267. * puzzle04.txt
  268. * puzzle05.txt
  269. * puzzle06.txt
  270. * puzzle07.txt
  271. * puzzle08.txt
  272. * puzzle10.txt
  273. * puzzle15.txt
  274. ==> passed
  275.  
  276. Test 3: Create multiple Solver objects at the same time and still correctly function
  277. * puzzle04.txt and puzzle04.txt
  278. * puzzle00.txt and puzzle04.txt
  279. * puzzle04.txt and puzzle00.txt
  280. ==> passed
  281.  
  282. Test 4: Call isSolvable() with file inputs
  283. * puzzle01.txt
  284. * puzzle03.txt
  285. * puzzle04.txt
  286. * puzzle17.txt
  287. * puzzle3x3-unsolvable1.txt
  288. * puzzle3x3-unsolvable2.txt
  289. * puzzle4x4-unsolvable.txt
  290. ==> passed
  291.  
  292. Test 5: Call isSolvable() on random 2-by-2 puzzles
  293. * 2-by-2
  294. ==> passed
  295.  
  296. Test 6: Call moves() on unsolvable puzzles
  297. * puzzle2x2-unsolvable1.txt
  298. * puzzle2x2-unsolvable2.txt
  299. * puzzle3x3-unsolvable1.txt
  300. * puzzle3x3-unsolvable2.txt
  301. * puzzle4x4-unsolvable.txt
  302. ==> passed
  303.  
  304. Test 7: Call solution() on unsolvable puzzles
  305. * puzzle2x2-unsolvable1.txt
  306. java.lang.UnsupportedOperationException
  307. Solver.solution(Solver.java:470)
  308. TestSolver.testUnsolvableSolution(TestSolver.java:158)
  309. TestSolver.test7(TestSolver.java:347)
  310. TestSolver.main(TestSolver.java:502)
  311.  
  312. * puzzle2x2-unsolvable2.txt
  313. java.lang.UnsupportedOperationException
  314. Solver.solution(Solver.java:470)
  315. TestSolver.testUnsolvableSolution(TestSolver.java:158)
  316. TestSolver.test7(TestSolver.java:348)
  317. TestSolver.main(TestSolver.java:502)
  318.  
  319. * puzzle3x3-unsolvable1.txt
  320. java.lang.UnsupportedOperationException
  321. Solver.solution(Solver.java:470)
  322. TestSolver.testUnsolvableSolution(TestSolver.java:158)
  323. TestSolver.test7(TestSolver.java:349)
  324. TestSolver.main(TestSolver.java:502)
  325.  
  326. * puzzle3x3-unsolvable2.txt
  327. java.lang.UnsupportedOperationException
  328. Solver.solution(Solver.java:470)
  329. TestSolver.testUnsolvableSolution(TestSolver.java:158)
  330. TestSolver.test7(TestSolver.java:350)
  331. TestSolver.main(TestSolver.java:502)
  332.  
  333. * puzzle4x4-unsolvable.txt
  334. java.lang.UnsupportedOperationException
  335. Solver.solution(Solver.java:470)
  336. TestSolver.testUnsolvableSolution(TestSolver.java:158)
  337. TestSolver.test7(TestSolver.java:351)
  338. TestSolver.main(TestSolver.java:502)
  339.  
  340. ==> FAILED
  341.  
  342. Test 8: Check that Solver is immutable by comparing the results of two calls
  343. each to moves(), isSolvable(), and solution(). The results of these
  344. two consecutive calls must match.
  345. ==> passed
  346.  
  347. Test 9: Call moves() with file inputs
  348. * puzzle14.txt
  349. * puzzle15.txt
  350. * puzzle16.txt
  351. * puzzle17.txt
  352. * puzzle18.txt
  353. * puzzle19.txt
  354. * puzzle20.txt
  355. * puzzle21.txt
  356. * puzzle22.txt
  357. * puzzle23.txt
  358. * puzzle24.txt
  359. * puzzle25.txt
  360. * puzzle26.txt
  361. * puzzle27.txt
  362. * puzzle28.txt
  363. * puzzle29.txt
  364. * puzzle30.txt
  365. * puzzle31.txt
  366. ==> passed
  367.  
  368.  
  369. Total: 8/9 tests passed!
  370.  
  371. ================================================================
  372.  
  373. ******************************************************************************
  374. * memory
  375. ******************************************************************************
  376.  
  377. Computing memory of Board
  378. *-----------------------------------------------------------
  379. Running 8 total tests.
  380.  
  381. Memory usage of an N-by-N board
  382.  
  383. N student (bytes) reference (bytes)
  384. ----------------------------------------------------------
  385. => FAILED 4 296 248
  386. => FAILED 8 616 568
  387. => FAILED 12 1064 1016
  388. => FAILED 16 1640 1592
  389. => FAILED 20 2344 2296
  390. => FAILED 36 6440 6392
  391. => FAILED 72 23144 23096
  392. => passed 120 61544 61496
  393. ==> 1/8 tests passed
  394.  
  395. Total: 1/8 tests passed!
  396.  
  397. Student memory = 4.00 N^2 + 32.00 N + 104.00 (R^2 = 1.000)
  398. Reference memory = 4.00 N^2 + 32.00 N + 56.00 (R^2 = 1.000)
  399.  
  400. ================================================================
  401.  
  402.  
  403.  
  404. ******************************************************************************
  405. * timing
  406. ******************************************************************************
  407.  
  408. Timing Solver
  409. *-----------------------------------------------------------
  410. Running 17 total tests.
  411.  
  412. Timing tests use your implementation of Board.java and Solver.java. Maximum allowed time per puzzle is 15 seconds.
  413.  
  414. delMin()
  415. filename N seconds insert() + delMax() max PQ size
  416. ---------------------------------------------------------------------------------------------
  417. Aborting tests: puzzle20.txt took 15.724 seconds to complete.
  418. ==> 0/17 tests passed
  419.  
  420. Total: 0/17 tests passed!
  421.  
  422. ================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement