ProgramUtils.java

1
package net.bmahe.genetics4j.gp.utils;
2
3
import java.util.List;
4
import java.util.Objects;
5
6
import net.bmahe.genetics4j.core.chromosomes.TreeChromosome;
7
import net.bmahe.genetics4j.core.chromosomes.TreeNode;
8
import net.bmahe.genetics4j.gp.Operation;
9
10
public class ProgramUtils {
11
12
	private ProgramUtils() {
13
	}
14
15
	public static Object execute(final TreeChromosome<Operation<?>> treeChromosome, final Object[] input) {
16
		Objects.requireNonNull(treeChromosome);
17
18 1 1. execute : removed call to net/bmahe/genetics4j/core/chromosomes/TreeChromosome::getRoot → KILLED
		final TreeNode<Operation<?>> root = treeChromosome.getRoot();
19
20 2 1. execute : removed call to net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED
2. execute : replaced return value with null for net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED
		return execute(root, input);
21
	}
22
23
	public static Object execute(final TreeNode<Operation<?>> node, final Object[] input) {
24
		Objects.requireNonNull(node);
25
26 1 1. execute : removed call to net/bmahe/genetics4j/core/chromosomes/TreeNode::getData → KILLED
		final Operation operation = node.getData();
27 1 1. execute : removed call to net/bmahe/genetics4j/core/chromosomes/TreeNode::getChildren → KILLED
		final List<TreeNode<Operation<?>>> children = node.getChildren();
28
29 9 1. execute : removed conditional - replaced equality check with true → SURVIVED
2. lambda$execute$0 : removed call to net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED
3. execute : removed call to java/util/stream/Stream::map → KILLED
4. execute : removed call to java/util/stream/Stream::toArray → KILLED
5. execute : removed conditional - replaced equality check with false → KILLED
6. execute : removed call to java/util/List::stream → KILLED
7. execute : replaced call to java/util/stream/Stream::map with receiver → KILLED
8. lambda$execute$0 : replaced return value with null for net/bmahe/genetics4j/gp/utils/ProgramUtils::lambda$execute$0 → KILLED
9. execute : negated conditional → KILLED
		final Object[] parameters = children != null ? children.stream().map(child -> execute(child, input)).toArray()
30 1 1. execute : Substituted 0 with 1 → NO_COVERAGE
				: new Object[] {};
31
32 2 1. execute : replaced return value with null for net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED
2. execute : removed call to net/bmahe/genetics4j/gp/Operation::apply → KILLED
		return operation.apply(input, parameters);
33
	}
34
35
}

Mutations

18

1.1
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
removed call to net/bmahe/genetics4j/core/chromosomes/TreeChromosome::getRoot → KILLED

20

1.1
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
removed call to net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED

2.2
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
replaced return value with null for net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED

26

1.1
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
removed call to net/bmahe/genetics4j/core/chromosomes/TreeNode::getData → KILLED

27

1.1
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:complexTest()]
removed call to net/bmahe/genetics4j/core/chromosomes/TreeNode::getChildren → KILLED

29

1.1
Location : lambda$execute$0
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:complexTest()]
removed call to net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED

2.2
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
removed call to java/util/stream/Stream::map → KILLED

3.3
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:complexTest()]
removed call to java/util/stream/Stream::toArray → KILLED

4.4
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:complexTest()]
removed conditional - replaced equality check with false → KILLED

5.5
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
removed call to java/util/List::stream → KILLED

6.6
Location : execute
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

7.7
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:complexTest()]
replaced call to java/util/stream/Stream::map with receiver → KILLED

8.8
Location : lambda$execute$0
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:complexTest()]
replaced return value with null for net/bmahe/genetics4j/gp/utils/ProgramUtils::lambda$execute$0 → KILLED

9.9
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:complexTest()]
negated conditional → KILLED

30

1.1
Location : execute
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

32

1.1
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
replaced return value with null for net/bmahe/genetics4j/gp/utils/ProgramUtils::execute → KILLED

2.2
Location : execute
Killed by : net.bmahe.genetics4j.gp.utils.ProgramUtilsTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.gp.utils.ProgramUtilsTest]/[method:simpleTerminal()]
removed call to net/bmahe/genetics4j/gp/Operation::apply → KILLED

Active mutators

Tests examined


Report generated by PIT 1.25.7 support