Class: Mutiny::Mutants::MutationSet
- Inherits:
-
Object
- Object
- Mutiny::Mutants::MutationSet
- Defined in:
- lib/mutiny/mutants/mutation_set.rb
Instance Method Summary collapse
-
#initialize(*mutations) ⇒ MutationSet
constructor
A new instance of MutationSet.
-
#mutate(subjects) ⇒ Object
TODO : would performance improve by iterating over subjects than over operators? Probably could improve (more) if metamorpher also supported composite transformers so that several mutation operators could be matched simulatenously during a single AST traversal.
Constructor Details
#initialize(*mutations) ⇒ MutationSet
Returns a new instance of MutationSet.
6 7 8 |
# File 'lib/mutiny/mutants/mutation_set.rb', line 6 def initialize(*mutations) @mutations = mutations end |
Instance Method Details
#mutate(subjects) ⇒ Object
TODO : would performance improve by iterating over subjects than over operators? Probably could improve (more) if metamorpher also supported composite transformers so that several mutation operators could be matched simulatenously during a single AST traversal
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mutiny/mutants/mutation_set.rb', line 13 def mutate(subjects) MutantSet.new.tap do |mutants| @mutations.each do |mutation| subjects.each do |subject| mutated_codes = mutation.mutate_file(subject.path) mutants.concat(create_mutants(subject, mutated_codes)) end end end end |