Kill Ratio = Killed Mutants / Total Mutants CODE_BLOCK: Kill Ratio = Killed Mutants / Total Mutants CODE_BLOCK: Kill Ratio = Killed Mutants / Total Mutants COMMAND_BLOCK: def calculate_discount(price: float, customer_tier: str) -> float: """ Apply discount based on customer tier. - 'gold': 20% discount - 'silver': 10% discount
- All others: no discount Returns the final price after discount. """ if customer_tier == 'gold': return price * 0.80 elif customer_tier == 'silver': return price * 0.90 else: return price COMMAND_BLOCK: def calculate_discount(price: float, customer_tier: str) -> float: """ Apply discount based on customer tier. - 'gold': 20% discount - 'silver': 10% discount
- All others: no discount Returns the final price after discount. """ if customer_tier == 'gold': return price * 0.80 elif customer_tier == 'silver': return price * 0.90 else: return price COMMAND_BLOCK: def calculate_discount(price: float, customer_tier: str) -> float: """ Apply discount based on customer tier. - 'gold': 20% discount - 'silver': 10% discount
- All others: no discount Returns the final price after discount. """ if customer_tier == 'gold': return price * 0.80 elif customer_tier == 'silver': return price * 0.90 else: return price COMMAND_BLOCK: # MUTANT: Changed 0.80 to 0.90 (gold tier gets silver discount) def calculate_discount(price: float, customer_tier: str) -> float: if customer_tier == 'gold': return price * 0.90 # <-- mutation here elif customer_tier == 'silver': return price * 0.90 else: return price COMMAND_BLOCK: # MUTANT: Changed 0.80 to 0.90 (gold tier gets silver discount) def calculate_discount(price: float, customer_tier: str) -> float: if customer_tier == 'gold': return price * 0.90 # <-- mutation here elif customer_tier == 'silver': return price * 0.90 else: return price COMMAND_BLOCK: # MUTANT: Changed 0.80 to 0.90 (gold tier gets silver discount) def calculate_discount(price: float, customer_tier: str) -> float: if customer_tier == 'gold': return price * 0.90 # <-- mutation here elif customer_tier == 'silver': return price * 0.90 else: return price COMMAND_BLOCK: def test_gold_discount(): result = calculate_discount(100, 'gold') assert result < 100 # Too vague — just checks that some discount happened COMMAND_BLOCK: def test_gold_discount(): result = calculate_discount(100, 'gold') assert result < 100 # Too vague — just checks that some discount happened COMMAND_BLOCK: def test_gold_discount(): result = calculate_discount(100, 'gold') assert result < 100 # Too vague — just checks that some discount happened COMMAND_BLOCK: def test_gold_discount(): result = calculate_discount(100, 'gold') assert result == 80.0 # Exact expected value — catches the wrong discount COMMAND_BLOCK: def test_gold_discount(): result = calculate_discount(100, 'gold') assert result == 80.0 # Exact expected value — catches the wrong discount COMMAND_BLOCK: def test_gold_discount(): result = calculate_discount(100, 'gold') assert result == 80.0 # Exact expected value — catches the wrong discount
- Changing > to >= (off-by-one)
- Replacing and with or in a condition
- Removing a boundary check
- Flipping a return True to return False
- Changing + to - in a calculation