[ { "function_name": "calculate_discount", "function_code": "def calculate_discount(price, discount_percent):\r\n if discount_percent < 0 or discount_percent > 100:\r\n raise ValueError('Discount must be between 0 and 100')\r\n discount = price * discount_percent / 100\r\n return round(price - discount, 2)", "old_test_code": "import unittest\r\nfrom target import calculate_discount\r\nclass TestCalculateDiscount(unittest.TestCase):\r\n def test_basic(self):\r\n self.assertEqual(calculate_discount(100, 10), 90.0)", "new_test_code": "", "old_score": 0.6249, "new_score": 0.0, "improvement": -0.6249, "old_evaluation": { "coverage": { "line_coverage_pct": 71.4, "branch_coverage_pct": 50.0, "missing_lines": [ 5 ], "missing_branches": [ [ 3, 5 ] ] }, "mutation": { "total_mutants": 8, "killed": 6, "mutation_score": 75.0 }, "static": { "total_test_functions": 1, "total_assertions": 1, "assertion_density": 1.0 } }, "new_evaluation": { "coverage": {}, "mutation": { "total_mutants": 8, "killed": 0, "mutation_score": 0.0 }, "static": { "total_test_functions": 0, "total_assertions": 0, "assertion_density": 0.0 } } }, { "function_name": "count_words", "function_code": "def count_words(text):\r\n if not text or not text.strip():\r\n return 0\r\n return len(text.strip().split())", "old_test_code": "import unittest\r\nfrom target import count_words\r\nclass TestCountWords(unittest.TestCase):\r\n def test_basic(self):\r\n self.assertEqual(count_words('hello world'), 2)", "new_test_code": "import unittest\nfrom target import count_words\nclass TestCountWords(unittest.TestCase):\n def test_empty(self):\n self.assertEqual(count_words(\"\"), 0)\n def test_multiple_spaces(self):\n self.assertEqual(count_words(\" \\n \\t \\r \"), 0)\n def test_only_punctuation(self):\n self.assertEqual(count_words(\"~!@#$%^&*()-+={}[]|;'\\\\:\\\"<>,.?/`\"), 0)\n def test_no_space(self):\n self.assertEqual(count_words(\".?.,\"), 3)\n def test_single_word(self):\n self.assertEqual(count_words(\"helloworld\"), 1)\n def test_numbers(self):\n self.assertEqual(count_words(\"hello123world\"), 4)\n def test_longer_sentence(self):\n self.assertEqual(count_words(\"Hello World!\"), 3)", "old_score": 0.5084, "new_score": 0.95, "improvement": 0.4416, "old_evaluation": { "coverage": { "line_coverage_pct": 66.7, "branch_coverage_pct": 50.0, "missing_lines": [ 5 ], "missing_branches": [ [ 3, 5 ] ] }, "mutation": { "total_mutants": 4, "killed": 1, "mutation_score": 25.0 }, "static": { "total_test_functions": 1, "total_assertions": 1, "assertion_density": 1.0 } }, "new_evaluation": { "coverage": { "line_coverage_pct": 100.0, "branch_coverage_pct": 100.0, "missing_lines": [], "missing_branches": [] }, "mutation": { "total_mutants": 4, "killed": 4, "mutation_score": 100.0 }, "static": { "total_test_functions": 7, "total_assertions": 7, "assertion_density": 1.0 } } } ]