-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproof_of_concept_03_analysis.py
More file actions
66 lines (52 loc) · 2.35 KB
/
Copy pathproof_of_concept_03_analysis.py
File metadata and controls
66 lines (52 loc) · 2.35 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
import json
from collections import defaultdict, Counter
# Load the traceability map
with open('proof_of_concept/traceability_map.json') as f:
traceability_map = json.load(f)
# Data structures to group information
feature_tags = defaultdict(list)
tag_feature_count = defaultdict(Counter)
# Fill structures
for feature, source_type, tag in traceability_map:
feature_tags[feature].append(tag)
tag_feature_count[tag][feature] += 1
def print_section(title):
print("\n" + "="*len(title))
print(title)
print("="*len(title))
def print_feature_list(title, tag):
print_section(title)
for feature, count in tag_feature_count[tag].most_common():
print(f"- {feature}: {count} occurrences")
def print_composite_section(title, tags):
print_section(title)
score = Counter()
for tag in tags:
for feature, count in tag_feature_count[tag].items():
score[feature] += count
for feature, count in score.most_common():
matching_tags = ', '.join(set(feature_tags[feature]) & set(tags))
print(f"- {feature}: {count} occurrences ({matching_tags})")
# ===============================
# ANSWERS TO KEY QUESTIONS
# ===============================
# 🧪 Testing questions
print_section("🧪 TESTING QUESTIONS")
print_composite_section("Which features need more testing?", ['testing', 'fix', 'error'])
print_composite_section("Which features use too many mocks?", ['mock'])
print_composite_section("Which features might be poorly designed for testing (refactor)?", ['mock', 'refactor'])
# ✨ Feature evolution
print_section("✨ FEATURE QUESTIONS")
print_feature_list("Which features are being extended?", 'extension')
print_feature_list("Which features are being refactored?", 'refactor')
print_feature_list("Which features could be deprecated or removed?", 'obsolete')
print_composite_section("Which features show high activity (testing + model + config)?", ['testing', 'model', 'config'])
# ⚙️ CI/CD questions
print_section("⚙️ CI/CD QUESTIONS")
print_feature_list("Which features trigger configuration issues?", 'config')
print_feature_list("Which features introduce new models?", 'model')
print_feature_list("Which features often fail (fix)?", 'fix')
# Summary
print_section("✅ TOTAL")
print(f"Total features analyzed: {len(feature_tags)}")
print(f"Total entries in the traceability map: {len(traceability_map)}")