Repository navigation
Expand file tree
/
Copy pathgraph.dot
More file actions
113 lines (113 loc) · 17.1 KB
/
Copy pathgraph.dot
File metadata and controls
113 lines (113 loc) · 17.1 KB
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
strict digraph {
start [style=filled, fillcolor=yellow];
"start_date=datetime.datetime.now()\nstart_time=time.perf_counter" [style=filled, fillcolor="", shape=""];
"min_a=input()\nmax_a=input()\nmin_b=input()\nmax_b=input()" [style=filled, fillcolor="", shape=""];
"shape=input('Choose T, R')\ntestername=input('Testername')\netcp=input('Choose B, W, R, WR)" [style=filled, fillcolor="", shape=""];
"testcases=[]" [style=filled, fillcolor="", shape=""];
"match etcp" [style=filled, fillcolor="", shape=""];
"testcase=bva(\n min_a, max_a,\n min_b, max_b,\n shape)" [style=filled, fillcolor="", shape=""];
"testcase=worse_case(\n min_a, max_a,\n min_b, max_b,\n shape)" [style=filled, fillcolor="", shape=""];
"testcase=robustness(\n min_a, max_a,\n min_b, max_b,\n shape)" [style=filled, fillcolor="", shape=""];
"testcase=worse_case_robustness(\n min_a, max_a,\n min_b, max_b,\n shape)" [style=filled, fillcolor="", shape=""];
"result_testcase=show_testcase(testcases)" [style=filled, fillcolor="", shape=""];
"result=Format_of_testcase_to_save.txt(Header, Body, Footer)" [style=filled, fillcolor="", shape=""];
"f=open('result.txt', 'w')\nf.write(result)\nf.close()" [style=filled, fillcolor="", shape=""];
End [style=filled, fillcolor=yellow, shape=""];
"calculate_area_shape(shape, a, b)" [style=filled, fillcolor=yellow, shape=""];
"if shape" [style=filled, fillcolor="", shape=""];
"return 1/2 * (a*b)" [style=filled, fillcolor="", shape=""];
"return a*b" [style=filled, fillcolor="", shape=""];
"Join\nCalculate\nAre\nShape" [style=filled, fillcolor=yellow, shape=""];
"bva(min_a, max_a,\nmin_b, max_b, shape)" [style=filled, fillcolor=yellow, shape=""];
"center_a = (min_a+max_a)//2\ncenter_b = (min_b+max_b)//2\ntestcase=[]" [style=filled, fillcolor="", shape=""];
"for i in\n[min_b, min_b+1, max_b, max_b-1]" [style=filled, fillcolor="", shape=""];
"testcase = (center_a, i, (calculate_area_shape(shape, center_a, i)))\ntestcases.append(testcase)" [style=filled, fillcolor="", shape=""];
"for j in [min_a, min_a+1, max_a, max_a-1]" [style=filled, fillcolor="", shape=""];
"testcase = (j, center_b, (calculate_area_shape(shape, j, center_b)))\ntestcases.append(testcase)" [style=filled, fillcolor="", shape=""];
"center_testcase = (center_a, center_b, calculate_area_shape(shape, center_a, center_b))\ntestcases.append(center_testcase)" [style=filled, fillcolor="", shape=""];
"return testcases\n# BVA" [style=filled, fillcolor=yellow, shape=""];
"robustness(min_a, max_a,\nmin_b, max_b,\nshape)" [style=filled, fillcolor=yellow, shape=""];
"r_testcases = bva(min_a, max_a,\nmin_b, max_b,\nshape)" [style=filled, fillcolor="", shape=""];
" # Find center of a and b\ncenter_a = (min_a+max_a)//2\ncenter_b = (min_b+max_b)//2" [style=filled, fillcolor="", shape=""];
"# New Testcase of R\nnew_testcases = [\n (min_a-1, center_b, calculate_area_shape(shape, min_a-1, center_b)),\n (max_a+1, center_b, calculate_area_shape(shape, max_a+1, center_b)),\n (center_a, min_b-1, calculate_area_shape(shape, center_a, min_b-1)),\n (center_a, max_b-1, calculate_area_shape(shape, center_a, max_b-1)),\n ]" [style=filled, fillcolor="", shape=""];
"r_testcases.extend(new_testcases)" [style=filled, fillcolor="", shape=""];
"return r_testcases" [style=filled, fillcolor=yellow, shape=""];
"worse_case(min_a, max_a,\nmin_b, max_b,\nshape)" [style=filled, fillcolor=yellow, shape=""];
"w_testcase=bva(min_a, max_a,\nmin_b, max_b,\nshape)" [style=filled, fillcolor="", shape=""];
"# min_a, min_b\n testcases1 = [\n (min_a, min_b, calculate_area_shape(shape, min_a, min_b)),\n (min_a+1, min_b, calculate_area_shape(shape, min_a+1, min_b)),\n (min_a+1, min_b+1, calculate_area_shape(shape, min_a+1, min_b+1)),\n (min_a, min_b+1, calculate_area_shape(shape, min_a, min_b+1)),\n ]" [style=filled, fillcolor="", shape=""];
"# max_a, min_b\n testcases2 = [\n (max_a, min_b, calculate_area_shape(shape, max_a, min_b)),\n (max_a-1, min_b, calculate_area_shape(shape, max_a-1, min_b)),\n (max_a-1, min_b+1, calculate_area_shape(shape, max_a-1, min_b+1)),\n (max_a, min_b+1, calculate_area_shape(shape, max_a, min_b+1)),\n ]" [style=filled, fillcolor="", shape=""];
"# min_a, max_b\n testcases3 = [\n (min_a, max_b, calculate_area_shape(shape, min_a, max_b)),\n (min_a+1, max_b, calculate_area_shape(shape, min_a+1, max_b)),\n (min_a+1, max_b-1, calculate_area_shape(shape, min_a+1, max_b-1)),\n (min_a, max_b-1, calculate_area_shape(shape, min_a, max_b-1)),\n ]" [style=filled, fillcolor="", shape=""];
"# max_a, max_b\n testcases4 = [\n (max_a, max_b, calculate_area_shape(shape, max_a, max_b)),\n (max_a-1, max_b, calculate_area_shape(shape, max_a-1, max_b)),\n (max_a-1, max_b-1, calculate_area_shape(shape, max_a-1, max_b-1)),\n (max_a, max_b-1, calculate_area_shape(shape, max_a, max_b-1)),\n ]" [style=filled, fillcolor="", shape=""];
"for i in [testcases1,\n testcases2,\n testcases3,\n testcases4]" [style=filled, fillcolor="", shape=""];
"r_testcases.extend(i)" [style=filled, fillcolor="", shape=""];
"return w_testcases" [style=filled, fillcolor=yellow, shape=""];
"worse_case_robustness(min_a, max_a,\nmin_b, max_b,\nshape)" [style=filled, fillcolor=yellow, shape=""];
"wr_testcases=robustness(min_a, max_a,\n min_b, max_b,\n shape)" [style=filled, fillcolor="", shape=""];
"for i in [(min_a, min_b),\n(min_a, max_b),\n(max_a, min_b),\n(max_a, max_b)]" [style=filled, fillcolor="", shape=""];
"wr_testcases.extend(\n create_new_testcases(i[0], i[1], shape)\n )" [style=filled, fillcolor="", shape=""];
"return wr_testcases" [style=filled, fillcolor=yellow, shape=""];
"create_new_testcases(a, b, shape)" [style=filled, fillcolor=yellow, shape=""];
"testcases = [\n (a, b, calculate_area_shape(shape, a, b)),\n (a, b+1, calculate_area_shape(shape, a, b+1)),\n (a, b-1, calculate_area_shape(shape, a, b-1)),\n (a+1, b, calculate_area_shape(shape, a+1, b)),\n (a+1, b+1, calculate_area_shape(shape, a+1, b+1)),\n (a+1, b-1, calculate_area_shape(shape, a+1, b-1)),\n (a-1, b, calculate_area_shape(shape, a-1, b)),\n (a-1, b+1, calculate_area_shape(shape, a-1, b+1)),\n (a-1, b-1, calculate_area_shape(shape, a-1, b-1))\n ]" [style=filled, fillcolor="", shape=""];
"return testcases # For WR cases" [style=filled, fillcolor=yellow, shape=""];
"show_testcase(testcases)" [style=filled, fillcolor=yellow, shape=""];
"texts=[]" [style=filled, fillcolor="", shape=""];
"for id, testcase in enumerate(testcases)" [style=filled, fillcolor="", shape=""];
"text = Format in each Testcases\ntexts.append(text)" [style=filled, fillcolor="", shape=""];
"return '\n'.join(texts)" [style=filled, fillcolor=yellow, shape=""];
start -> "start_date=datetime.datetime.now()\nstart_time=time.perf_counter" [label=""];
"start_date=datetime.datetime.now()\nstart_time=time.perf_counter" -> "min_a=input()\nmax_a=input()\nmin_b=input()\nmax_b=input()" [label=""];
"min_a=input()\nmax_a=input()\nmin_b=input()\nmax_b=input()" -> "shape=input('Choose T, R')\ntestername=input('Testername')\netcp=input('Choose B, W, R, WR)" [label=""];
"shape=input('Choose T, R')\ntestername=input('Testername')\netcp=input('Choose B, W, R, WR)" -> "testcases=[]" [label=""];
"testcases=[]" -> "match etcp" [label=""];
"match etcp" -> "testcase=bva(\n min_a, max_a,\n min_b, max_b,\n shape)" [label="etcp=='B'"];
"match etcp" -> "testcase=worse_case(\n min_a, max_a,\n min_b, max_b,\n shape)" [label="etcp=='W'"];
"match etcp" -> "testcase=robustness(\n min_a, max_a,\n min_b, max_b,\n shape)" [label="etcp=='R'"];
"match etcp" -> "testcase=worse_case_robustness(\n min_a, max_a,\n min_b, max_b,\n shape)" [label="etcp=='WR'"];
"testcase=bva(\n min_a, max_a,\n min_b, max_b,\n shape)" -> "result_testcase=show_testcase(testcases)" [label=""];
"testcase=worse_case(\n min_a, max_a,\n min_b, max_b,\n shape)" -> "result_testcase=show_testcase(testcases)" [label=""];
"testcase=robustness(\n min_a, max_a,\n min_b, max_b,\n shape)" -> "result_testcase=show_testcase(testcases)" [label=""];
"testcase=worse_case_robustness(\n min_a, max_a,\n min_b, max_b,\n shape)" -> "result_testcase=show_testcase(testcases)" [label=""];
"result_testcase=show_testcase(testcases)" -> "result=Format_of_testcase_to_save.txt(Header, Body, Footer)" [label=""];
"result=Format_of_testcase_to_save.txt(Header, Body, Footer)" -> "f=open('result.txt', 'w')\nf.write(result)\nf.close()" [label=""];
"f=open('result.txt', 'w')\nf.write(result)\nf.close()" -> End [label=""];
"calculate_area_shape(shape, a, b)" -> "if shape" [label=""];
"if shape" -> "return 1/2 * (a*b)" [label="shape=='T'"];
"if shape" -> "return a*b" [label="shape=='R'"];
"return 1/2 * (a*b)" -> "Join\nCalculate\nAre\nShape" [label=""];
"return a*b" -> "Join\nCalculate\nAre\nShape" [label=""];
"bva(min_a, max_a,\nmin_b, max_b, shape)" -> "center_a = (min_a+max_a)//2\ncenter_b = (min_b+max_b)//2\ntestcase=[]" [label=""];
"center_a = (min_a+max_a)//2\ncenter_b = (min_b+max_b)//2\ntestcase=[]" -> "for i in\n[min_b, min_b+1, max_b, max_b-1]" [label=""];
"for i in\n[min_b, min_b+1, max_b, max_b-1]" -> "testcase = (center_a, i, (calculate_area_shape(shape, center_a, i)))\ntestcases.append(testcase)" [label=""];
"testcase = (center_a, i, (calculate_area_shape(shape, center_a, i)))\ntestcases.append(testcase)" -> "for i in\n[min_b, min_b+1, max_b, max_b-1]" [label=""];
"testcase = (center_a, i, (calculate_area_shape(shape, center_a, i)))\ntestcases.append(testcase)" -> "for j in [min_a, min_a+1, max_a, max_a-1]" [label=""];
"for j in [min_a, min_a+1, max_a, max_a-1]" -> "testcase = (j, center_b, (calculate_area_shape(shape, j, center_b)))\ntestcases.append(testcase)" [label=""];
"testcase = (j, center_b, (calculate_area_shape(shape, j, center_b)))\ntestcases.append(testcase)" -> "for j in [min_a, min_a+1, max_a, max_a-1]" [label=""];
"testcase = (j, center_b, (calculate_area_shape(shape, j, center_b)))\ntestcases.append(testcase)" -> "center_testcase = (center_a, center_b, calculate_area_shape(shape, center_a, center_b))\ntestcases.append(center_testcase)" [label=""];
"center_testcase = (center_a, center_b, calculate_area_shape(shape, center_a, center_b))\ntestcases.append(center_testcase)" -> "return testcases\n# BVA" [label=""];
"robustness(min_a, max_a,\nmin_b, max_b,\nshape)" -> "r_testcases = bva(min_a, max_a,\nmin_b, max_b,\nshape)" [label=""];
"r_testcases = bva(min_a, max_a,\nmin_b, max_b,\nshape)" -> " # Find center of a and b\ncenter_a = (min_a+max_a)//2\ncenter_b = (min_b+max_b)//2" [label=""];
" # Find center of a and b\ncenter_a = (min_a+max_a)//2\ncenter_b = (min_b+max_b)//2" -> "# New Testcase of R\nnew_testcases = [\n (min_a-1, center_b, calculate_area_shape(shape, min_a-1, center_b)),\n (max_a+1, center_b, calculate_area_shape(shape, max_a+1, center_b)),\n (center_a, min_b-1, calculate_area_shape(shape, center_a, min_b-1)),\n (center_a, max_b-1, calculate_area_shape(shape, center_a, max_b-1)),\n ]" [label=""];
"# New Testcase of R\nnew_testcases = [\n (min_a-1, center_b, calculate_area_shape(shape, min_a-1, center_b)),\n (max_a+1, center_b, calculate_area_shape(shape, max_a+1, center_b)),\n (center_a, min_b-1, calculate_area_shape(shape, center_a, min_b-1)),\n (center_a, max_b-1, calculate_area_shape(shape, center_a, max_b-1)),\n ]" -> "r_testcases.extend(new_testcases)" [label=""];
"r_testcases.extend(new_testcases)" -> "return r_testcases" [label=""];
"worse_case(min_a, max_a,\nmin_b, max_b,\nshape)" -> "w_testcase=bva(min_a, max_a,\nmin_b, max_b,\nshape)" [label=""];
"w_testcase=bva(min_a, max_a,\nmin_b, max_b,\nshape)" -> "# min_a, min_b\n testcases1 = [\n (min_a, min_b, calculate_area_shape(shape, min_a, min_b)),\n (min_a+1, min_b, calculate_area_shape(shape, min_a+1, min_b)),\n (min_a+1, min_b+1, calculate_area_shape(shape, min_a+1, min_b+1)),\n (min_a, min_b+1, calculate_area_shape(shape, min_a, min_b+1)),\n ]" [label=""];
"# min_a, min_b\n testcases1 = [\n (min_a, min_b, calculate_area_shape(shape, min_a, min_b)),\n (min_a+1, min_b, calculate_area_shape(shape, min_a+1, min_b)),\n (min_a+1, min_b+1, calculate_area_shape(shape, min_a+1, min_b+1)),\n (min_a, min_b+1, calculate_area_shape(shape, min_a, min_b+1)),\n ]" -> "# max_a, min_b\n testcases2 = [\n (max_a, min_b, calculate_area_shape(shape, max_a, min_b)),\n (max_a-1, min_b, calculate_area_shape(shape, max_a-1, min_b)),\n (max_a-1, min_b+1, calculate_area_shape(shape, max_a-1, min_b+1)),\n (max_a, min_b+1, calculate_area_shape(shape, max_a, min_b+1)),\n ]" [label=""];
"# max_a, min_b\n testcases2 = [\n (max_a, min_b, calculate_area_shape(shape, max_a, min_b)),\n (max_a-1, min_b, calculate_area_shape(shape, max_a-1, min_b)),\n (max_a-1, min_b+1, calculate_area_shape(shape, max_a-1, min_b+1)),\n (max_a, min_b+1, calculate_area_shape(shape, max_a, min_b+1)),\n ]" -> "# min_a, max_b\n testcases3 = [\n (min_a, max_b, calculate_area_shape(shape, min_a, max_b)),\n (min_a+1, max_b, calculate_area_shape(shape, min_a+1, max_b)),\n (min_a+1, max_b-1, calculate_area_shape(shape, min_a+1, max_b-1)),\n (min_a, max_b-1, calculate_area_shape(shape, min_a, max_b-1)),\n ]" [label=""];
"# min_a, max_b\n testcases3 = [\n (min_a, max_b, calculate_area_shape(shape, min_a, max_b)),\n (min_a+1, max_b, calculate_area_shape(shape, min_a+1, max_b)),\n (min_a+1, max_b-1, calculate_area_shape(shape, min_a+1, max_b-1)),\n (min_a, max_b-1, calculate_area_shape(shape, min_a, max_b-1)),\n ]" -> "# max_a, max_b\n testcases4 = [\n (max_a, max_b, calculate_area_shape(shape, max_a, max_b)),\n (max_a-1, max_b, calculate_area_shape(shape, max_a-1, max_b)),\n (max_a-1, max_b-1, calculate_area_shape(shape, max_a-1, max_b-1)),\n (max_a, max_b-1, calculate_area_shape(shape, max_a, max_b-1)),\n ]" [label=""];
"# max_a, max_b\n testcases4 = [\n (max_a, max_b, calculate_area_shape(shape, max_a, max_b)),\n (max_a-1, max_b, calculate_area_shape(shape, max_a-1, max_b)),\n (max_a-1, max_b-1, calculate_area_shape(shape, max_a-1, max_b-1)),\n (max_a, max_b-1, calculate_area_shape(shape, max_a, max_b-1)),\n ]" -> "for i in [testcases1,\n testcases2,\n testcases3,\n testcases4]" [label=""];
"for i in [testcases1,\n testcases2,\n testcases3,\n testcases4]" -> "r_testcases.extend(i)" [label=""];
"r_testcases.extend(i)" -> "for i in [testcases1,\n testcases2,\n testcases3,\n testcases4]" [label=""];
"r_testcases.extend(i)" -> "return w_testcases" [label=""];
"worse_case_robustness(min_a, max_a,\nmin_b, max_b,\nshape)" -> "wr_testcases=robustness(min_a, max_a,\n min_b, max_b,\n shape)" [label=""];
"wr_testcases=robustness(min_a, max_a,\n min_b, max_b,\n shape)" -> "for i in [(min_a, min_b),\n(min_a, max_b),\n(max_a, min_b),\n(max_a, max_b)]" [label=""];
"for i in [(min_a, min_b),\n(min_a, max_b),\n(max_a, min_b),\n(max_a, max_b)]" -> "wr_testcases.extend(\n create_new_testcases(i[0], i[1], shape)\n )" [label=""];
"wr_testcases.extend(\n create_new_testcases(i[0], i[1], shape)\n )" -> "for i in [(min_a, min_b),\n(min_a, max_b),\n(max_a, min_b),\n(max_a, max_b)]" [label=""];
"wr_testcases.extend(\n create_new_testcases(i[0], i[1], shape)\n )" -> "return wr_testcases" [label=""];
"create_new_testcases(a, b, shape)" -> "testcases = [\n (a, b, calculate_area_shape(shape, a, b)),\n (a, b+1, calculate_area_shape(shape, a, b+1)),\n (a, b-1, calculate_area_shape(shape, a, b-1)),\n (a+1, b, calculate_area_shape(shape, a+1, b)),\n (a+1, b+1, calculate_area_shape(shape, a+1, b+1)),\n (a+1, b-1, calculate_area_shape(shape, a+1, b-1)),\n (a-1, b, calculate_area_shape(shape, a-1, b)),\n (a-1, b+1, calculate_area_shape(shape, a-1, b+1)),\n (a-1, b-1, calculate_area_shape(shape, a-1, b-1))\n ]" [label=""];
"testcases = [\n (a, b, calculate_area_shape(shape, a, b)),\n (a, b+1, calculate_area_shape(shape, a, b+1)),\n (a, b-1, calculate_area_shape(shape, a, b-1)),\n (a+1, b, calculate_area_shape(shape, a+1, b)),\n (a+1, b+1, calculate_area_shape(shape, a+1, b+1)),\n (a+1, b-1, calculate_area_shape(shape, a+1, b-1)),\n (a-1, b, calculate_area_shape(shape, a-1, b)),\n (a-1, b+1, calculate_area_shape(shape, a-1, b+1)),\n (a-1, b-1, calculate_area_shape(shape, a-1, b-1))\n ]" -> "return testcases # For WR cases" [label=""];
"show_testcase(testcases)" -> "texts=[]" [label=""];
"texts=[]" -> "for id, testcase in enumerate(testcases)" [label=""];
"for id, testcase in enumerate(testcases)" -> "text = Format in each Testcases\ntexts.append(text)" [label=""];
"text = Format in each Testcases\ntexts.append(text)" -> "for id, testcase in enumerate(testcases)" [label=""];
"text = Format in each Testcases\ntexts.append(text)" -> "return '\n'.join(texts)" [label=""];
}