From 8fcd6bb5a66c4fdf27eb51dfdaaff0a8a1def12d Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Sat, 9 Dec 2023 14:38:48 +0100 Subject: [PATCH] done up to 07. Verify that current fuzzying procedure is fine according to guidelines --- fuzzer.py | 72 +---- genetic.py | 88 ++++-- instrument.py | 2 +- tests/anagram_check_instrumented.py | 308 -------------------- tests/cd_count_instrumented.py | 305 ------------------- tests/check_armstrong_instrumented.py | 305 ------------------- tests/decrypt_instrumented.py | 305 ------------------- tests/encrypt_instrumented.py | 305 ------------------- tests/exponentiation_instrumented.py | 305 ------------------- tests/gcd_instrumented.py | 305 ------------------- tests/longest_sorted_substr_instrumented.py | 305 ------------------- tests/rabin_karp_search_instrumented.py | 305 ------------------- tests/raildecrypt_instrumented.py | 305 ------------------- tests/railencrypt_instrumented.py | 14 - tests/zeller_instrumented.py | 305 ------------------- 15 files changed, 73 insertions(+), 3461 deletions(-) delete mode 100644 tests/anagram_check_instrumented.py delete mode 100644 tests/cd_count_instrumented.py delete mode 100644 tests/check_armstrong_instrumented.py delete mode 100644 tests/decrypt_instrumented.py delete mode 100644 tests/encrypt_instrumented.py delete mode 100644 tests/exponentiation_instrumented.py delete mode 100644 tests/gcd_instrumented.py delete mode 100644 tests/longest_sorted_substr_instrumented.py delete mode 100644 tests/rabin_karp_search_instrumented.py delete mode 100644 tests/raildecrypt_instrumented.py delete mode 100644 tests/railencrypt_instrumented.py delete mode 100644 tests/zeller_instrumented.py diff --git a/fuzzer.py b/fuzzer.py index e8c726a..6991bee 100644 --- a/fuzzer.py +++ b/fuzzer.py @@ -1,11 +1,9 @@ import os -from random import randrange, choice, random -from typing import Callable +from random import randrange, choice, random, sample -import tqdm from frozendict import frozendict -from instrument import load_benchmark, Arg, Params, functions, invoke, call_statement, BranchTransformer, module_of +from instrument import Arg, Params, invoke, call_statement, BranchTransformer, module_of Range = tuple[int, int] @@ -133,51 +131,17 @@ def crossover(chosen_test: Params, other_chosen_test: Params, arguments: list[Ar return t1, t2 -def get_test_cases(f_name: str, arguments: list[Arg], n: int, enable_bar=True) -> set[Params]: - assert n >= 1 - +def generate_test_case(f_name: str, arguments: list[Arg]) -> Params: pool: set[Params] = get_pool(arguments) - pool_list = list(pool) - tests: set[Params] = set() - n = min(n, max_cases(arguments) // 3) # bound n by 1/3rd of the max possible number of tests + while True: + test = sample(pool, 1)[0] - with tqdm.tqdm(total=n, desc=f"Tests for {BranchTransformer.to_original_name(f_name)}", - disable=not enable_bar) as pbar: - def consider_test_case(t: Params): - if t not in pool: - pool.add(t) - pool_list.append(t) - - try: - invoke(f_name, t) # check if this input satisfies the input assertion - except AssertionError: - return - - if t not in tests: - tests.add(t) - pbar.update() - - while len(tests) < n: - chosen_test: Params = choice(pool_list) - kind = choice(['pool', 'mutation', 'crossover']) - - if kind == 'mutation': - consider_test_case(mutate(chosen_test, arguments)) - elif kind == 'crossover': - # pick other distinct sample - while True: - other_chosen_test: Params = choice(pool_list) - if frozendict(chosen_test) != frozendict(other_chosen_test): - break - - t1, t2 = crossover(chosen_test, other_chosen_test, arguments) - consider_test_case(t1) - consider_test_case(t2) - else: - consider_test_case(chosen_test) - - return tests + try: + invoke(f_name, test) + return test # return only test cases that satisfy assertions + except AssertionError: + pass def str_crossover(parent1: str, parent2: str): @@ -209,19 +173,3 @@ def get_test_class(f_name: str, cases: set[Params]) -> str: f"class Test_{f_name_orig}(TestCase):\n") test_class += "\n\n".join([get_test_case_source(f_name, case, i + 1, 1) for i, case in enumerate(cases)]) return test_class - - -def main(): - load_benchmark(save_instrumented=False) # instrument all files in benchmark - - if not os.path.isdir(OUT_DIR): - os.makedirs(OUT_DIR) - - for f_name in functions.keys(): - with open(os.path.join(OUT_DIR, f_name + ".py"), "w") as f: - cases = get_test_cases(f_name, functions[f_name], 100) - f.write(get_test_class(f_name, cases)) - - -if __name__ == '__main__': - main() diff --git a/genetic.py b/genetic.py index 8977494..8cd2a97 100644 --- a/genetic.py +++ b/genetic.py @@ -1,20 +1,22 @@ import os -from typing import Callable +import random +import sys import frozendict +import tqdm from deap import creator, base, tools, algorithms import fuzzer import instrument -from fuzzer import get_test_cases, get_test_class +from fuzzer import generate_test_case, get_test_class INDMUPROB = 0.05 -MUPROB = 0.1 -CXPROB = 0.5 +MUPROB = 0.33 +CXPROB = 0.33 TOURNSIZE = 3 -NPOP = 300 +NPOP = 1000 NGEN = 200 -REPS = 1 +REPS = 10 to_test: str = "" @@ -25,21 +27,27 @@ def normalize(x): return x / (1.0 + x) -def get_test_case_generator(f_name: str, arguments: list[instrument.Arg]) -> Callable[[], list]: - return lambda: list(list(get_test_cases(f_name, arguments, 1, enable_bar=False))[0].items()) +def init_deap(): + creator.create("Fitness", base.Fitness, weights=(-1.0,)) + creator.create("Individual", list, fitness=creator.Fitness) + + +def taken_branches_descriptor() -> str: + branch_ids = sorted([f"{branch:2d}T" for branch in instrument.archive_true_branches.keys()] + + [f"{branch:2d}F" for branch in instrument.archive_false_branches.keys()]) + return ' '.join([branch.strip() for branch in branch_ids]) def generate(f_name: str): global to_test to_test = f_name - creator.create("Fitness", base.Fitness, weights=(-1.0,)) - creator.create("Individual", list, fitness=creator.Fitness) + orig_name = instrument.BranchTransformer.to_original_name(f_name) args = instrument.functions[f_name] toolbox = base.Toolbox() - toolbox.register("attr_test_case", get_test_case_generator(to_test, instrument.functions[to_test])) + toolbox.register("attr_test_case", lambda: list(generate_test_case(f_name, args).items())) toolbox.register("individual", tools.initIterate, creator.Individual, lambda: toolbox.attr_test_case()) toolbox.register("population", tools.initRepeat, list, toolbox.individual) toolbox.register("evaluate", compute_fitness) @@ -60,19 +68,38 @@ def generate(f_name: str): toolbox.register("mutate", mutate) toolbox.register("select", tools.selTournament, tournsize=TOURNSIZE) + top_result = set() + top_coverage = 0 + + range_start, range_end = instrument.n_of_branches[to_test] + total_branches = (range_end - range_start) * 2 # *2 because of True and False + coverage = [] for i in range(REPS): instrument.archive_true_branches = {} instrument.archive_false_branches = {} population = toolbox.population(n=NPOP) - algorithms.eaSimple(population, toolbox, CXPROB, MUPROB, NGEN) # , verbose=False) - cov = len(instrument.archive_true_branches) + len(instrument.archive_false_branches) - print(cov, instrument.archive_true_branches, instrument.archive_false_branches) + + algorithms.eaSimple(population, toolbox, CXPROB, MUPROB, NGEN, verbose=False) + + true_covered = len(instrument.archive_true_branches.keys()) + false_covered = len(instrument.archive_false_branches.keys()) + tot_covered = true_covered + false_covered + + cov: float = (tot_covered / total_branches) * 100 coverage.append(cov) + branches = taken_branches_descriptor() + print(f"{orig_name}: rep #{i:02d}: Cov: {cov:02.02f}% ({tot_covered}/{total_branches} branches): {branches}") + + if cov > top_coverage: + top_result = set(list(instrument.archive_true_branches.values()) + + list(instrument.archive_false_branches.values())) + top_coverage = cov + print(coverage) - return set(list(instrument.archive_true_branches.values()) + - list(instrument.archive_false_branches.values())) + + return top_result def compute_fitness(individual: list) -> tuple[float]: @@ -92,7 +119,7 @@ def compute_fitness(individual: list) -> tuple[float]: try: out = instrument.invoke(to_test, x) except AssertionError: - print(to_test, x, "=", "[FAILS] fitness = 100.0") + # print(to_test, x, "=", "[FAILS] fitness = 100.0") return 100.0, fitness = 0.0 @@ -104,24 +131,33 @@ def compute_fitness(individual: list) -> tuple[float]: instrument.archive_true_branches[branch] = x if branch not in instrument.archive_true_branches: fitness += normalize(instrument.distances_true[branch]) - elif branch in instrument.distances_false: + + for branch in range(range_start, range_end): + if branch in instrument.distances_false: if instrument.distances_false[branch] == 0 and branch not in instrument.archive_false_branches: instrument.archive_false_branches[branch] = x if branch not in instrument.archive_false_branches: fitness += normalize(instrument.distances_false[branch]) - else: - fitness += 1.0 - print(to_test, x, "=", out, "fitness =", fitness) + # print(to_test, x, "=", out, "fitness =", fitness) return fitness, -def main(): - instrument.load_benchmark(save_instrumented=False) # instrument all files in benchmark - f_name = "railencrypt_instrumented" - cases = generate(f_name) +def build_suite(f_name: str): + instr_name = instrument.BranchTransformer.to_instrumented_name(f_name) + cases = generate(instr_name) with open(os.path.join(OUT_DIR, f_name + ".py"), "w") as f: - f.write(get_test_class(f_name, cases)) + f.write(get_test_class(instr_name, cases)) + + +def main(): + random.seed(0) # init random seed + instrument.load_benchmark(save_instrumented=False) # instrument all files in benchmark + init_deap() + + for instr_f in tqdm.tqdm(sorted(instrument.functions.keys()), desc="Generating tests"): + print("", file=sys.stderr) + build_suite(instrument.BranchTransformer.to_original_name(instr_f)) if __name__ == '__main__': diff --git a/instrument.py b/instrument.py index 8dcff3b..3dd4193 100644 --- a/instrument.py +++ b/instrument.py @@ -64,7 +64,7 @@ class BranchTransformer(ast.NodeTransformer): b_start = self.branch_num ast_node.name = BranchTransformer.to_instrumented_name(ast_node.name) inner_node = self.generic_visit(ast_node) - self.branches_range[ast_node.name] = (b_start, self.branch_num) + self.branches_range[ast_node.name] = (b_start + 1, self.branch_num + 1) self.instrumented_name = None return inner_node diff --git a/tests/anagram_check_instrumented.py b/tests/anagram_check_instrumented.py deleted file mode 100644 index 670ef65..0000000 --- a/tests/anagram_check_instrumented.py +++ /dev/null @@ -1,308 +0,0 @@ -from unittest import TestCase - -from benchmark.anagram_check import anagram_check - - -class Test_anagram_check(TestCase): - def test_anagram_check_1(self): - assert anagram_check(s1='', s2='3Q%H8e') == False - - def test_anagram_check_2(self): - assert anagram_check(s1='V>tI-vq', s2='2UFU.J@W1') == False - - def test_anagram_check_3(self): - assert anagram_check(s1='F'', s2='W>5') == False - - def test_anagram_check_4(self): - assert anagram_check(s1='(E7/~', s2='k\*'k+w|W') == False - - def test_anagram_check_5(self): - assert anagram_check(s1='{.HDvB;K', s2='U]') == False - - def test_anagram_check_6(self): - assert anagram_check(s1='o', s2=';_~E,') == False - - def test_anagram_check_7(self): - assert anagram_check(s1='P2Q', s2='') == False - - def test_anagram_check_8(self): - assert anagram_check(s1='"G', s2=',+IY/') == False - - def test_anagram_check_9(self): - assert anagram_check(s1='CD[,W^"{M', s2='DYpw') == False - - def test_anagram_check_10(self): - assert anagram_check(s1='1', s2='GKGn') == False - - def test_anagram_check_11(self): - assert anagram_check(s1='8B=zA9TN,', s2='~') == False - - def test_anagram_check_12(self): - assert anagram_check(s1='p,', s2='') == False - - def test_anagram_check_13(self): - assert anagram_check(s1='DU?Y', s2='r') == False - - def test_anagram_check_14(self): - assert anagram_check(s1='f', s2='p{C-`Pq6T') == False - - def test_anagram_check_15(self): - assert anagram_check(s1='{M?/I', s2='#HxX') == False - - def test_anagram_check_16(self): - assert anagram_check(s1='*w', s2='LO-SW') == False - - def test_anagram_check_17(self): - assert anagram_check(s1=''', s2='@y') == False - - def test_anagram_check_18(self): - assert anagram_check(s1='', s2='}Q') == False - - def test_anagram_check_19(self): - assert anagram_check(s1='Aen"W!y', s2='7,T ') == False - - def test_anagram_check_20(self): - assert anagram_check(s1='+pv', s2='"lR') == False - - def test_anagram_check_21(self): - assert anagram_check(s1='|e#z|', s2='C'spOA,U') == False - - def test_anagram_check_22(self): - assert anagram_check(s1='+ov', s2='"lR') == False - - def test_anagram_check_23(self): - assert anagram_check(s1='j(c@76t', s2='((') == False - - def test_anagram_check_24(self): - assert anagram_check(s1='kjCu #-FR', s2='u') == False - - def test_anagram_check_25(self): - assert anagram_check(s1='{5', s2='7m;') == False - - def test_anagram_check_26(self): - assert anagram_check(s1='|d+.OH', s2='P') == False - - def test_anagram_check_27(self): - assert anagram_check(s1='%|K2&&*', s2='M; X') == False - - def test_anagram_check_28(self): - assert anagram_check(s1='', s2='kF7J6Q\=G') == False - - def test_anagram_check_29(self): - assert anagram_check(s1='I:2y_pj"', s2='_'G') == False - - def test_anagram_check_30(self): - assert anagram_check(s1='Z)R"Qb8', s2=']T.\3(x') == False - - def test_anagram_check_31(self): - assert anagram_check(s1='^y1gH)jvp', s2='(Y1vpvfv') == False - - def test_anagram_check_32(self): - assert anagram_check(s1='W', s2='1e7') == False - - def test_anagram_check_33(self): - assert anagram_check(s1='Nj(}%', s2='m{|c8=a') == False - - def test_anagram_check_34(self): - assert anagram_check(s1='B/mqTkzy]', s2='_'TX\U') == False - - def test_anagram_check_73(self): - assert anagram_check(s1=' z{'wm04', s2='GDQQe'kK') == False - - def test_anagram_check_74(self): - assert anagram_check(s1='BnET', s2='xYmH}Dm') == False - - def test_anagram_check_75(self): - assert anagram_check(s1='Z)R"Qb8', s2=']{C,E') == False - - def test_anagram_check_76(self): - assert anagram_check(s1='Rn1]', s2=']') == False - - def test_anagram_check_77(self): - assert anagram_check(s1='FN', s2='qQ7h'.n') == False - - def test_anagram_check_78(self): - assert anagram_check(s1='', s2='7') == False - - def test_anagram_check_79(self): - assert anagram_check(s1=''Cc';sX', s2='PA%') == False - - def test_anagram_check_80(self): - assert anagram_check(s1='Q#9KVEZ', s2='-/^S0;]/') == False - - def test_anagram_check_81(self): - assert anagram_check(s1='', s2=',') == False - - def test_anagram_check_82(self): - assert anagram_check(s1='#7(,v{\{J', s2='6S$~h?') == False - - def test_anagram_check_83(self): - assert anagram_check(s1='_D,x4b', s2='ALY') == False - - def test_anagram_check_84(self): - assert anagram_check(s1='_8^4amA', s2=']f4') == False - - def test_anagram_check_85(self): - assert anagram_check(s1='tC@H{=G', s2='u1;)') == False - - def test_anagram_check_86(self): - assert anagram_check(s1='j#', s2='q)7(') == False - - def test_anagram_check_87(self): - assert anagram_check(s1='zy!ob:llU', s2='Pjf') == False - - def test_anagram_check_88(self): - assert anagram_check(s1='L]c1clT?', s2='') == False - - def test_anagram_check_89(self): - assert anagram_check(s1='Mg:sk(*', s2=';') == False - - def test_anagram_check_90(self): - assert anagram_check(s1='rME', s2='^m') == False - - def test_anagram_check_91(self): - assert anagram_check(s1='0e:JCRNB', s2='mh:?3rb') == False - - def test_anagram_check_92(self): - assert anagram_check(s1='~.njBt/Pr', s2='%w5PP/@oY') == False - - def test_anagram_check_93(self): - assert anagram_check(s1=' z;(6@09', s2='.=') == False - - def test_anagram_check_94(self): - assert anagram_check(s1='', s2='}*%C^hI') == False - - def test_anagram_check_95(self): - assert anagram_check(s1='+_prg', s2='atD' - - def test_longest_sorted_substr_15(self): - assert longest_sorted_substr(s='s') == 's' - - def test_longest_sorted_substr_16(self): - assert longest_sorted_substr(s='{EX_?r*M$') == 'EX_' - - def test_longest_sorted_substr_17(self): - assert longest_sorted_substr(s='2@U+0&') == '2@U' - - def test_longest_sorted_substr_18(self): - assert longest_sorted_substr(s='Ze') == 'Ze' - - def test_longest_sorted_substr_19(self): - assert longest_sorted_substr(s='{-7R<])') == '-7R' - - def test_longest_sorted_substr_20(self): - assert longest_sorted_substr(s='Mh|') == 'Mh|' - - def test_longest_sorted_substr_21(self): - assert longest_sorted_substr(s='ZOk_Zq') == 'Ok' - - def test_longest_sorted_substr_22(self): - assert longest_sorted_substr(s='jpb') == 'jp' - - def test_longest_sorted_substr_23(self): - assert longest_sorted_substr(s='$') == '$' - - def test_longest_sorted_substr_24(self): - assert longest_sorted_substr(s='2v7Z') == '2v' - - def test_longest_sorted_substr_25(self): - assert longest_sorted_substr(s='3NyuK') == '3Ny' - - def test_longest_sorted_substr_26(self): - assert longest_sorted_substr(s='Aj3~Y') == 'Aj' - - def test_longest_sorted_substr_27(self): - assert longest_sorted_substr(s='lgoz}B4A~') == 'goz}' - - def test_longest_sorted_substr_28(self): - assert longest_sorted_substr(s='~Dhq', k=883) == '\'H?>Dhq' - - def test_raildecrypt_79(self): - assert raildecrypt(st='E', k=557) == 'E' - - def test_raildecrypt_80(self): - assert raildecrypt(st='|bD', k=651) == '|bD' - - def test_raildecrypt_81(self): - assert raildecrypt(st='?bb(.`', k=502) == '?bb(.`' - - def test_raildecrypt_82(self): - assert raildecrypt(st='{,rXk!3W', k=885) == '{,rXk!3W' - - def test_raildecrypt_83(self): - assert raildecrypt(st=' WS`#ov ~', k=189) == ' WS`#ov ~' - - def test_raildecrypt_84(self): - assert raildecrypt(st='-O HB', k=208) == '-O HB' - - def test_raildecrypt_85(self): - assert raildecrypt(st='[', k=714) == '[' - - def test_raildecrypt_86(self): - assert raildecrypt(st='Ckmi|', k=14) == 'Ckmi|' - - def test_raildecrypt_87(self): - assert raildecrypt(st='mHbwuB', k=931) == 'mHbwuB' - - def test_raildecrypt_88(self): - assert raildecrypt(st='_?->'}#', k=388) == '_?->'}#' - - def test_raildecrypt_89(self): - assert raildecrypt(st='', k=454) == '' - - def test_raildecrypt_90(self): - assert raildecrypt(st='&,+f9p}y>', k=990) == '&,+f9p}y>' - - def test_raildecrypt_91(self): - assert raildecrypt(st='JCXpF', k=726) == 'JCXpF' - - def test_raildecrypt_92(self): - assert raildecrypt(st='B', k=350) == 'B' - - def test_raildecrypt_93(self): - assert raildecrypt(st='g_=f.B1U', k=960) == 'g_=f.B1U' - - def test_raildecrypt_94(self): - assert raildecrypt(st='Zb', k=614) == 'Zb' - - def test_raildecrypt_95(self): - assert raildecrypt(st='Y/', k=867) == 'Y/' - - def test_raildecrypt_96(self): - assert raildecrypt(st=''CXpF', k=437) == ''CXpF' - - def test_raildecrypt_97(self): - assert raildecrypt(st='X:F', k=695) == 'X:F' - - def test_raildecrypt_98(self): - assert raildecrypt(st='HR9.T\F#', k=662) == 'HR9.T\F#' - - def test_raildecrypt_99(self): - assert raildecrypt(st='', k=362) == '' - - def test_raildecrypt_100(self): - assert raildecrypt(st='', k=360) == '' \ No newline at end of file diff --git a/tests/railencrypt_instrumented.py b/tests/railencrypt_instrumented.py deleted file mode 100644 index dc1bdd1..0000000 --- a/tests/railencrypt_instrumented.py +++ /dev/null @@ -1,14 +0,0 @@ -from unittest import TestCase - -from benchmark.railfence_cipher import railencrypt - - -class Test_railencrypt(TestCase): - def test_railencrypt_1(self): - assert railencrypt(st='6u#%', k=3) == '6u%#' - - def test_railencrypt_2(self): - assert railencrypt(st='6uD*z(', k=3) == '6zu*(D' - - def test_railencrypt_3(self): - assert railencrypt(st='(', k=307) == '(' \ No newline at end of file diff --git a/tests/zeller_instrumented.py b/tests/zeller_instrumented.py deleted file mode 100644 index 3c1bfbd..0000000 --- a/tests/zeller_instrumented.py +++ /dev/null @@ -1,305 +0,0 @@ -from unittest import TestCase - -from benchmark.zellers_birthday import zeller - - -class Test_zeller(TestCase): - def test_zeller_1(self): - assert zeller(d=-145, m=296, y=-46) == 'Sunday' - - def test_zeller_2(self): - assert zeller(d=521, m=722, y=29) == 'Tuesday' - - def test_zeller_3(self): - assert zeller(d=247, m=270, y=48) == 'Saturday' - - def test_zeller_4(self): - assert zeller(d=-300, m=-543, y=-34) == 'Sunday' - - def test_zeller_5(self): - assert zeller(d=-788, m=722, y=71) == 'Sunday' - - def test_zeller_6(self): - assert zeller(d=355, m=8, y=-34) == 'Wednesday' - - def test_zeller_7(self): - assert zeller(d=-830, m=-538, y=71) == 'Thursday' - - def test_zeller_8(self): - assert zeller(d=368, m=726, y=-99) == 'Wednesday' - - def test_zeller_9(self): - assert zeller(d=758, m=-547, y=80) == 'Friday' - - def test_zeller_10(self): - assert zeller(d=165, m=435, y=32) == 'Monday' - - def test_zeller_11(self): - assert zeller(d=-850, m=22, y=-41) == 'Friday' - - def test_zeller_12(self): - assert zeller(d=769, m=964, y=17) == 'Friday' - - def test_zeller_13(self): - assert zeller(d=-850, m=855, y=-41) == 'Monday' - - def test_zeller_14(self): - assert zeller(d=591, m=350, y=-13) == 'Sunday' - - def test_zeller_15(self): - assert zeller(d=696, m=-967, y=-91) == 'Thursday' - - def test_zeller_16(self): - assert zeller(d=-161, m=-656, y=-67) == 'Thursday' - - def test_zeller_17(self): - assert zeller(d=-160, m=850, y=53) == 'Friday' - - def test_zeller_18(self): - assert zeller(d=-366, m=306, y=48) == 'Monday' - - def test_zeller_19(self): - assert zeller(d=226, m=-15, y=32) == 'Sunday' - - def test_zeller_20(self): - assert zeller(d=-850, m=19, y=-41) == 'Thursday' - - def test_zeller_21(self): - assert zeller(d=-671, m=-984, y=-76) == 'Wednesday' - - def test_zeller_22(self): - assert zeller(d=423, m=-719, y=94) == 'Wednesday' - - def test_zeller_23(self): - assert zeller(d=255, m=-385, y=-2) == 'Friday' - - def test_zeller_24(self): - assert zeller(d=-769, m=-410, y=46) == 'Tuesday' - - def test_zeller_25(self): - assert zeller(d=-645, m=-746, y=37) == 'Friday' - - def test_zeller_26(self): - assert zeller(d=413, m=720, y=-43) == 'Monday' - - def test_zeller_27(self): - assert zeller(d=-583, m=971, y=-66) == 'Monday' - - def test_zeller_28(self): - assert zeller(d=-331, m=-808, y=51) == 'Tuesday' - - def test_zeller_29(self): - assert zeller(d=86, m=249, y=11) == 'Tuesday' - - def test_zeller_30(self): - assert zeller(d=425, m=484, y=-43) == 'Sunday' - - def test_zeller_31(self): - assert zeller(d=-161, m=-523, y=-67) == 'Monday' - - def test_zeller_32(self): - assert zeller(d=953, m=-629, y=29) == 'Monday' - - def test_zeller_33(self): - assert zeller(d=616, m=-410, y=37) == 'Sunday' - - def test_zeller_34(self): - assert zeller(d=422, m=758, y=48) == 'Saturday' - - def test_zeller_35(self): - assert zeller(d=-310, m=-713, y=-48) == 'Tuesday' - - def test_zeller_36(self): - assert zeller(d=611, m=-17, y=-50) == 'Friday' - - def test_zeller_37(self): - assert zeller(d=-957, m=-238, y=40) == 'Thursday' - - def test_zeller_38(self): - assert zeller(d=122, m=-716, y=-76) == 'Thursday' - - def test_zeller_39(self): - assert zeller(d=-8, m=541, y=-76) == 'Sunday' - - def test_zeller_40(self): - assert zeller(d=-435, m=895, y=71) == 'Monday' - - def test_zeller_41(self): - assert zeller(d=407, m=-333, y=15) == 'Monday' - - def test_zeller_42(self): - assert zeller(d=86, m=67, y=11) == 'Thursday' - - def test_zeller_43(self): - assert zeller(d=-677, m=658, y=-63) == 'Wednesday' - - def test_zeller_44(self): - assert zeller(d=-773, m=7, y=-95) == 'Sunday' - - def test_zeller_45(self): - assert zeller(d=616, m=580, y=37) == 'Friday' - - def test_zeller_46(self): - assert zeller(d=122, m=541, y=97) == 'Sunday' - - def test_zeller_47(self): - assert zeller(d=326, m=229, y=60) == 'Wednesday' - - def test_zeller_48(self): - assert zeller(d=107, m=484, y=-43) == 'Saturday' - - def test_zeller_49(self): - assert zeller(d=-8, m=-951, y=-76) == 'Thursday' - - def test_zeller_50(self): - assert zeller(d=-817, m=-423, y=15) == 'Sunday' - - def test_zeller_51(self): - assert zeller(d=9, m=-433, y=-43) == 'Tuesday' - - def test_zeller_52(self): - assert zeller(d=-932, m=-543, y=-34) == 'Tuesday' - - def test_zeller_53(self): - assert zeller(d=-247, m=-255, y=28) == 'Tuesday' - - def test_zeller_54(self): - assert zeller(d=-415, m=-393, y=15) == 'Tuesday' - - def test_zeller_55(self): - assert zeller(d=-830, m=-415, y=71) == 'Wednesday' - - def test_zeller_56(self): - assert zeller(d=-823, m=-616, y=-46) == 'Saturday' - - def test_zeller_57(self): - assert zeller(d=107, m=-656, y=-43) == 'Wednesday' - - def test_zeller_58(self): - assert zeller(d=111, m=365, y=37) == 'Saturday' - - def test_zeller_59(self): - assert zeller(d=278, m=379, y=24) == 'Sunday' - - def test_zeller_60(self): - assert zeller(d=247, m=2, y=48) == 'Tuesday' - - def test_zeller_61(self): - assert zeller(d=805, m=-464, y=80) == 'Wednesday' - - def test_zeller_62(self): - assert zeller(d=291, m=-215, y=47) == 'Saturday' - - def test_zeller_63(self): - assert zeller(d=-69, m=-772, y=-2) == 'Wednesday' - - def test_zeller_64(self): - assert zeller(d=756, m=-533, y=7) == 'Wednesday' - - def test_zeller_65(self): - assert zeller(d=-69, m=522, y=-34) == 'Sunday' - - def test_zeller_66(self): - assert zeller(d=-788, m=37, y=71) == 'Sunday' - - def test_zeller_67(self): - assert zeller(d=413, m=-523, y=-43) == 'Wednesday' - - def test_zeller_68(self): - assert zeller(d=-197, m=-896, y=48) == 'Sunday' - - def test_zeller_69(self): - assert zeller(d=122, m=497, y=-76) == 'Wednesday' - - def test_zeller_70(self): - assert zeller(d=-230, m=-366, y=-11) == 'Thursday' - - def test_zeller_71(self): - assert zeller(d=-334, m=-945, y=81) == 'Sunday' - - def test_zeller_72(self): - assert zeller(d=-541, m=-333, y=87) == 'Thursday' - - def test_zeller_73(self): - assert zeller(d=-876, m=60, y=-99) == 'Saturday' - - def test_zeller_74(self): - assert zeller(d=-693, m=-503, y=85) == 'Thursday' - - def test_zeller_75(self): - assert zeller(d=-230, m=717, y=-11) == 'Friday' - - def test_zeller_76(self): - assert zeller(d=-401, m=-732, y=64) == 'Thursday' - - def test_zeller_77(self): - assert zeller(d=413, m=-656, y=-43) == 'Saturday' - - def test_zeller_78(self): - assert zeller(d=659, m=-98, y=83) == 'Wednesday' - - def test_zeller_79(self): - assert zeller(d=341, m=871, y=83) == 'Monday' - - def test_zeller_80(self): - assert zeller(d=-154, m=-333, y=15) == 'Saturday' - - def test_zeller_81(self): - assert zeller(d=-635, m=885, y=-87) == 'Friday' - - def test_zeller_82(self): - assert zeller(d=516, m=-897, y=67) == 'Saturday' - - def test_zeller_83(self): - assert zeller(d=336, m=281, y=-11) == 'Monday' - - def test_zeller_84(self): - assert zeller(d=-160, m=-348, y=53) == 'Tuesday' - - def test_zeller_85(self): - assert zeller(d=56, m=-656, y=-43) == 'Sunday' - - def test_zeller_86(self): - assert zeller(d=-645, m=365, y=37) == 'Saturday' - - def test_zeller_87(self): - assert zeller(d=-621, m=-905, y=56) == 'Saturday' - - def test_zeller_88(self): - assert zeller(d=-893, m=-785, y=-13) == 'Wednesday' - - def test_zeller_89(self): - assert zeller(d=138, m=964, y=17) == 'Monday' - - def test_zeller_90(self): - assert zeller(d=-674, m=-1, y=24) == 'Thursday' - - def test_zeller_91(self): - assert zeller(d=411, m=-351, y=-66) == 'Saturday' - - def test_zeller_92(self): - assert zeller(d=669, m=-1, y=1) == 'Friday' - - def test_zeller_93(self): - assert zeller(d=962, m=-681, y=-9) == 'Friday' - - def test_zeller_94(self): - assert zeller(d=674, m=878, y=46) == 'Sunday' - - def test_zeller_95(self): - assert zeller(d=-242, m=-333, y=15) == 'Monday' - - def test_zeller_96(self): - assert zeller(d=191, m=-785, y=-13) == 'Thursday' - - def test_zeller_97(self): - assert zeller(d=122, m=-925, y=97) == 'Sunday' - - def test_zeller_98(self): - assert zeller(d=-437, m=-491, y=-11) == 'Sunday' - - def test_zeller_99(self): - assert zeller(d=-230, m=238, y=-11) == 'Monday' - - def test_zeller_100(self): - assert zeller(d=171, m=29, y=-90) == 'Sunday' \ No newline at end of file