TestProof report

pipeline #2988355888 · job #17459364088 · commit 72e8f53e · generated 2026-10-26T06:47:13+00:00 · TestProof 0.1.0
Mutation score
100% 8/8 killed
Survived
0
Inconclusive
0
Baseline tests
21 passed

Scope

Mode diff against 57c8d573c517d87e38c49d5a4b1ecb5c6212c8e8 · app/orders.py: calculate_discount
Test command: python -m unittest discover -s tests -t .

Mutants

MutantStatusCaught by
calculate_discount.comparison_boundary.L21
app/orders.py:21 · comparison_boundary
- if total < 0:
+ if total <= 0:
test output · 1 test(s) failed against the mutant · 0.712s
.....E...............
======================================================================
ERROR: test_zero_total_is_allowed_and_gets_nothing (tests.test_orders.CalculateDiscountBoundaryTests.test_zero_total_is_allowed_and_gets_nothing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-9me9691f/src/tests/test_orders.py", line 23, in test_zero_total_is_allowed_and_gets_nothing
    self.assertEqual(calculate_discount(0, "SAVE10"), 0.0)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/testproof-mutant-9me9691f/src/app/orders.py", line 20, in calculate_discount
    raise ValueError('total must not be negative')
ValueError: total must not be negative

----------------------------------------------------------------------
Ran 21 tests in 0.001s

FAILED (errors=1)
digest sha256:1bd4dcdaae49b4741f051d2869457f8aeee0f87f12481216508f145c9fe9fa72
KILLED
test_zero_total_is_allowed_and_gets_nothing
calculate_discount.guard_removal.L21
app/orders.py:21 · guard_removal
- raise ValueError('total must not be negative')
+ pass
test output · 1 test(s) failed against the mutant · 0.707s
.......F.............
======================================================================
FAIL: test_negative_total_rejected (tests.test_orders.CalculateDiscountTests.test_negative_total_rejected)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-6ircdspc/src/tests/test_orders.py", line 17, in test_negative_total_rejected
    with self.assertRaises(ValueError):
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: ValueError not raised

----------------------------------------------------------------------
Ran 21 tests in 0.005s

FAILED (failures=1)
digest sha256:f348e4295c4fd61ebda309892b5602357a764124601349229547c4bad1a87d37
KILLED
test_negative_total_rejected
calculate_discount.constant_perturbation.L21
app/orders.py:21 · constant_perturbation
- if total < 0:
+ if total < 1:
test output · 2 test(s) failed against the mutant · 0.707s
E....E...............
======================================================================
ERROR: test_fractional_total_below_one_is_allowed (tests.test_orders.CalculateDiscountBoundaryTests.test_fractional_total_below_one_is_allowed)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-7yzpdv7w/src/tests/test_orders.py", line 26, in test_fractional_total_below_one_is_allowed
    self.assertEqual(calculate_discount(0.5, "SAVE10"), 0.0)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/testproof-mutant-7yzpdv7w/src/app/orders.py", line 20, in calculate_discount
    raise ValueError('total must not be negative')
ValueError: total must not be negative

======================================================================
ERROR: test_zero_total_is_allowed_and_gets_nothing (tests.test_orders.CalculateDiscountBoundaryTests.test_zero_total_is_allowed_and_gets_nothing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-7yzpdv7w/src/tests/test_orders.py", line 23, in test_zero_total_is_allowed_and_gets_nothing
    self.assertEqual(calculate_discount(0, "SAVE10"), 0.0)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/testproof-mutant-7yzpdv7w/src/app/orders.py", line 20, in calculate_discount
    raise ValueError('total must not be negative')
ValueError: total must not be negative

----------------------------------------------------------------------
Ran 21 tests in 0.008s

FAILED (errors=2)
digest sha256:47afe505e581dbb6f3e6ed1575cca4af2a3d1f9284e16f876f101f26935b31c2
KILLED
test_fractional_total_below_one_is_allowed
test_zero_total_is_allowed_and_gets_nothing
calculate_discount.comparison_boundary.L23
app/orders.py:23 · comparison_boundary
- if total >= MIN_ORDER_FOR_DISCOUNT and code in VALID_CODES:
+ if total > MIN_ORDER_FOR_DISCOUNT and code in VALID_CODES:
test output · 1 test(s) failed against the mutant · 0.707s
....F................
======================================================================
FAIL: test_minimum_order_is_inclusive (tests.test_orders.CalculateDiscountBoundaryTests.test_minimum_order_is_inclusive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-_na57pij/src/tests/test_orders.py", line 29, in test_minimum_order_is_inclusive
    self.assertEqual(calculate_discount(100, "SAVE10"), 10.0)
AssertionError: 0.0 != 10.0

----------------------------------------------------------------------
Ran 21 tests in 0.007s

FAILED (failures=1)
digest sha256:8f3349bdc073d7c54c2f65ee95716fdcbaa5609801dcc44b369be56ab5ac3b70
KILLED
test_minimum_order_is_inclusive
calculate_discount.membership_flip.L23
app/orders.py:23 · membership_flip
- if total >= MIN_ORDER_FOR_DISCOUNT and code in VALID_CODES:
+ if total >= MIN_ORDER_FOR_DISCOUNT and code not in VALID_CODES:
test output · 5 test(s) failed against the mutant · 0.695s
...
orders.CalculateDiscountBoundaryTests.test_member_with_invalid_code_gets_nothing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-4rk18suk/src/tests/test_orders.py", line 38, in test_member_with_invalid_code_gets_nothing
    self.assertEqual(calculate_discount(200, "BOGUS", is_member=True), 0.0)
AssertionError: 30.0 != 0.0

======================================================================
FAIL: test_minimum_order_is_inclusive (tests.test_orders.CalculateDiscountBoundaryTests.test_minimum_order_is_inclusive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-4rk18suk/src/tests/test_orders.py", line 29, in test_minimum_order_is_inclusive
    self.assertEqual(calculate_discount(100, "SAVE10"), 10.0)
AssertionError: 0.0 != 10.0

======================================================================
FAIL: test_invalid_code_gets_nothing (tests.test_orders.CalculateDiscountTests.test_invalid_code_gets_nothing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-4rk18suk/src/tests/test_orders.py", line 11, in test_invalid_code_gets_nothing
    self.assertEqual(calculate_discount(150, "BOGUS"), 0.0)
AssertionError: 15.0 != 0.0

======================================================================
FAIL: test_valid_code_on_large_order (tests.test_orders.CalculateDiscountTests.test_valid_code_on_large_order)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-4rk18suk/src/tests/test_orders.py", line 8, in test_valid_code_on_large_order
    self.assertEqual(calculate_discount(150, "SAVE10"), 15.0)
AssertionError: 0.0 != 15.0

----------------------------------------------------------------------
Ran 21 tests in 0.002s

FAILED (failures=5)
digest sha256:f272dd72f0aa2ec444621cbaf8072eff1ab7dd29cc989ffe62e0c26c680b7c41
KILLED
test_member_gets_bonus_on_top
test_member_with_invalid_code_gets_nothing
test_minimum_order_is_inclusive
test_invalid_code_gets_nothing
test_valid_code_on_large_order
calculate_discount.boolean_flip.L25
app/orders.py:25 · boolean_flip
- if is_member:
+ if not is_member:
test output · 3 test(s) failed against the mutant · 0.71s
..F.F....F...........
======================================================================
FAIL: test_member_gets_bonus_on_top (tests.test_orders.CalculateDiscountBoundaryTests.test_member_gets_bonus_on_top)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-2d6y9jh6/src/tests/test_orders.py", line 35, in test_member_gets_bonus_on_top
    self.assertEqual(calculate_discount(200, "SAVE10", is_member=True), 30.0)
AssertionError: 20.0 != 30.0

======================================================================
FAIL: test_minimum_order_is_inclusive (tests.test_orders.CalculateDiscountBoundaryTests.test_minimum_order_is_inclusive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-2d6y9jh6/src/tests/test_orders.py", line 29, in test_minimum_order_is_inclusive
    self.assertEqual(calculate_discount(100, "SAVE10"), 10.0)
AssertionError: 15.0 != 10.0

======================================================================
FAIL: test_valid_code_on_large_order (tests.test_orders.CalculateDiscountTests.test_valid_code_on_large_order)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-2d6y9jh6/src/tests/test_orders.py", line 8, in test_valid_code_on_large_order
    self.assertEqual(calculate_discount(150, "SAVE10"), 15.0)
AssertionError: 22.5 != 15.0

----------------------------------------------------------------------
Ran 21 tests in 0.007s

FAILED (failures=3)
digest sha256:c790b400308b5cf81246d023659dbea1ed235b795fca5107c812d43d47267d37
KILLED
test_member_gets_bonus_on_top
test_minimum_order_is_inclusive
test_valid_code_on_large_order
calculate_discount.arithmetic_swap.L26
app/orders.py:26 · arithmetic_swap
- rate += MEMBER_BONUS_RATE
+ rate -= MEMBER_BONUS_RATE
test output · 1 test(s) failed against the mutant · 0.672s
..F..................
======================================================================
FAIL: test_member_gets_bonus_on_top (tests.test_orders.CalculateDiscountBoundaryTests.test_member_gets_bonus_on_top)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-xme_he4k/src/tests/test_orders.py", line 35, in test_member_gets_bonus_on_top
    self.assertEqual(calculate_discount(200, "SAVE10", is_member=True), 30.0)
AssertionError: 10.0 != 30.0

----------------------------------------------------------------------
Ran 21 tests in 0.008s

FAILED (failures=1)
digest sha256:99973a9dbf843ad63371b3dbca262d90bd17c356acb281c2aa067e49d27937e8
KILLED
test_member_gets_bonus_on_top
calculate_discount.arithmetic_swap.L27
app/orders.py:27 · arithmetic_swap
- return round(total * rate, 2)
+ return round(total / rate, 2)
test output · 3 test(s) failed against the mutant · 0.71s
..F.F....F...........
======================================================================
FAIL: test_member_gets_bonus_on_top (tests.test_orders.CalculateDiscountBoundaryTests.test_member_gets_bonus_on_top)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-x0r17awr/src/tests/test_orders.py", line 35, in test_member_gets_bonus_on_top
    self.assertEqual(calculate_discount(200, "SAVE10", is_member=True), 30.0)
AssertionError: 1333.33 != 30.0

======================================================================
FAIL: test_minimum_order_is_inclusive (tests.test_orders.CalculateDiscountBoundaryTests.test_minimum_order_is_inclusive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-x0r17awr/src/tests/test_orders.py", line 29, in test_minimum_order_is_inclusive
    self.assertEqual(calculate_discount(100, "SAVE10"), 10.0)
AssertionError: 1000.0 != 10.0

======================================================================
FAIL: test_valid_code_on_large_order (tests.test_orders.CalculateDiscountTests.test_valid_code_on_large_order)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testproof-mutant-x0r17awr/src/tests/test_orders.py", line 8, in test_valid_code_on_large_order
    self.assertEqual(calculate_discount(150, "SAVE10"), 15.0)
AssertionError: 1500.0 != 15.0

----------------------------------------------------------------------
Ran 21 tests in 0.002s

FAILED (failures=3)
digest sha256:5ba35d6dbedc37bb1404cbcfb78327cff4b2b007b2dabeedc7fc27ab618214ba
KILLED
test_member_gets_bonus_on_top
test_minimum_order_is_inclusive
test_valid_code_on_large_order
A mutant is KILLED only when at least one named test failed against it, SURVIVED when the whole suite passed, and INCONCLUSIVE on timeouts or errors with no failing test. Score = killed / (killed + survived); inconclusive mutants are excluded and shown separately. Statuses come from running the real test suite, never from a language model.