Research Article

Multiobjective Genetic Algorithm for Class Testing using OCL Class Contract Specifications: A Framework

Algorithm 2

Chromosome fitness value by test sequence order (TSOCFA) [31].
INPUT: Weight for State in Start (wSState),
Weight for State in Sequence (wInSeq)
Weight for state not in Sequence (wNotInSeq)
OUTPUT: Chromosome Fitness (CF)
(1)Initialize OF = 0
(2)for each Chromosome c in the current population do
(3)if c starts with an initial state then
(4)  OF = OF + wSState
(5)end if
(6)for each Gene in c do
(7)  if is in sequence then
(8)   OF = OF + wInSeq
(9)  else
(10)   OF = OF + wNotInSeq
(11)  end if
(12)end for
(13)Set order fitness of c equals OF
(14)end for