-
Notifications
You must be signed in to change notification settings - Fork 0
/
feedback.html
1353 lines (1040 loc) · 45.7 KB
/
feedback.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<title>Autograder Feedback</title>
<meta charset="UTF-8">
</head>
<body>
<p>
<em>
See the Assessment Guide for information on how to interpret this report.
</em>
<br><br>
<h2>ASSESSMENT SUMMARY</h2>
<pre>
Compilation: <font color = #009900>PASSED</font>
API: <font color = #009900>PASSED</font>
SpotBugs: <font color = #009900>PASSED</font>
PMD: <font color = #990000>FAILED (6 warnings)</font>
Checkstyle: <font color = #990000>FAILED (0 errors, 4 warnings)</font>
Correctness: <font color = #3F9900>29/41 tests passed</font>
Memory: <font color = #009900>1/1 tests passed</font>
Timing: <font color = #009900>41/41 tests passed</font>
Aggregate score: 82.44%
[ Compilation: 5%, API: 5%, Style: 0%, Correctness: 60%, Timing: 10%, Memory: 20% ]
</pre>
<br><br>
<h2>ASSESSMENT DETAILS</h2>
<pre>
The following files were submitted:
----------------------------------
2.1K Aug 23 21:10 BruteCollinearPoints.java
3.1K Aug 23 21:10 FastCollinearPoints.java
4.6K Aug 23 21:10 Point.java
********************************************************************************
* COMPILING
********************************************************************************
% javac Point.java
*-----------------------------------------------------------
% javac LineSegment.java
*-----------------------------------------------------------
% javac BruteCollinearPoints.java
*-----------------------------------------------------------
% javac FastCollinearPoints.java
*-----------------------------------------------------------
================================================================
Checking the APIs of your programs.
*-----------------------------------------------------------
Point:
BruteCollinearPoints:
FastCollinearPoints:
================================================================
********************************************************************************
* CHECKING STYLE AND COMMON BUG PATTERNS
********************************************************************************
% spotbugs *.class
*-----------------------------------------------------------
================================================================
% pmd .
*-----------------------------------------------------------
BruteCollinearPoints.java:17: Too many control variables in the for statement [ForLoopVariableCount]
BruteCollinearPoints.java:50: Array initialization can be written shorter [UseShortArrayInitializer]
FastCollinearPoints.java:6: The private instance (or static) variable 'segments' can be made 'final'; it is initialized only in the declaration or constructor. [ImmutableField]
FastCollinearPoints.java:78: Unnecessary use of fully qualified name 'java.lang.IllegalArgumentException' due to existing implicit import 'java.lang.*'. [UnnecessaryFullyQualifiedName]
FastCollinearPoints.java:89: Unnecessary use of fully qualified name 'java.lang.NullPointerException' due to existing implicit import 'java.lang.*'. [UnnecessaryFullyQualifiedName]
FastCollinearPoints.java:95: Array initialization can be written shorter [UseShortArrayInitializer]
PMD ends with 6 warnings.
================================================================
% checkstyle *.java
*-----------------------------------------------------------
[WARN] Point.java:69:23: Typecast is not followed by whitespace. [WhitespaceAfter]
[WARN] Point.java:69:51: Typecast is not followed by whitespace. [WhitespaceAfter]
[WARN] Point.java:109:20: The local variable 'slope_1' must start with a lowercase letter and use camelCase. [LocalVariableName]
[WARN] Point.java:110:20: The local variable 'slope_2' must start with a lowercase letter and use camelCase. [LocalVariableName]
Checkstyle ends with 0 errors and 4 warnings.
% custom checkstyle checks for Point.java
*-----------------------------------------------------------
% custom checkstyle checks for BruteCollinearPoints.java
*-----------------------------------------------------------
% custom checkstyle checks for FastCollinearPoints.java
*-----------------------------------------------------------
================================================================
********************************************************************************
* TESTING CORRECTNESS
********************************************************************************
Testing correctness of Point
*-----------------------------------------------------------
Running 3 total tests.
Test 1: p.slopeTo(q)
* positive infinite slope, where p and q have coordinates in [0, 500)
* positive infinite slope, where p and q have coordinates in [0, 32768)
* negative infinite slope, where p and q have coordinates in [0, 500)
* negative infinite slope, where p and q have coordinates in [0, 32768)
* positive zero slope, where p and q have coordinates in [0, 500)
* positive zero slope, where p and q have coordinates in [0, 32768)
* symmetric for random points p and q with coordinates in [0, 500)
* symmetric for random points p and q with coordinates in [0, 32768)
* transitive for random points p, q, and r with coordinates in [0, 500)
* transitive for random points p, q, and r with coordinates in [0, 32768)
* slopeTo(), where p and q have coordinates in [0, 500)
* slopeTo(), where p and q have coordinates in [0, 32768)
* slopeTo(), where p and q have coordinates in [0, 10)
* throw a java.lang.NullPointerException if argument is null
==> passed
Test 2: p.compareTo(q)
* reflexive, where p and q have coordinates in [0, 500)
* reflexive, where p and q have coordinates in [0, 32768)
* antisymmetric, where p and q have coordinates in [0, 500)
* antisymmetric, where p and q have coordinates in [0, 32768)
* transitive, where p, q, and r have coordinates in [0, 500)
* transitive, where p, q, and r have coordinates in [0, 32768)
* sign of compareTo(), where p and q have coordinates in [0, 500)
* sign of compareTo(), where p and q have coordinates in [0, 32768)
* sign of compareTo(), where p and q have coordinates in [0, 10)
* throw java.lang.NullPointerException exception if argument is null
==> passed
Test 3: p.slopeOrder().compare(q, r)
* reflexive, where p and q have coordinates in [0, 500)
* reflexive, where p and q have coordinates in [0, 32768)
* antisymmetric, where p, q, and r have coordinates in [0, 500)
* antisymmetric, where p, q, and r have coordinates in [0, 32768)
* transitive, where p, q, r, and s have coordinates in [0, 500)
* transitive, where p, q, r, and s have coordinates in [0, 32768)
* sign of compare(), where p, q, and r have coordinates in [0, 500)
* sign of compare(), where p, q, and r have coordinates in [0, 32768)
* sign of compare(), where p, q, and r have coordinates in [0, 10)
* throw java.lang.NullPointerException if either argument is null
==> passed
Total: 3/3 tests passed!
================================================================
********************************************************************************
* TESTING CORRECTNESS (substituting reference Point and LineSegment)
********************************************************************************
Testing correctness of BruteCollinearPoints
*-----------------------------------------------------------
Running 17 total tests.
The inputs satisfy the following conditions:
- no duplicate points
- no 5 (or more) points are collinear
- all x- and y-coordinates between 0 and 32,767
Test 1: points from a file
* filename = input8.txt
- segments() contains the same segment more than once
- segment 0: (10000, 0) -> (0, 10000)
- segment 1: (10000, 0) -> (0, 10000)
- number of entries in student solution: 6
- number of entries in reference solution: 2
- 5 extra entries in student solution, including:
'(10000, 0) -> (0, 10000)'
- 1 missing entry in student solution:
'(3000, 4000) -> (6000, 7000) -> (14000, 15000) -> (20000, 21000)'
* filename = equidistant.txt
- segments() contains the same segment more than once
- segment 0: (10000, 0) -> (2000, 8000)
- segment 1: (10000, 0) -> (2000, 8000)
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (10000, 0) -> (2000, 8000)
- reference segment 1: (10000, 0) -> (8000, 2000) -> (2000, 8000) -> (0, 10000)
- number of entries in student solution: 22
- number of entries in reference solution: 4
- 22 extra entries in student solution, including:
'(0, 10000) -> (10000, 20000)'
- 4 missing entries in student solution, including:
'(30000, 0) -> (20000, 10000) -> (10000, 20000) -> (0, 30000)'
* filename = input40.txt
- segments() contains the same segment more than once
- segment 0: (18000, 5000) -> (13000, 17000)
- segment 1: (18000, 5000) -> (13000, 17000)
- number of entries in student solution: 41
- number of entries in reference solution: 4
- 41 extra entries in student solution, including:
'(19000, 26000) -> (10000, 31000)'
- 4 missing entries in student solution, including:
'(2000, 29000) -> (4000, 29000) -> (22000, 29000) -> (28000, 29000)'
* filename = input48.txt
- segments() contains the same segment more than once
- segment 0: (26000, 27000) -> (16000, 22000)
- segment 1: (26000, 27000) -> (16000, 22000)
- number of entries in student solution: 60
- number of entries in reference solution: 6
- 60 extra entries in student solution, including:
'(24000, 30000) -> (23000, 29000)'
- 6 missing entries in student solution, including:
'(1000, 26000) -> (9000, 26000) -> (11000, 26000) -> (18000, 26000)'
==> <font color = #990000><b>FAILED</b></font>
Test 2a: points from a file with horizontal line segments
* filename = horizontal5.txt
- segments() contains the same segment more than once
- segment 0: (7453, 14118) -> (7821, 14118)
- segment 1: (7453, 14118) -> (7821, 14118)
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (7453, 14118) -> (7821, 14118)
- reference segment 4: (2682, 14118) -> (5067, 14118) -> (7453, 14118) -> (7821, 14118)
- number of entries in student solution: 45
- number of entries in reference solution: 5
- 45 extra entries in student solution, including:
'(7453, 14118) -> (7821, 14118)'
- 5 missing entries in student solution, including:
'(2682, 14118) -> (5067, 14118) -> (7453, 14118) -> (7821, 14118)'
* filename = horizontal25.txt
- segments() contains the same segment more than once
- segment 0: (19459, 13870) -> (10653, 13870)
- segment 1: (19459, 13870) -> (10653, 13870)
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (19459, 13870) -> (10653, 13870)
- reference segment 13: (2566, 13870) -> (10653, 13870) -> (18005, 13870) -> (19459, 13870)
- number of entries in student solution: 1225
- number of entries in reference solution: 25
- 1225 extra entries in student solution, including:
'(19459, 13870) -> (10653, 13870)'
- 25 missing entries in student solution, including:
'(8784, 20913) -> (9880, 20913) -> (16352, 20913) -> (19666, 20913)'
==> <font color = #990000><b>FAILED</b></font>
Test 2b: random horizontal line segments
* 1 random horizontal line segment
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (18101, 8415) -> (8665, 8415)
- reference segment 0: (1070, 8415) -> (8665, 8415) -> (11313, 8415) -> (18101, 8415)
- number of entries in student solution: 1
- number of entries in reference solution: 1
- 1 extra entry in student solution:
'(18101, 8415) -> (8665, 8415)'
- 1 missing entry in student solution:
'(1070, 8415) -> (8665, 8415) -> (11313, 8415) -> (18101, 8415)'
- failed on trial 2 of 500
4
18101 8415
1070 8415
8665 8415
11313 8415
* 5 random horizontal line segments
- segments() contains the same segment more than once
- segment 1: (13918, 20336) -> (19971, 13445)
- segment 2: (13918, 20336) -> (19971, 13445)
- number of entries in student solution: 23
- number of entries in reference solution: 5
- 23 extra entries in student solution, including:
'(16893, 20336) -> (5331, 19219)'
- 5 missing entries in student solution, including:
'(3323, 20336) -> (5220, 20336) -> (13918, 20336) -> (16893, 20336)'
- failed on trial 1 of 250
20
15781 19219
6846 19028
13918 20336
3741 10083
6319 19028
7086 10083
19971 13445
9327 19028
13402 19028
16712 10083
16893 20336
5331 19219
18577 19219
18050 13445
19443 13445
14503 13445
5220 20336
3323 20336
4523 10083
6205 19219
* 10 random horizontal line segments
- segments() contains the same segment more than once
- segment 0: (9908, 12761) -> (6058, 15033)
- segment 1: (9908, 12761) -> (6058, 15033)
- number of entries in student solution: 82
- number of entries in reference solution: 10
- 82 extra entries in student solution, including:
'(3658, 20299) -> (9911, 14055)'
- 10 missing entries in student solution, including:
'(2186, 20299) -> (3658, 20299) -> (16882, 20299) -> (20178, 20299)'
- failed on trial 1 of 50
* 15 random horizontal line segments
- segments() contains the same segment more than once
- segment 0: (19388, 7055) -> (17193, 12671)
- segment 1: (19388, 7055) -> (17193, 12671)
- number of entries in student solution: 162
- number of entries in reference solution: 15
- 162 extra entries in student solution, including:
'(12773, 17612) -> (4883, 17100)'
- 15 missing entries in student solution, including:
'(2704, 20356) -> (10257, 20356) -> (11338, 20356) -> (14716, 20356)'
- failed on trial 1 of 5
==> <font color = #990000><b>FAILED</b></font>
Test 3a: points from a file with vertical line segments
* filename = vertical5.txt
- segments() contains the same segment more than once
- segment 0: (14407, 19953) -> (14407, 17831)
- segment 1: (14407, 19953) -> (14407, 17831)
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (14407, 19953) -> (14407, 17831)
- reference segment 3: (14407, 10367) -> (14407, 17188) -> (14407, 17831) -> (14407, 19953)
- number of entries in student solution: 45
- number of entries in reference solution: 5
- 45 extra entries in student solution, including:
'(14407, 19953) -> (14407, 17831)'
- 5 missing entries in student solution, including:
'(14407, 10367) -> (14407, 17188) -> (14407, 17831) -> (14407, 19953)'
* filename = vertical25.txt
- segments() contains the same segment more than once
- segment 0: (11585, 5103) -> (11585, 12912)
- segment 1: (11585, 5103) -> (11585, 12912)
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (11585, 5103) -> (11585, 12912)
- reference segment 12: (11585, 4132) -> (11585, 5103) -> (11585, 11220) -> (11585, 12912)
- number of entries in student solution: 1225
- number of entries in reference solution: 25
- 1225 extra entries in student solution, including:
'(11585, 5103) -> (11585, 12912)'
- 25 missing entries in student solution, including:
'(19953, 10489) -> (19953, 10688) -> (19953, 19299) -> (19953, 20439)'
==> <font color = #990000><b>FAILED</b></font>
Test 3b: random vertical line segments
* 1 random vertical line segment
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (14877, 20528) -> (14877, 19937)
- reference segment 0: (14877, 5886) -> (14877, 6901) -> (14877, 19937) -> (14877, 20528)
- number of entries in student solution: 1
- number of entries in reference solution: 1
- 1 extra entry in student solution:
'(14877, 20528) -> (14877, 19937)'
- 1 missing entry in student solution:
'(14877, 5886) -> (14877, 6901) -> (14877, 19937) -> (14877, 20528)'
- failed on trial 1 of 500
4
14877 20528
14877 19937
14877 6901
14877 5886
* 5 random vertical line segments
- segments() contains the same segment more than once
- segment 0: (12709, 5927) -> (17372, 13446)
- segment 1: (12709, 5927) -> (17372, 13446)
- number of entries in student solution: 28
- number of entries in reference solution: 5
- 28 extra entries in student solution, including:
'(17372, 14232) -> (12709, 14959)'
- 5 missing entries in student solution, including:
'(20624, 12396) -> (20624, 14270) -> (20624, 14300) -> (20624, 19181)'
- failed on trial 1 of 250
20
17372 14232
12709 15214
12709 5927
17372 7028
12709 14959
15702 9879
12709 8508
17240 2458
15702 8907
15702 13130
17240 8789
17372 13446
17372 6635
20624 12396
17240 11186
20624 19181
20624 14270
20624 14300
15702 3782
17240 20204
* 10 random vertical line segments
- segments() contains the same segment more than once
- segment 0: (7168, 20172) -> (15544, 16298)
- segment 1: (7168, 20172) -> (15544, 16298)
- segments() contains a subsegment of a segment in reference solution
- student segment 18: (15544, 17403) -> (15544, 16298)
- reference segment 8: (15544, 5362) -> (15544, 5445) -> (15544, 16298) -> (15544, 17403)
- number of entries in student solution: 80
- number of entries in reference solution: 10
- 80 extra entries in student solution, including:
'(7168, 20172) -> (15544, 16298)'
- 10 missing entries in student solution, including:
'(2015, 10198) -> (2015, 10954) -> (2015, 15404) -> (2015, 16888)'
- failed on trial 1 of 50
* 15 random vertical line segments
- segments() contains the same segment more than once
- segment 0: (18792, 17185) -> (20319, 17383)
- segment 1: (18792, 17185) -> (20319, 17383)
- number of entries in student solution: 182
- number of entries in reference solution: 15
- 182 extra entries in student solution, including:
'(18792, 17185) -> (20319, 17383)'
- 15 missing entries in student solution, including:
'(6388, 14255) -> (6388, 14604) -> (6388, 15054) -> (6388, 17370)'
- failed on trial 1 of 5
==> <font color = #990000><b>FAILED</b></font>
Test 4a: points from a file with no line segments
* filename = random23.txt
* filename = random38.txt
==> passed
Test 4b: random points with no line segments
* 5 random points
* 10 random points
* 20 random points
* 50 random points
==> passed
Test 5: points from a file with fewer than 4 points
* filename = input1.txt
* filename = input2.txt
* filename = input3.txt
==> passed
Test 6: check for dependence on either compareTo() or compare()
returning { -1, +1, 0 } instead of { negative integer,
positive integer, zero }
* filename = equidistant.txt
- segments() contains the same segment more than once
- segment 0: (10000, 0) -> (2000, 8000)
- segment 1: (10000, 0) -> (2000, 8000)
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (10000, 0) -> (2000, 8000)
- reference segment 1: (10000, 0) -> (8000, 2000) -> (2000, 8000) -> (0, 10000)
- number of entries in student solution: 22
- number of entries in reference solution: 4
- 22 extra entries in student solution, including:
'(0, 10000) -> (10000, 20000)'
- 4 missing entries in student solution, including:
'(30000, 0) -> (20000, 10000) -> (10000, 20000) -> (0, 30000)'
* filename = input40.txt
- segments() contains the same segment more than once
- segment 0: (18000, 5000) -> (13000, 17000)
- segment 1: (18000, 5000) -> (13000, 17000)
- number of entries in student solution: 41
- number of entries in reference solution: 4
- 41 extra entries in student solution, including:
'(19000, 26000) -> (10000, 31000)'
- 4 missing entries in student solution, including:
'(2000, 29000) -> (4000, 29000) -> (22000, 29000) -> (28000, 29000)'
* filename = input48.txt
- segments() contains the same segment more than once
- segment 0: (26000, 27000) -> (16000, 22000)
- segment 1: (26000, 27000) -> (16000, 22000)
- number of entries in student solution: 60
- number of entries in reference solution: 6
- 60 extra entries in student solution, including:
'(24000, 30000) -> (23000, 29000)'
- 6 missing entries in student solution, including:
'(1000, 26000) -> (9000, 26000) -> (11000, 26000) -> (18000, 26000)'
==> <font color = #990000><b>FAILED</b></font>
Test 7: check for fragile dependence on return value of toString()
* filename = equidistant.txt
- segments() contains the same segment more than once
- segment 0: (10000, 0) -> (2000, 8000)
- segment 1: (10000, 0) -> (2000, 8000)
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (10000, 0) -> (2000, 8000)
- reference segment 1: (10000, 0) -> (8000, 2000) -> (2000, 8000) -> (0, 10000)
- number of entries in student solution: 22
- number of entries in reference solution: 4
- 22 extra entries in student solution, including:
'(0, 10000) -> (10000, 20000)'
- 4 missing entries in student solution, including:
'(30000, 0) -> (20000, 10000) -> (10000, 20000) -> (0, 30000)'
* filename = input40.txt
- segments() contains the same segment more than once
- segment 0: (18000, 5000) -> (13000, 17000)
- segment 1: (18000, 5000) -> (13000, 17000)
- number of entries in student solution: 41
- number of entries in reference solution: 4
- 41 extra entries in student solution, including:
'(19000, 26000) -> (10000, 31000)'
- 4 missing entries in student solution, including:
'(2000, 29000) -> (4000, 29000) -> (22000, 29000) -> (28000, 29000)'
* filename = input48.txt
- segments() contains the same segment more than once
- segment 0: (26000, 27000) -> (16000, 22000)
- segment 1: (26000, 27000) -> (16000, 22000)
- number of entries in student solution: 60
- number of entries in reference solution: 6
- 60 extra entries in student solution, including:
'(24000, 30000) -> (23000, 29000)'
- 6 missing entries in student solution, including:
'(1000, 26000) -> (9000, 26000) -> (11000, 26000) -> (18000, 26000)'
It is bad style to write code that depends on the particular format of
the output from the toString() method, especially if your reason for
doing so is to circumvent the public API (which intentionally does not
provide access to the x- and y-coordinates).
==> <font color = #990000><b>FAILED</b></font>
Test 8: random line segments, none vertical or horizontal
* 1 random line segment
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (5587, 7053) -> (13042, 9048)
- reference segment 0: (4593, 6787) -> (5587, 7053) -> (8072, 7718) -> (13042, 9048)
- number of entries in student solution: 1
- number of entries in reference solution: 1
- 1 extra entry in student solution:
'(5587, 7053) -> (13042, 9048)'
- 1 missing entry in student solution:
'(4593, 6787) -> (5587, 7053) -> (8072, 7718) -> (13042, 9048)'
- failed on trial 1 of 500
4
5587 7053
13042 9048
8072 7718
4593 6787
* 5 random line segments
- segments() contains the same segment more than once
- segment 0: (6300, 3395) -> (6846, 14089)
- segment 1: (6300, 3395) -> (6846, 14089)
- segments() contains a subsegment of a segment in reference solution
- student segment 19: (15756, 11510) -> (16562, 13134)
- reference segment 3: (12935, 5826) -> (15756, 11510) -> (16562, 13134) -> (17368, 14758)
- number of entries in student solution: 20
- number of entries in reference solution: 5
- 20 extra entries in student solution, including:
'(15756, 11510) -> (16562, 13134)'
- 5 missing entries in student solution, including:
'(476, 11429) -> (2751, 12379) -> (5026, 13329) -> (6846, 14089)'
- failed on trial 1 of 250
20
15756 11510
476 11429
6300 3395
17368 14758
8352 13415
12741 15260
6471 4230
6371 505
10607 5371
6981 11246
2751 12379
16562 13134
5026 13329
8181 12580
2181 7901
14661 16598
6846 14089
12935 5826
14137 9426
11313 6182
* 10 random line segments
- segments() contains the same segment more than once
- segment 0: (9155, 11865) -> (6742, 9972)
- segment 1: (9155, 11865) -> (6742, 9972)
- segments() contains a subsegment of a segment in reference solution
- student segment 40: (7966, 12787) -> (6574, 10767)
- reference segment 6: (2050, 4202) -> (6574, 10767) -> (7966, 12787) -> (9010, 14302)
- number of entries in student solution: 67
- number of entries in reference solution: 10
- 67 extra entries in student solution, including:
'(9095, 17804) -> (13215, 14230)'
- 10 missing entries in student solution, including:
'(3471, 8554) -> (9155, 11865) -> (10779, 12811) -> (13215, 14230)'
- failed on trial 1 of 100
* 15 random line segments
- segments() contains the same segment more than once
- segment 0: (11442, 9535) -> (6380, 1967)
- segment 1: (11442, 9535) -> (6380, 1967)
- number of entries in student solution: 163
- number of entries in reference solution: 15
- 163 extra entries in student solution, including:
'(14516, 18325) -> (19378, 19547)'
- 15 missing entries in student solution, including:
'(900, 9989) -> (1751, 10510) -> (3453, 11552) -> (14516, 18325)'
- failed on trial 1 of 50
==> <font color = #990000><b>FAILED</b></font>
Test 9: random line segments
* 1 random line segment
- segments() contains a subsegment of a segment in reference solution
- student segment 0: (4927, 2016) -> (5410, 4132)
- reference segment 0: (4780, 1372) -> (4927, 2016) -> (5410, 4132) -> (5641, 5144)
- number of entries in student solution: 1
- number of entries in reference solution: 1
- 1 extra entry in student solution:
'(4927, 2016) -> (5410, 4132)'
- 1 missing entry in student solution:
'(4780, 1372) -> (4927, 2016) -> (5410, 4132) -> (5641, 5144)'
- failed on trial 1 of 500
4
4927 2016
4780 1372
5410 4132
5641 5144
* 5 random line segments
- segments() contains the same segment more than once
- segment 1: (12048, 4847) -> (13348, 6491)
- segment 2: (12048, 4847) -> (13348, 6491)
- segments() contains a subsegment of a segment in reference solution
- student segment 23: (6544, 13300) -> (4044, 12200)
- reference segment 2: (4044, 12200) -> (5944, 13036) -> (6544, 13300) -> (8944, 14356)
- number of entries in student solution: 25
- number of entries in reference solution: 5
- 25 extra entries in student solution, including:
'(8944, 14356) -> (6743, 12439)'
- 5 missing entries in student solution, including:
'(5445, 12439) -> (6743, 12439) -> (7923, 12439) -> (9339, 12439)'
- failed on trial 1 of 250
20
9339 12439
6544 13300
12048 4847
13348 6491
8944 14356
5944 13036
4641 8533
13578 5493
5796 10808
4044 12200
6743 12439
13517 7388
13608 7871
13848 5607
6828 2643
13894 9389
6720 12628
7923 12439
5433 10093
5445 12439
* 10 random line segments
- segments() contains the same segment more than once
- segment 0: (9957, 10517) -> (3524, 5386)
- segment 1: (9957, 10517) -> (3524, 5386)
- number of entries in student solution: 107
- number of entries in reference solution: 10
- 107 extra entries in student solution, including:
'(3172, 12963) -> (5019, 12736)'
- 10 missing entries in student solution, including:
'(3172, 12963) -> (6217, 13348) -> (6478, 13381) -> (6826, 13425)'
- failed on trial 1 of 100
* 15 random line segments
- segments() contains the same segment more than once
- segment 0: (6573, 4436) -> (5321, 9931)
- segment 1: (6573, 4436) -> (5321, 9931)
- number of entries in student solution: 159
- number of entries in reference solution: 15
- 159 extra entries in student solution, including:
'(4664, 14415) -> (13429, 11661)'
- 15 missing entries in student solution, including:
'(13429, 11661) -> (13444, 11663) -> (13984, 11735) -> (14884, 11855)'
- failed on trial 1 of 50
==> <font color = #990000><b>FAILED</b></font>
Test 10: check that data type is immutable by testing whether each method
returns the same value, regardless of any intervening operations
* input8.txt
* equidistant.txt
==> passed
Test 11: check that data type does not mutate the constructor argument
* input8.txt
* equidistant.txt
==> passed
Test 12: numberOfSegments() is consistent with segments()
* filename = input8.txt
* filename = equidistant.txt
* filename = input40.txt
* filename = input48.txt
* filename = horizontal5.txt
* filename = vertical5.txt
* filename = random23.txt
==> passed
Test 13: throws an exception if either the constructor argument is null
or any entry in array is null
* argument is null
* Point[] of length 10, number of null entries = 1
- constructor throws wrong exception
- constructor throws a java.lang.NullPointerException
- constructor should throw a java.lang.IllegalArgumentException
10
4005 524
19215 18693
6836 17837
5701 4507
19828 17628
15623 25780
null
32010 30146
32259 27118
4985 2397
* Point[] of length 10, number of null entries = 10
* Point[] of length 4, number of null entries = 1
- constructor throws wrong exception
- constructor throws a java.lang.NullPointerException
- constructor should throw a java.lang.IllegalArgumentException
4
8925 6790
19609 6578
29130 9026
null
* Point[] of length 3, number of null entries = 1
* Point[] of length 2, number of null entries = 1
* Point[] of length 1, number of null entries = 1
- constructor fails to throw an exception
1
null
==> <font color = #990000><b>FAILED</b></font>
Test 14: check that the constructor throws an exception if duplicate points
* 50 points
- failed on trial 1 of 5
- constructor fails to throw a java.lang.IllegalArgumentException when passed duplicate points
* 25 points
- failed on trial 1 of 10
- constructor fails to throw a java.lang.IllegalArgumentException when passed duplicate points
* 5 points
- failed on trial 1 of 100
- constructor fails to throw a java.lang.IllegalArgumentException when passed duplicate points
5
12461 4238
6821 7269
2154 3446
12461 4238
31149 5358
* 4 points
- failed on trial 1 of 100
- constructor fails to throw a java.lang.IllegalArgumentException when passed duplicate points
4
9926 16084
27419 11715
27419 11715
343 7984
* 3 points
- failed on trial 1 of 100
- constructor fails to throw a java.lang.IllegalArgumentException when passed duplicate points
3
16567 22197
19408 29469
19408 29469
* 2 points
- failed on trial 1 of 100
- constructor fails to throw a java.lang.IllegalArgumentException when passed duplicate points
2
4992 861
4992 861
==> <font color = #990000><b>FAILED</b></font>
Total: 6/17 tests passed!
================================================================
Testing correctness of FastCollinearPoints
*-----------------------------------------------------------
Running 21 total tests.
The inputs satisfy the following conditions:
- no duplicate points
- all x- and y-coordinates between 0 and 32,767
Test 1: points from a file
* filename = input8.txt
* filename = equidistant.txt
* filename = input40.txt
* filename = input48.txt
* filename = input299.txt
==> passed
Test 2a: points from a file with horizontal line segments
* filename = horizontal5.txt
* filename = horizontal25.txt
* filename = horizontal50.txt
* filename = horizontal75.txt
* filename = horizontal100.txt
==> passed
Test 2b: random horizontal line segments
* 1 random horizontal line segment
* 5 random horizontal line segments
* 10 random horizontal line segments
* 15 random horizontal line segments
==> passed
Test 3a: points from a file with vertical line segments
* filename = vertical5.txt
* filename = vertical25.txt
* filename = vertical50.txt
* filename = vertical75.txt
* filename = vertical100.txt
==> passed
Test 3b: random vertical line segments
* 1 random vertical line segment
* 5 random vertical line segments