Skip to content

Commit

Permalink
Added acceptance tests (and a script that generates random tests) tha…
Browse files Browse the repository at this point in the history
…t I wrote for

the Fall, 2009, version of the Refactoring course. These probably aren't complete
in any grand sense of the word, but they hopefully give us some reasonable safety
net to support refactoring.
  • Loading branch information
NicMcPhee committed Jan 16, 2014
1 parent 8f39109 commit 562ee14
Show file tree
Hide file tree
Showing 40 changed files with 1,978 additions and 0 deletions.
@@ -0,0 +1,4 @@
1 1
1
1
10 1
@@ -0,0 +1,4 @@
1 1
-1
1
1 1
@@ -0,0 +1,4 @@
1 1
1
-1
1 1
@@ -0,0 +1,4 @@
1 0
1
1
1 1
@@ -0,0 +1,4 @@
0 1
1
1
1 1
@@ -0,0 +1,4 @@
1 1
1
1
0 1
@@ -0,0 +1,4 @@
1 1
1
1
1 0
@@ -0,0 +1,4 @@
1 1
1
0
1 1
4 changes: 4 additions & 0 deletions acceptanceTests/Machine_shop_test_files/AllOnes.input
@@ -0,0 +1,4 @@
1 1
1
1
1 1
9 changes: 9 additions & 0 deletions acceptanceTests/Machine_shop_test_files/AllOnes.output
@@ -0,0 +1,9 @@
Enter number of machines and jobs
Enter change-over times for machines
Enter number of tasks for job 1
Enter the tasks (machine, time) in process order
Job 1 has completed at 1 Total wait was 0
Finish time = 1
Machine 1 completed 1 tasks
The total wait time was 0

14 changes: 14 additions & 0 deletions acceptanceTests/Machine_shop_test_files/MachineShopSimulator.input
@@ -0,0 +1,14 @@
3 6
2 0 1
3
1 2 2 4 3 3
2
2 2 1 4
4
3 6 2 1 3 2 1 3
2
1 3 2 4
1
1 2
5
2 2 1 2 3 3 1 1 2 3
@@ -0,0 +1,30 @@
Enter number of machines and jobs
Enter change-over times for machines
Enter number of tasks for job 1
Enter the tasks (machine, time) in process order
Enter number of tasks for job 2
Enter the tasks (machine, time) in process order
Enter number of tasks for job 3
Enter the tasks (machine, time) in process order
Enter number of tasks for job 4
Enter the tasks (machine, time) in process order
Enter number of tasks for job 5
Enter the tasks (machine, time) in process order
Enter number of tasks for job 6
Enter the tasks (machine, time) in process order
Job 5 has completed at 11 Total wait was 9
Job 1 has completed at 11 Total wait was 2
Job 4 has completed at 13 Total wait was 6
Job 2 has completed at 17 Total wait was 11
Job 3 has completed at 26 Total wait was 14
Job 6 has completed at 32 Total wait was 21
Finish time = 32
Machine 1 completed 7 tasks
The total wait time was 52

Machine 2 completed 6 tasks
The total wait time was 8

Machine 3 completed 4 tasks
The total wait time was 3

@@ -0,0 +1,4 @@
1 1
1
5
1 2 1 4 1 6 1 8 1 10
@@ -0,0 +1,9 @@
Enter number of machines and jobs
Enter change-over times for machines
Enter number of tasks for job 1
Enter the tasks (machine, time) in process order
Job 1 has completed at 34 Total wait was 4
Finish time = 34
Machine 1 completed 5 tasks
The total wait time was 4

