Implement the logic to get all not killed mutants per test case

Signed-off-by: 's avatarHenrique Varella Ehrenfried <hve13@inf.ufpr.br>
parent a87aaaa0
# ARGV[0] = Caminho do arquivo
all_lines = Array.new
results = Array.new
test_cases_failure = Array.new
ARGV[0] = file_analyze
ARGV[1] = source_matrix
......@@ -14,14 +15,29 @@ end
# Index 201~300 = 50%
matrix = CSV.new(source_matrix,{:col_sep => ";"}).to_a
matrix_t = matrix.transpose
matrix_no_header = matrix
matrix_no_header.shift
matrix_t = matrix_no_header.transpose
matriz_size = matrix.size
all_lines.each do |a|
sum_array = Array.new
temp_a = a.split(" ")
temp_a.each do |ta|
index = matrix[0].index(ta)
sum = matrix_t[index].map{|x| x.to_i}.reduce(&:+)
sum_array << sum
i = 1
limit = matrix_no_header.size
while i < limit do
temp_array = Array.new
matrix_t[i].each_with_index do |mt, ind|
if mt.to_i == 0
temp_array << ind
end
end
end
\ No newline at end of file
test_cases_failure[i] = temp_array
i+=1
end
mutants_not_killed = Array.new
all_lines.each do |al|
split_line = al.split(" ")
split_line.each do |sl|
mutants_not_killed << test_cases_failure[sl.split("_").last]
end
end
# TODO: Implement logic to count how many mutatans are alive using the mutants_not_killed
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment