Skip to content

Add mutation testing #1

Add mutation testing

Add mutation testing #1

Triggered via pull request June 27, 2023 08:28
Status Success
Total duration 2m 24s
Artifacts

mt.yml

on: pull_request
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L90
Escaped Mutant for Mutator "RoundingFamily": --- Original +++ New @@ @@ $this->mean = $mean; $this->latest = $latest; $this->sensitivity = $sensitivity; - $this->high = ceil($this->mean + $sensitivity * $this->std_dev); + $this->high = round($this->mean + $sensitivity * $this->std_dev); $this->low = floor($this->mean - $sensitivity * $this->std_dev); if ($this->latest >= $this->low && $this->latest <= $this->high) { return;
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L91
Escaped Mutant for Mutator "RoundingFamily": --- Original +++ New @@ @@ $this->latest = $latest; $this->sensitivity = $sensitivity; $this->high = ceil($this->mean + $sensitivity * $this->std_dev); - $this->low = floor($this->mean - $sensitivity * $this->std_dev); + $this->low = round($this->mean - $sensitivity * $this->std_dev); if ($this->latest >= $this->low && $this->latest <= $this->high) { return; }
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L93
Escaped Mutant for Mutator "GreaterThanOrEqualTo": --- Original +++ New @@ @@ $this->sensitivity = $sensitivity; $this->high = ceil($this->mean + $sensitivity * $this->std_dev); $this->low = floor($this->mean - $sensitivity * $this->std_dev); - if ($this->latest >= $this->low && $this->latest <= $this->high) { + if ($this->latest > $this->low && $this->latest <= $this->high) { return; } if ($this->std_dev > 0.0) {
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L97
Escaped Mutant for Mutator "GreaterThan": --- Original +++ New @@ @@ if ($this->latest >= $this->low && $this->latest <= $this->high) { return; } - if ($this->std_dev > 0.0) { + if ($this->std_dev >= 0.0) { $this->hops = abs($this->mean - $this->latest) / $this->std_dev; } if ($this->latest < $this->low) {
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L98
Escaped Mutant for Mutator "Division": --- Original +++ New @@ @@ return; } if ($this->std_dev > 0.0) { - $this->hops = abs($this->mean - $this->latest) / $this->std_dev; + $this->hops = abs($this->mean - $this->latest) * $this->std_dev; } if ($this->latest < $this->low) { $this->direction = self::DIRECTION_DOWN;
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L101
Escaped Mutant for Mutator "LessThan": --- Original +++ New @@ @@ if ($this->std_dev > 0.0) { $this->hops = abs($this->mean - $this->latest) / $this->std_dev; } - if ($this->latest < $this->low) { + if ($this->latest <= $this->low) { $this->direction = self::DIRECTION_DOWN; } elseif ($this->latest > $this->high) { $this->direction = self::DIRECTION_UP;
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L103
Escaped Mutant for Mutator "GreaterThan": --- Original +++ New @@ @@ } if ($this->latest < $this->low) { $this->direction = self::DIRECTION_DOWN; - } elseif ($this->latest > $this->high) { + } elseif ($this->latest >= $this->high) { $this->direction = self::DIRECTION_UP; } }
Mutatation testing with PHP 8.2: src/AnomalyDetectionResult.php#L121
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ * * @param int $precision the number of decimal digits to round to */ - public function toArray(int $precision = 2) : array + public function toArray(int $precision = 1) : array { return array_map(fn($val) => is_float($val) ? round($val, $precision) : $val, get_object_vars($this)); }
Mutatation testing with PHP 8.2: src/Helper/FrameBuilder.php#L61
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ * * @param int $time the frame's reference time */ - public function newFrame(int $time) : Frame + protected function newFrame(int $time) : Frame { return new Frame($time, $this->window_size); }
Mutatation testing with PHP 8.2: src/Helper/FrameBuilder.php#L76
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ * * @throws InvalidArgumentException If the start time is in the future */ - public function generateFrames(int $start_time = 0, ?int $end_time = null) : iterable + public function generateFrames(int $start_time = -1, ?int $end_time = null) : iterable { if (null !== $end_time && $end_time < $start_time) { throw new InvalidArgumentException("End time cannot be before start time (start: {$start_time}, end: {$end_time})");