46 changes: 46 additions & 0 deletions acceptanceTests/Machine_shop_test_files/RandTest0.input
@@ -0,0 +1,46 @@
12 22
27 8 1 28 30 17 3 19 24 20 1 23
15
12 32 12 11 5 8 6 7 4 21 5 23 6 21 6 17 2 20 10 26 5 24 9 22 5 14 3 16 10 32
31
2 13 7 27 9 2 5 17 3 8 5 5 1 16 2 12 6 1 7 25 4 31 6 22 10 7 11 31 7 9 9 11 7 25 4 3 3 11 7 9 3 4 10 21 10 13 11 23 3 8 12 22 1 7 12 16 9 8 8 22 5 22
30
12 1 11 16 11 24 9 2 1 9 3 7 7 6 11 27 11 1 2 24 9 21 10 31 7 21 3 26 11 10 12 29 8 7 8 3 4 14 4 29 5 32 1 15 3 15 6 9 2 25 3 25 10 28 5 2 9 16 7 8
11
9 15 9 12 7 4 10 24 3 12 2 25 11 25 6 4 3 7 2 8 12 22
1
2 12
8
1 12 8 21 7 24 8 24 11 29 5 14 11 2 10 21
4
7 30 6 4 11 18 6 24
26
6 11 2 4 12 29 2 24 1 29 6 12 9 7 1 24 3 13 2 31 7 29 7 31 11 1 12 14 12 2 10 4 3 29 5 31 4 10 2 30 9 3 9 31 3 22 2 12 4 29 5 26
7
5 21 2 15 3 25 6 23 5 31 3 16 7 6
16
4 9 4 17 11 14 7 21 2 17 3 2 11 2 4 4 4 32 4 22 8 1 12 25 2 19 1 10 1 13 1 11
26
6 5 4 14 6 16 10 16 1 29 1 18 12 4 1 13 6 13 1 17 2 15 8 32 9 14 4 29 4 2 5 5 6 7 3 30 10 13 2 17 5 27 2 17 12 20 5 29 12 19 1 11
17
2 6 10 18 9 24 11 9 12 32 1 26 12 18 2 17 11 14 8 8 10 19 2 19 7 22 9 10 12 14 3 14 6 31
8
1 30 12 20 12 26 12 6 2 27 2 10 2 21 6 9
25
7 18 5 17 4 9 4 18 9 4 8 26 9 1 9 28 11 17 4 24 1 4 8 1 3 27 6 19 5 16 4 24 5 19 4 25 4 27 5 22 3 14 10 32 10 3 9 7 8 19
27
10 21 4 2 8 8 3 20 8 27 7 10 1 26 7 14 6 19 1 31 3 22 9 8 4 24 10 11 3 16 1 31 12 19 7 2 5 17 5 16 6 8 12 21 4 29 5 12 11 16 8 29 6 27
29
7 11 9 9 11 14 9 11 1 5 7 15 3 22 9 22 7 7 12 26 6 4 12 31 10 23 12 10 6 1 4 12 7 17 6 30 10 8 11 15 11 30 8 19 3 25 5 24 10 31 1 5 12 28 4 15 11 13
32
10 32 1 32 1 7 7 8 2 29 3 15 12 15 3 4 7 24 12 19 8 27 5 9 12 20 11 26 1 3 6 7 12 27 8 18 8 16 1 6 1 12 11 6 4 25 7 28 7 18 11 21 12 12 9 23 9 23 5 27 6 32 12 19
22
7 15 1 7 8 4 12 9 3 5 12 3 9 10 5 18 10 7 9 19 5 21 3 26 10 14 8 5 3 32 9 20 6 7 10 3 9 26 9 2 11 9 6 21
11
9 3 6 20 7 10 1 1 4 24 12 2 11 1 7 13 8 29 3 11 10 11
32
11 24 3 1 1 1 12 6 12 4 7 19 8 1 12 27 4 27 2 18 8 2 7 17 1 25 9 1 8 19 9 28 8 5 12 17 11 28 7 27 9 16 10 21 4 7 2 21 7 2 8 8 5 3 6 6 2 24 5 29 10 12 8 19
1
6 1
21
2 3 1 30 3 19 9 4 4 25 8 30 9 9 10 12 10 29 2 7 5 25 1 6 12 3 2 31 6 31 8 11 10 29 12 7 7 9 11 30 1 16
105 changes: 105 additions & 0 deletions acceptanceTests/Machine_shop_test_files/RandTest0.output
@@ -0,0 +1,105 @@
Enter number of machines and jobs
Enter change-over times for machines
Enter number of tasks for job 1
Enter the tasks (machine, time) in process order
Enter number of tasks for job 2
Enter the tasks (machine, time) in process order
Enter number of tasks for job 3
Enter the tasks (machine, time) in process order
Enter number of tasks for job 4
Enter the tasks (machine, time) in process order
Enter number of tasks for job 5
Enter the tasks (machine, time) in process order
Enter number of tasks for job 6
Enter the tasks (machine, time) in process order
Enter number of tasks for job 7
Enter the tasks (machine, time) in process order
Enter number of tasks for job 8
Enter the tasks (machine, time) in process order
Enter number of tasks for job 9
Enter the tasks (machine, time) in process order
Enter number of tasks for job 10
Enter the tasks (machine, time) in process order
Enter number of tasks for job 11
Enter the tasks (machine, time) in process order
Enter number of tasks for job 12
Enter the tasks (machine, time) in process order
Enter number of tasks for job 13
Enter the tasks (machine, time) in process order
Enter number of tasks for job 14
Enter the tasks (machine, time) in process order
Enter number of tasks for job 15
Enter the tasks (machine, time) in process order
Enter number of tasks for job 16
Enter the tasks (machine, time) in process order
Enter number of tasks for job 17
Enter the tasks (machine, time) in process order
Enter number of tasks for job 18
Enter the tasks (machine, time) in process order
Enter number of tasks for job 19
Enter the tasks (machine, time) in process order
Enter number of tasks for job 20
Enter the tasks (machine, time) in process order
Enter number of tasks for job 21
Enter the tasks (machine, time) in process order
Enter number of tasks for job 22
Enter the tasks (machine, time) in process order
Job 5 has completed at 33 Total wait was 21
Job 21 has completed at 51 Total wait was 50
Job 7 has completed at 150 Total wait was 74
Job 6 has completed at 295 Total wait was 148
Job 9 has completed at 373 Total wait was 236
Job 4 has completed at 451 Total wait was 293
Job 19 has completed at 589 Total wait was 464
Job 13 has completed at 601 Total wait was 452
Job 1 has completed at 850 Total wait was 556
Job 12 has completed at 1030 Total wait was 729
Job 18 has completed at 1146 Total wait was 863
Job 10 has completed at 1151 Total wait was 932
Job 14 has completed at 1306 Total wait was 885
Job 22 has completed at 1388 Total wait was 1022
Job 3 has completed at 1489 Total wait was 1006
Job 2 has completed at 1593 Total wait was 1142
Job 16 has completed at 1649 Total wait was 1166
Job 8 has completed at 1739 Total wait was 1251
Job 17 has completed at 1847 Total wait was 1257
Job 15 has completed at 1910 Total wait was 1424
Job 20 has completed at 1928 Total wait was 1463
Job 11 has completed at 1986 Total wait was 1554
Finish time = 1986
Machine 1 completed 35 tasks
The total wait time was 5169

