Skip to content

Commit 4edf801

Browse files
pushed WIP
1 parent 98cc976 commit 4edf801

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/analysis/analysis.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def _create_size_impact_plot():
2121
x.append(int(repo['Commit Count']))
2222

2323
# Get the total number of tests for the repo
24-
total_test_count = int(repo['Test Before']) + int(repo['Test During']) + int(repo['Test After'])
24+
# we don't count test_during as we want TDD percentage, not before, during and after percentage
25+
total_test_count = int(repo['Test Before']) + int(repo['Test After'])
2526
total_test_count = 1 if total_test_count == 0 else total_test_count
2627

2728
# Append the percentage of TDD for the repo to Y
@@ -82,8 +83,8 @@ def _create_box_plot():
8283
patch.set_facecolor(color)
8384

8485
# Set title and axes labels
85-
plt.ylabel("Percentage")
86-
plt.title("How often a test is created before, after and during implementation")
86+
plt.ylabel("Percentage of tests")
87+
plt.title("Percentage of tests created before, after and during implementation")
8788

8889
# Save the plot
8990
_save_plot(plt, "TDD Usage Statistics")
@@ -131,7 +132,8 @@ def _create_pie_plot_tdd_levels():
131132

132133
for author in author_data:
133134
# Calculate the percentage of TDD of the author
134-
TDD_percent = (float(author['Test Before']) / max(1, float(author['Test Before']) + float(author['Test During']) + float(author['Test After']))) * 100
135+
# we don't count test_during as we want TDD percentage, not before, during and after percentage
136+
TDD_percent = (float(author['Test Before']) / max(1, float(author['Test Before']) + float(author['Test After']))) * 100
135137

136138
# Update the counters array based on this result
137139
if TDD_percent < 10:
@@ -225,3 +227,15 @@ def create_plots():
225227
_create_pie_plot_tdd_overall()
226228

227229
create_plots()
230+
231+
'''
232+
todo -
233+
write the adjustments/estimates code in python
234+
235+
todo -
236+
plot like the TDD cagetories pie, but for repo instead of author - modify _create_pie_plot_tdd_levels
237+
bar chart for tdd percentace per langange - ignoring during
238+
average code on line 97 is completely wrong because of the 0
239+
overall tdd percentage - pie of before and after, excluding during
240+
241+
'''

0 commit comments

Comments
 (0)