<jupyter_start><jupyter_text>Control Flow Testing<jupyter_code>global filename, num_generations, size_pop, prob_mut, prob_cross, tour_size, elitism, universe, sets, size_crom

filename = "a_5_10.txt"
num_generations = 100
size_pop = 10
prob_mut = 0.01
prob_cross = 0.9
tour_size = 3
elitism = 0.02

universe, sets = readFile(filename)
size_crom = len(sets)<jupyter_output><empty_output><jupyter_text>Test gera_pop<jupyter_code>def test_gera_pop(test_names, list_size_pop, list_size_cromo):
    i = 0
    
    for size_pop in list_size_pop:
        rnd.seed(500)
        
        result = gera_pop(size_pop, list_size_cromo[i])
        
        print(test_names[i])
        print(result)
        i+=1
test_names = ["P1", "P2", "P2_b", "P3", "P3_b"]
list_size_pop = [0, 1, 5, 1, 1]
list_size_cromo = [0, 0, 0, 1, 5]
test_gera_pop(test_names, list_size_pop, list_size_cromo)<jupyter_output>P1
[]
P2
[([], 0)]
P2_b
[([], 0), ([], 0), ([], 0), ([], 0), ([], 0)]
P3
[([1], 0)]
P3_b
[([1, 1, 1, 1, 0], 0)]<jupyter_text>Test muta_bin<jupyter_code>def test_muta_bin(test_names, list_indiv, list_prob_muta):
    i = 0
    
    for indiv in list_indiv:
        rnd.seed(500)
        
        result = muta_bin(indiv, list_prob_muta[i])
        
        print(test_names[i])
        print(result)
        i+=1
test_names = ["P1", "P2", "P2_b", "P3"]
list_indiv = [ [], [1], [1, 1, 1, 1, 1], [1] ]
list_prob_muta = [0.01, 0.01, 0.01, 0.9]
test_muta_bin(test_names, list_indiv, list_prob_muta)<jupyter_output>P1
[]
P2
[1]
P2_b
[1, 1, 1, 1, 1]
P3
[0]<jupyter_text>Test fitness<jupyter_code>def test_fitness(test_names, list_universe, list_sets, list_solution):
    i = 0
    
    for universe in list_universe:
        rnd.seed(500)
        
        result = fitness(universe, list_sets[i], list_solution[i])
        
        print(test_names[i])
        print(result)
        i+=1
test_names = ["P1", "P3", "P3_b", "P4", "P4_b", "P5", "P6"]
list_universe = [ [], [], [], [1], [1, 2, 3, 4, 5], [1, 2], [] ]
list_sets = [ [], [ [], [] ], [ [], [], [], [], [], [] ], [ [1] ], [ [1, 2, 3, 4, 5] ], [ [2], [1] ], [] ]
list_solution = [ [], [1, 1], [1, 1, 1, 1, 1, 1], [1], [1], [1, 0], [0] ]
test_fitness(test_names, list_universe, list_sets, list_solution)<jupyter_output>P1
0.0
P3
0.4
P3_b
1.2000000000000002
P4
0.2
P4_b
0.2
P5
1.2
P6
0.0
{'fraction_non_alphanumeric': 0.1874192158552348, 'fraction_numerical': 0.07367514002585093, 'mean_word_length': 3.53515625, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '451236', 'license': 'MIT', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1052, 'n_words': 212, 'path': 'ScriptsForTesting/White Box - Control Flow/TestCasesControlFlow.ipynb', 'repo_name': 'ealoticopve/Dynamic-Software-Testing', 'size': '2321'}