Machine 2 completed 32 tasks
The total wait time was 634

Machine 3 completed 34 tasks
The total wait time was 366

Machine 4 completed 31 tasks
The total wait time was 1370

Machine 5 completed 32 tasks
The total wait time was 2437

Machine 6 completed 33 tasks
The total wait time was 546

Machine 7 completed 36 tasks
The total wait time was 705

Machine 8 completed 29 tasks
The total wait time was 200

Machine 9 completed 36 tasks
The total wait time was 1270

Machine 10 completed 31 tasks
The total wait time was 680

Machine 11 completed 30 tasks
The total wait time was 204

Machine 12 completed 41 tasks
The total wait time was 3407

42 changes: 42 additions & 0 deletions acceptanceTests/Machine_shop_test_files/RandTest1.input
@@ -0,0 +1,42 @@
14 20
10 8 26 29 2 15 4 18 6 30 26 9 24 9
15
10 7 10 11 11 5 2 8 1 21 7 25 10 29 12 11 11 15 7 4 14 23 2 19 14 16 1 1 2 27
27
8 10 8 30 11 23 4 18 8 11 14 4 2 28 11 26 6 18 3 25 6 13 2 1 11 3 5 2 2 32 11 4 2 25 12 5 12 19 1 17 3 16 8 25 4 25 4 9 5 8 14 6 1 7
32
3 4 12 32 5 8 1 26 3 8 2 4 10 13 6 30 4 15 1 9 7 9 8 2 14 10 5 8 14 18 6 6 9 6 2 22 4 21 2 8 6 32 8 9 1 32 10 8 13 3 13 10 4 24 8 28 11 5 12 32 6 27 12 18
17
5 8 3 22 1 24 3 3 12 4 6 30 14 13 13 26 5 27 1 13 10 3 2 21 3 21 3 31 10 20 4 21 7 22
13
9 2 14 10 4 17 3 1 10 32 14 5 13 8 13 6 6 2 1 3 11 13 14 12 12 22
18
8 5 3 7 3 4 1 9 7 12 14 3 6 27 11 30 1 4 12 24 7 21 14 24 7 15 11 17 11 4 13 17 1 20 7 22
29
10 5 7 10 3 28 3 14 14 22 13 11 2 17 12 2 6 28 1 3 2 22 12 29 10 26 3 5 5 22 11 14 2 22 2 6 8 25 2 16 10 17 14 32 2 32 1 9 13 5 4 1 3 5 11 26 7 9
22
14 23 5 1 11 32 11 2 5 11 6 17 11 13 3 26 7 12 4 24 4 28 10 8 5 5 5 9 3 30 10 27 9 8 5 4 5 25 4 3 6 28 8 29
19
6 22 4 14 5 30 7 16 13 13 3 26 5 13 7 22 9 24 9 29 11 14 5 23 12 16 10 30 7 22 6 19 4 22 11 8 5 23
22
7 11 5 1 11 20 12 19 12 1 14 12 7 13 6 8 6 23 3 22 2 18 8 17 9 20 4 17 8 12 5 5 5 11 8 6 6 32 6 21 1 2 1 9
26
6 2 10 17 7 23 6 6 1 29 14 30 14 3 4 28 7 29 14 32 2 29 13 26 1 30 4 20 6 21 4 30 12 10 5 25 6 7 8 24 6 1 13 30 6 24 12 18 13 27 9 21
1
7 7
7
6 4 12 29 3 16 1 2 11 13 14 14 11 18
7
3 23 4 15 1 20 8 32 9 20 13 9 11 7
14
7 17 12 9 12 15 8 18 1 22 11 23 14 5 4 11 12 30 11 23 5 4 1 11 7 2 9 28
2
1 27 8 16
6
6 9 2 14 13 24 12 18 2 19 12 14
20
9 27 2 20 7 5 11 13 3 12 14 6 8 3 14 28 14 12 11 28 4 26 13 17 6 21 3 9 12 6 11 7 4 16 3 18 6 1 13 28
31
14 8 13 8 8 30 4 28 12 26 9 31 4 21 3 25 2 18 7 17 1 4 8 19 10 21 2 6 7 7 14 21 11 13 8 32 10 31 8 23 11 3 7 18 11 31 11 2 3 6 8 21 11 20 4 5 8 13 9 21 12 9
25
12 23 10 13 13 21 3 2 6 23 11 27 1 12 5 13 10 5 5 3 10 17 3 4 12 6 5 7 13 26 12 17 9 10 4 16 2 17 6 16 2 30 4 12 3 1 2 30 11 1

0 comments on commit 562ee14

Please sign in to comment.