print "-----------------------------------------------------" print "function_1: ", func_id_1 opcode = "{0:04b}".format((func_id_1 - 2)) for j in list_of_necessary_patterns: saf_test_patterns_file.write(function_dict[j][0] + function_dict[j][1] + opcode + "\n") overal_test_length += len(list_of_necessary_patterns) # final set of patterns for k in final_set_of_patterns: test_patterns_file.write(function_dict[k][0] + function_dict[k][1] + "\n") table_file.close() scanning_table_file.close() test_patterns_file.close() saf_test_patterns_file.close() stop_time = time.time() final_unused_patterns = copy.deepcopy( package.final_un_used_pattern(number_of_lines, final_set_of_patterns)) package.report_usefull_patterns_per_round(used_dic, len_of_list) print "overal test length:", overal_test_length package.print_results(final_set_of_patterns, final_unused_patterns, verbose) package.print_fault_coverage(number_of_lines, number_of_ones_in_experiments, number_of_zeros_in_experiments) print "------------------------------------------" * 3 print "program took ", str(stop_time - start_time), "seconds"
saf_test_patterns_file.write(function_dict[j][0]+function_dict[j][1]+opcode+"\n") #overal_test_length += len(list_of_necessary_patterns) print "reporting test length for functions:" for func_id_1 in range(2, len_of_list): max_lenght = 0 for item in used_dic.keys(): if int(item.split("_")[0]) == func_id_1: if len(used_dic[item])>max_lenght: max_lenght = len(used_dic[item]) overal_test_length += max_lenght print "function id: ", func_id_1-1, "\ttest length:", max_lenght stop_time = time.time() final_unused_patterns = copy.deepcopy(package.final_un_used_pattern(number_of_lines, final_set_of_patterns)) for item in sorted(final_set_of_patterns): test_patterns_file.write(str(function_dict[item][0])+""+str(function_dict[item][1])+"\n") # reports! package.report_usefull_patterns_per_round(used_dic, len_of_list) print "overal test length:", overal_test_length package.print_results(final_set_of_patterns, final_unused_patterns, verbose) package.print_fault_coverage(number_of_lines, number_of_ones_in_experiments, number_of_zeros_in_experiments) print "------------------------------------------"*3 print "program took ", str(stop_time-start_time), "seconds" # closing all files table_file.close()