Code covered by the BSD License  

Highlights from
Benchmark Problem 02 - Matlab Code

image thumbnail

Benchmark Problem 02 - Matlab Code

by

 

21 May 2013 (Updated )

This is the Matlab code for the model Benchmark Problem 02.

run_mutants.m
A=dir('Mutant*.m');
MUT=zeros(length(A),2);  % This stores the pass/fail or mutant failed to run status
r=1;
for tagcase = 1:6  % Run the taguchi test cases on the mutants one by one
    
    for i=1:length(A)
        if MUT(i,1) == 0  % If the mutant is killed or the mutant file cannot run then we need not use another test case
            save temp i A MUT tagcase r
            clear all
            load temp
            filesn=A(i).name;  % Firt mutant file
            try
                if ~exist(filesn)
                    i=i+1;
                else
                    eval(filesn(1:end-2));
                    if maxerr > 3e-4
                        MUT(i,1)=1;
                        MUT(i,2)=maxerr;
                        disp(['Max error in test ' filesn ' is ' num2str(maxerr)]);
                    end
                end
                save temp r
            catch ME
                MUT(i,1)=2;
                MUT(i,2)=0;
            end
        end
    end
    % save MUT_Tag6_6 MUT
    save MUT_final MUT
end

Contact us