{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2024-10-03T15:10:08.779736+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":987,"instructions":"{\n  \"settings\": {\n    \"readingId\": \"bakery_functions_testing_read\"\n  },\n  \"questions\": {\n    \"UnitTestImportStatement\": {\n      \"type\": \"true_false_question\",\n      \"points\": 1,\n      \"body\": \"The first line of the following code is unnecessary:\\n```python\\nfrom bakery import assert_equal\\n\\ndef days_to_hours(days:int)->int:\\n    return 24 * days\\n\\nassert_equal(days_to_hours(2), 24)\\n```\"\n    },\n    \"UnitTestDefinition\": {\n      \"type\": \"multiple_choice_question\",\n      \"points\": 1,\n      \"body\": \"A unit test is:\",\n      \"answers\": [\n        \"A collection of known inputs and outputs for a function.\",\n        \"A conditional that determines whether the units (e.g., inches, gallons) are correct.\",\n        \"A function that returns a Boolean value.\",\n        \"A function that consumes a function and returns whether the function is correct.\"\n      ]\n    },\n    \"UnitTestIdentification\": {\n      \"type\": \"multiple_answers_question\",\n      \"points\": 1,\n      \"body\": \"Given this function, which of the following unit tests will pass?\\n```python\\nfrom bakery import assert_equal  \\n\\ndef simple_formula(x: int) -> int:\\n    return 3 * x + 4\\n```\",\n      \"answers\": [\n        \"assert_equal(simple_formula(0), 4)\",\n        \"assert_equal(simple_formula(3), 13)\",\n        \"assert_equal(simple_formula(-.5), 2.5)\",\n        \"assert_equal(simple_formula(0), 0)\",\n        \"assert_equal(simple_formula(-1), 2)\",\n        \"assert_equal(simple_formula(0:int)->int, 0: int)\"\n      ]\n    },\n    \"UnitTestAdvantages\": {\n      \"type\": \"multiple_answers_question\",\n      \"points\": 1,\n      \"body\": \"Which of the following are advantages of unit tests?\",\n      \"answers\": [\n        \"They help you find problems early.\",\n        \"They help you facilitate changes down the road.\",\n        \"They make it easier to glue together pieces of code.\",\n        \"They make your code easier to read.\",\n        \"They make your code run faster.\"\n      ]\n    },\n    \"UnitTestBasics\": {\n      \"type\": \"multiple_choice_question\",\n      \"points\": 1,\n      \"body\": \"When someone says, \\\"My program looks correct, but it says it fails the unit tests.\\\"\",\n      \"answers\": [\n        \"The program is probably not correct.\",\n        \"The program is probably correct.\"\n      ]\n    },\n    \"UnitTestQuantity\": {\n      \"type\": \"multiple_choice_question\",\n      \"points\": 1,\n      \"body\": \"How many unit tests should a program have?\",\n      \"answers\": [\n        \"As many as it takes\",\n        \"1\",\n        \"5\",\n        \"100\",\n        \"One for each line of code\"\n      ]\n    },\n    \"UnitTestSuccessRate\": {\n      \"type\": \"true_false_question\",\n      \"points\": 1,\n      \"body\": \"Unit tests are a 100% effective way of determining if your program is correct.\"\n    }\n  }\n}","ip_ranges":"","name":"2A5) Testing Functions","on_change":"","on_eval":"","on_run":"","owner_id":1,"owner_id__email":"acbart@udel.edu","points":1,"public":true,"reviewed":false,"sample_submissions":[],"settings":"","starting_code":"","subordinate":false,"tags":[],"type":"quiz","url":"bakery_functions_testing_quiz","version":3},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":987,"assignment_version":3,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T16:04:47.428563+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T16:04:47.428563+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2037042,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-b803d8aa-4074-48b7-a907-1710fa36ff31","user_id":2044700,"user_id__email":"","version":0},"success":true}
