Skip to content

Instantly share code, notes, and snippets.

@trikitrok
trikitrok / Element.java
Created February 8, 2026 22:36
Used to illustrate finding test points
public class Element {
private final String name;
private String text;
public Element(String name) {
this.name = name;
this.text = "";
}
public void addText(String newText) {
public class Invoice {
private final ShippingPricer shippingPricer;
// ...
public Invoice(
OurDate billingDate,
OurDate openingDate,
Originator originator
// ...
) {
public class Invoice {
//...
public Money getValue() {
Money total = this.itemsSum();
if (this.billingDate.after(OurDate.yearEnd(this.openingDate))) {
if (
this.originator.getState().equals("FL") ||
this.originator.getState().equals("NY")
) {
@trikitrok
trikitrok / InMemoryDirectory.java
Created February 8, 2026 22:29
Used to illustrate finding test points
public class InMemoryDirectory {
private final List<Element> elements;
public InMemoryDirectory() {
this.elements = new ArrayList<>();
}
public void addElement(Element newElement) {
this.elements.add(newElement);
}
@trikitrok
trikitrok / AlarmTest.java
Last active February 9, 2026 08:31
Alarm tests with no relevant mutants surviving
package unit_tests;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import tirepressuremonitoringsystem.Alarm;
import java.util.*;
import java.util.stream.Stream;
@trikitrok
trikitrok / ArgentRoseStore.java
Created February 1, 2026 22:25
Code after finding and fixing bugs
package com.argentrose;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;
public class ArgentRoseStore {
private final List<Product> inventory;
@trikitrok
trikitrok / ArgentRoseStore.java
Last active February 1, 2026 21:43
Production code with manual mutation that pit can't create
package com.argentrose;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;
public class ArgentRoseStore {
private final List<Product> inventory;
@trikitrok
trikitrok / ArgentRoseStoreTest.java
Last active February 2, 2026 16:45
Tests with no relevant mutants surviving but missing important test cases
package com.argentrose;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import java.util.Arrays;
import static org.assertj.core.api.Assertions.assertThat;
@trikitrok
trikitrok / ArgentRoseStoreTest.java
Last active February 2, 2026 16:44
Tests with no relevant mutants surviving
package com.argentrose;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import java.util.Arrays;
import static org.assertj.core.api.Assertions.assertThat;
@trikitrok
trikitrok / ArgentRoseStoreTest.java
Last active February 2, 2026 16:40
Tests with 100% branch coverage but some relevant mutants surviving
package com.argentrose;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import static org.assertj.core.api.Assertions.assertThat;
public class ArgentRoseStoreTest {