diff --git "a/data.json" "b/data.json" new file mode 100644--- /dev/null +++ "b/data.json" @@ -0,0 +1,12002 @@ +[ + { + "id": "AITST_00001", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00002", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00003", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processFile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass FileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processFile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00004", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processRecord(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRecord(t *testing.T) {\n got := processRecord([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00005", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_metric(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_metric() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_metric(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00006", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_notification(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessNotification, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_notification(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00007", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00008", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_routes;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00009", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_service(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_service_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_service(items) == 6\n\ndef test_service_empty_input():\n assert process_service([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00010", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00011", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00012", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processController(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ControllerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processController(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00013", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processRepository(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRepository(t *testing.T) {\n got := processRepository([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00014", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_client(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_client() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_client(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00015", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_pipeline(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPipeline, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_pipeline(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00016", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00017", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_invoices;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00018", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_session(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_session_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_session(items) == 6\n\ndef test_session_empty_input():\n assert process_session([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00019", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00020", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00021", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processWorker(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass WorkerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processWorker(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00022", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processParser(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessParser(t *testing.T) {\n got := processParser([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00023", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_report(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_report() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_report(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00024", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_profile(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessProfile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_profile(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00025", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00026", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_orders;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00027", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_cache_key(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cache_key_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cache_key(items) == 6\n\ndef test_cache_key_empty_input():\n assert process_cache_key([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00028", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00029", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00030", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processPayload(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PayloadTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPayload(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00031", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processFile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessFile(t *testing.T) {\n got := processFile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00032", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_record(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_record() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_record(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00033", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_metric(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessMetric, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_metric(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00034", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00035", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_tasks;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00036", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_route(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_route_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_route(items) == 6\n\ndef test_route_empty_input():\n assert process_route([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00037", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00038", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00039", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processHandler(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass HandlerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processHandler(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00040", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processController(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessController(t *testing.T) {\n got := processController([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00041", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_repository(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_repository() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_repository(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00042", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_client(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessClient, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_client(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00043", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00044", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_modules;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00045", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_invoice(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_invoice_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_invoice(items) == 6\n\ndef test_invoice_empty_input():\n assert process_invoice([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00046", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00047", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00048", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processQueue(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass QueueTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processQueue(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00049", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processWorker(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessWorker(t *testing.T) {\n got := processWorker([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00050", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_parser(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_parser() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_parser(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00051", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_report(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessReport, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_report(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00052", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00053", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_carts;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00054", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_order(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_order_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_order(items) == 6\n\ndef test_order_empty_input():\n assert process_order([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00055", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00056", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00057", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processEvent(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass EventTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processEvent(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00058", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processPayload(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPayload(t *testing.T) {\n got := processPayload([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00059", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_file(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_file() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_file(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00060", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_record(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRecord, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_record(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00061", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00062", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_notifications;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00063", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_task(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_task_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_task(items) == 6\n\ndef test_task_empty_input():\n assert process_task([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00064", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00065", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00066", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processAdapter(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass AdapterTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processAdapter(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00067", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processHandler(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessHandler(t *testing.T) {\n got := processHandler([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00068", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_controller(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_controller() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_controller(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00069", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_repository(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRepository, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_repository(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00070", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00071", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_pipelines;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00072", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_module(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_module_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_module(items) == 6\n\ndef test_module_empty_input():\n assert process_module([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00073", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00074", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00075", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processToken(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TokenTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processToken(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00076", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processQueue(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessQueue(t *testing.T) {\n got := processQueue([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00077", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_worker(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_worker() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_worker(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00078", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_parser(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessParser, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_parser(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00079", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00080", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_profiles;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00081", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_cart(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cart_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cart(items) == 6\n\ndef test_cart_empty_input():\n assert process_cart([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00082", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00083", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00084", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processJob(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass JobTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processJob(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00085", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processEvent(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessEvent(t *testing.T) {\n got := processEvent([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00086", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_payload(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_payload() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_payload(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00087", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_file(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessFile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_file(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00088", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00089", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_metrics;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00090", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_notification(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_notification_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_notification(items) == 6\n\ndef test_notification_empty_input():\n assert process_notification([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00091", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00092", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00093", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processService(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ServiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processService(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00094", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processAdapter(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessAdapter(t *testing.T) {\n got := processAdapter([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00095", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_handler(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_handler() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_handler(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00096", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_controller(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessController, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_controller(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00097", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00098", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_clients;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00099", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_pipeline(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_pipeline_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_pipeline(items) == 6\n\ndef test_pipeline_empty_input():\n assert process_pipeline([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00100", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00101", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00102", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processSession(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass SessionTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processSession(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00103", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processToken(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessToken(t *testing.T) {\n got := processToken([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00104", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_queue(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_queue() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_queue(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00105", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_worker(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessWorker, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_worker(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00106", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00107", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_reports;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00108", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_profile(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_profile_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_profile(items) == 6\n\ndef test_profile_empty_input():\n assert process_profile([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00109", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00110", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00111", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processCache_Key(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass Cache_KeyTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCache_Key(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00112", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processJob(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessJob(t *testing.T) {\n got := processJob([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00113", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_event(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_event() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_event(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00114", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_payload(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPayload, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_payload(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00115", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00116", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_records;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00117", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_metric(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_metric_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_metric(items) == 6\n\ndef test_metric_empty_input():\n assert process_metric([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00118", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00119", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00120", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processRoute(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RouteTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRoute(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00121", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processService(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessService(t *testing.T) {\n got := processService([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00122", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_adapter(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_adapter() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_adapter(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00123", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_handler(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessHandler, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_handler(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00124", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00125", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_repositorys;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00126", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_client(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_client_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_client(items) == 6\n\ndef test_client_empty_input():\n assert process_client([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00127", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00128", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00129", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processInvoice(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass InvoiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processInvoice(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00130", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processSession(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessSession(t *testing.T) {\n got := processSession([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00131", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_token(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_token() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_token(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00132", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_queue(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessQueue, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_queue(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00133", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00134", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_parsers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00135", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_report(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_report_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_report(items) == 6\n\ndef test_report_empty_input():\n assert process_report([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00136", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00137", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00138", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processOrder(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass OrderTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processOrder(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00139", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processCache_Key(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCache_Key(t *testing.T) {\n got := processCache_Key([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00140", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_job(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_job() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_job(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00141", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_event(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessEvent, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_event(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00142", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00143", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_files;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00144", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_record(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_record_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_record(items) == 6\n\ndef test_record_empty_input():\n assert process_record([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00145", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00146", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00147", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processTask(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TaskTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processTask(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00148", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processRoute(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRoute(t *testing.T) {\n got := processRoute([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00149", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_service(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_service() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_service(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00150", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_adapter(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessAdapter, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_adapter(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00151", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00152", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_controllers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00153", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_repository(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_repository_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_repository(items) == 6\n\ndef test_repository_empty_input():\n assert process_repository([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00154", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00155", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00156", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processModule(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ModuleTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processModule(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00157", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processInvoice(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessInvoice(t *testing.T) {\n got := processInvoice([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00158", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_session(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_session() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_session(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00159", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_token(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessToken, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_token(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00160", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00161", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_workers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00162", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_parser(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_parser_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_parser(items) == 6\n\ndef test_parser_empty_input():\n assert process_parser([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00163", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00164", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00165", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processCart(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass CartTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCart(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00166", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processOrder(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessOrder(t *testing.T) {\n got := processOrder([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00167", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_cache_key(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cache_key() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cache_key(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00168", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_job(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessJob, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_job(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00169", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00170", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_payloads;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00171", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_file(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_file_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_file(items) == 6\n\ndef test_file_empty_input():\n assert process_file([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00172", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00173", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00174", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processNotification(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass NotificationTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processNotification(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00175", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processTask(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessTask(t *testing.T) {\n got := processTask([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00176", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_route(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_route() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_route(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00177", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_service(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessService, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_service(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00178", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00179", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_handlers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00180", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_controller(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_controller_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_controller(items) == 6\n\ndef test_controller_empty_input():\n assert process_controller([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00181", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00182", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00183", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processPipeline(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PipelineTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPipeline(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00184", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processModule(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessModule(t *testing.T) {\n got := processModule([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00185", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_invoice(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_invoice() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_invoice(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00186", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_session(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessSession, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_session(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00187", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00188", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_queues;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00189", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_worker(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_worker_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_worker(items) == 6\n\ndef test_worker_empty_input():\n assert process_worker([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00190", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00191", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00192", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processProfile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ProfileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processProfile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00193", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processCart(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCart(t *testing.T) {\n got := processCart([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00194", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_order(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_order() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_order(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00195", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_cache_key(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessCache_Key, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_cache_key(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00196", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00197", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_events;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00198", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_payload(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_payload_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_payload(items) == 6\n\ndef test_payload_empty_input():\n assert process_payload([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00199", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00200", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00201", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processMetric(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass MetricTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processMetric(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00202", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processNotification(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessNotification(t *testing.T) {\n got := processNotification([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00203", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_task(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_task() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_task(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00204", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_route(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRoute, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_route(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00205", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00206", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_adapters;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00207", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_handler(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_handler_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_handler(items) == 6\n\ndef test_handler_empty_input():\n assert process_handler([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00208", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00209", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00210", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processClient(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ClientTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processClient(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00211", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processPipeline(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPipeline(t *testing.T) {\n got := processPipeline([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00212", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_module(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_module() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_module(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00213", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_invoice(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessInvoice, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_invoice(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00214", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00215", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_tokens;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00216", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_queue(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_queue_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_queue(items) == 6\n\ndef test_queue_empty_input():\n assert process_queue([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00217", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processWorker(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('worker', () => {\n it('handles a normal input set', () => {\n expect(processWorker(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00218", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00219", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processReport(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ReportTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processReport(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00220", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processProfile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessProfile(t *testing.T) {\n got := processProfile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00221", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_cart(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cart() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cart(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00222", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_order(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessOrder, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_order(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00223", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00224", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_jobs;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00225", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_event(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_event_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_event(items) == 6\n\ndef test_event_empty_input():\n assert process_event([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00226", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00227", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00228", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processRecord(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RecordTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRecord(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00229", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processMetric(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessMetric(t *testing.T) {\n got := processMetric([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00230", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_notification(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_notification() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_notification(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00231", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_task(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessTask, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_task(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00232", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00233", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_services;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00234", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_adapter(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_adapter_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_adapter(items) == 6\n\ndef test_adapter_empty_input():\n assert process_adapter([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00235", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00236", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00237", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processRepository(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RepositoryTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRepository(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00238", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processClient(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessClient(t *testing.T) {\n got := processClient([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00239", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_pipeline(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_pipeline() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_pipeline(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00240", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_module(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessModule, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_module(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00241", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00242", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_sessions;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00243", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_token(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_token_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_token(items) == 6\n\ndef test_token_empty_input():\n assert process_token([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00244", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00245", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processWorker(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('worker', () => {\n it('handles a normal input set', () => {\n expect(processWorker(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00246", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processParser(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ParserTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processParser(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00247", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processReport(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessReport(t *testing.T) {\n got := processReport([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00248", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_profile(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_profile() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_profile(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00249", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_cart(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessCart, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_cart(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00250", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00251", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_cache_keys;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00252", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_job(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_job_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_job(items) == 6\n\ndef test_job_empty_input():\n assert process_job([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00253", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00254", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00255", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processFile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass FileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processFile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00256", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processRecord(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRecord(t *testing.T) {\n got := processRecord([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00257", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_metric(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_metric() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_metric(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00258", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_notification(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessNotification, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_notification(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00259", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00260", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_routes;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00261", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_service(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_service_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_service(items) == 6\n\ndef test_service_empty_input():\n assert process_service([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00262", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00263", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00264", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processController(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ControllerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processController(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00265", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processRepository(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRepository(t *testing.T) {\n got := processRepository([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00266", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_client(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_client() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_client(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00267", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_pipeline(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPipeline, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_pipeline(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00268", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00269", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_invoices;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00270", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_session(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_session_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_session(items) == 6\n\ndef test_session_empty_input():\n assert process_session([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00271", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00272", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00273", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processWorker(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass WorkerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processWorker(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00274", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processParser(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessParser(t *testing.T) {\n got := processParser([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00275", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_report(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_report() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_report(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00276", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_profile(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessProfile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_profile(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00277", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00278", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_orders;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00279", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_cache_key(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cache_key_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cache_key(items) == 6\n\ndef test_cache_key_empty_input():\n assert process_cache_key([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00280", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00281", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00282", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processPayload(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PayloadTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPayload(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00283", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processFile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessFile(t *testing.T) {\n got := processFile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00284", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_record(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_record() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_record(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00285", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_metric(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessMetric, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_metric(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00286", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00287", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_tasks;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00288", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_route(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_route_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_route(items) == 6\n\ndef test_route_empty_input():\n assert process_route([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00289", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00290", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00291", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processHandler(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass HandlerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processHandler(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00292", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processController(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessController(t *testing.T) {\n got := processController([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00293", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_repository(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_repository() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_repository(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00294", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_client(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessClient, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_client(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00295", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00296", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_modules;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00297", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_invoice(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_invoice_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_invoice(items) == 6\n\ndef test_invoice_empty_input():\n assert process_invoice([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00298", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00299", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00300", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processQueue(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass QueueTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processQueue(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00301", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processWorker(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessWorker(t *testing.T) {\n got := processWorker([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00302", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_parser(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_parser() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_parser(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00303", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_report(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessReport, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_report(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00304", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00305", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_carts;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00306", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_order(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_order_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_order(items) == 6\n\ndef test_order_empty_input():\n assert process_order([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00307", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00308", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00309", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processEvent(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass EventTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processEvent(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00310", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processPayload(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPayload(t *testing.T) {\n got := processPayload([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00311", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_file(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_file() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_file(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00312", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_record(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRecord, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_record(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00313", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00314", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_notifications;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00315", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_task(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_task_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_task(items) == 6\n\ndef test_task_empty_input():\n assert process_task([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00316", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00317", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00318", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processAdapter(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass AdapterTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processAdapter(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00319", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processHandler(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessHandler(t *testing.T) {\n got := processHandler([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00320", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_controller(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_controller() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_controller(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00321", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_repository(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRepository, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_repository(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00322", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00323", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_pipelines;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00324", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_module(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_module_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_module(items) == 6\n\ndef test_module_empty_input():\n assert process_module([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00325", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00326", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00327", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processToken(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TokenTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processToken(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00328", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processQueue(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessQueue(t *testing.T) {\n got := processQueue([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00329", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_worker(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_worker() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_worker(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00330", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_parser(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessParser, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_parser(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00331", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00332", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_profiles;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00333", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_cart(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cart_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cart(items) == 6\n\ndef test_cart_empty_input():\n assert process_cart([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00334", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00335", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00336", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processJob(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass JobTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processJob(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00337", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processEvent(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessEvent(t *testing.T) {\n got := processEvent([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00338", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_payload(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_payload() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_payload(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00339", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_file(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessFile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_file(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00340", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00341", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_metrics;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00342", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_notification(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_notification_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_notification(items) == 6\n\ndef test_notification_empty_input():\n assert process_notification([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00343", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00344", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00345", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processService(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ServiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processService(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00346", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processAdapter(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessAdapter(t *testing.T) {\n got := processAdapter([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00347", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_handler(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_handler() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_handler(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00348", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_controller(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessController, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_controller(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00349", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00350", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_clients;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00351", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_pipeline(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_pipeline_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_pipeline(items) == 6\n\ndef test_pipeline_empty_input():\n assert process_pipeline([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00352", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00353", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00354", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processSession(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass SessionTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processSession(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00355", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processToken(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessToken(t *testing.T) {\n got := processToken([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00356", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_queue(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_queue() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_queue(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00357", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_worker(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessWorker, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_worker(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00358", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00359", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_reports;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00360", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_profile(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_profile_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_profile(items) == 6\n\ndef test_profile_empty_input():\n assert process_profile([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00361", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00362", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00363", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processCache_Key(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass Cache_KeyTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCache_Key(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00364", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processJob(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessJob(t *testing.T) {\n got := processJob([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00365", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_event(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_event() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_event(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00366", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_payload(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPayload, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_payload(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00367", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00368", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_records;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00369", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_metric(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_metric_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_metric(items) == 6\n\ndef test_metric_empty_input():\n assert process_metric([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00370", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00371", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00372", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processRoute(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RouteTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRoute(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00373", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processService(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessService(t *testing.T) {\n got := processService([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00374", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_adapter(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_adapter() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_adapter(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00375", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_handler(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessHandler, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_handler(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00376", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00377", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_repositorys;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00378", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_client(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_client_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_client(items) == 6\n\ndef test_client_empty_input():\n assert process_client([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00379", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00380", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00381", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processInvoice(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass InvoiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processInvoice(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00382", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processSession(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessSession(t *testing.T) {\n got := processSession([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00383", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_token(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_token() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_token(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00384", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_queue(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessQueue, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_queue(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00385", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00386", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_parsers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00387", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_report(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_report_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_report(items) == 6\n\ndef test_report_empty_input():\n assert process_report([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00388", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00389", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00390", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processOrder(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass OrderTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processOrder(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00391", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processCache_Key(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCache_Key(t *testing.T) {\n got := processCache_Key([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00392", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_job(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_job() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_job(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00393", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_event(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessEvent, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_event(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00394", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00395", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_files;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00396", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_record(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_record_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_record(items) == 6\n\ndef test_record_empty_input():\n assert process_record([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00397", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00398", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00399", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processTask(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TaskTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processTask(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00400", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processRoute(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRoute(t *testing.T) {\n got := processRoute([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00401", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_service(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_service() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_service(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00402", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_adapter(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessAdapter, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_adapter(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00403", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00404", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_controllers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00405", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_repository(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_repository_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_repository(items) == 6\n\ndef test_repository_empty_input():\n assert process_repository([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00406", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00407", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00408", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processModule(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ModuleTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processModule(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00409", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processInvoice(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessInvoice(t *testing.T) {\n got := processInvoice([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00410", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_session(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_session() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_session(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00411", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_token(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessToken, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_token(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00412", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00413", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_workers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00414", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_parser(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_parser_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_parser(items) == 6\n\ndef test_parser_empty_input():\n assert process_parser([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00415", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00416", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00417", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processCart(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass CartTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCart(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00418", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processOrder(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessOrder(t *testing.T) {\n got := processOrder([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00419", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_cache_key(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cache_key() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cache_key(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00420", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_job(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessJob, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_job(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00421", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00422", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_payloads;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00423", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_file(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_file_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_file(items) == 6\n\ndef test_file_empty_input():\n assert process_file([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00424", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00425", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00426", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processNotification(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass NotificationTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processNotification(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00427", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processTask(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessTask(t *testing.T) {\n got := processTask([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00428", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_route(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_route() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_route(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00429", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_service(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessService, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_service(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00430", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00431", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_handlers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00432", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_controller(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_controller_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_controller(items) == 6\n\ndef test_controller_empty_input():\n assert process_controller([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00433", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00434", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00435", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processPipeline(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PipelineTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPipeline(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00436", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processModule(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessModule(t *testing.T) {\n got := processModule([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00437", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_invoice(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_invoice() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_invoice(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00438", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_session(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessSession, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_session(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00439", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00440", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_queues;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00441", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_worker(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_worker_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_worker(items) == 6\n\ndef test_worker_empty_input():\n assert process_worker([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00442", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00443", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00444", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processProfile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ProfileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processProfile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00445", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processCart(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCart(t *testing.T) {\n got := processCart([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00446", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_order(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_order() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_order(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00447", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_cache_key(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessCache_Key, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_cache_key(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00448", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00449", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_events;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00450", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_payload(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_payload_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_payload(items) == 6\n\ndef test_payload_empty_input():\n assert process_payload([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00451", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00452", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00453", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processMetric(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass MetricTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processMetric(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00454", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processNotification(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessNotification(t *testing.T) {\n got := processNotification([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00455", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_task(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_task() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_task(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00456", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_route(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRoute, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_route(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00457", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00458", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_adapters;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00459", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_handler(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_handler_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_handler(items) == 6\n\ndef test_handler_empty_input():\n assert process_handler([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00460", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00461", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00462", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processClient(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ClientTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processClient(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00463", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processPipeline(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPipeline(t *testing.T) {\n got := processPipeline([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00464", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_module(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_module() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_module(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00465", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_invoice(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessInvoice, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_invoice(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00466", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00467", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_tokens;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00468", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_queue(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_queue_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_queue(items) == 6\n\ndef test_queue_empty_input():\n assert process_queue([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00469", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processWorker(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('worker', () => {\n it('handles a normal input set', () => {\n expect(processWorker(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00470", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00471", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processReport(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ReportTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processReport(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00472", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processProfile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessProfile(t *testing.T) {\n got := processProfile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00473", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_cart(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cart() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cart(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00474", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_order(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessOrder, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_order(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00475", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00476", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_jobs;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00477", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_event(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_event_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_event(items) == 6\n\ndef test_event_empty_input():\n assert process_event([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00478", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00479", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00480", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processRecord(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RecordTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRecord(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00481", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processMetric(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessMetric(t *testing.T) {\n got := processMetric([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00482", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_notification(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_notification() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_notification(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00483", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_task(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessTask, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_task(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00484", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00485", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_services;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00486", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_adapter(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_adapter_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_adapter(items) == 6\n\ndef test_adapter_empty_input():\n assert process_adapter([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00487", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00488", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00489", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processRepository(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RepositoryTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRepository(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00490", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processClient(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessClient(t *testing.T) {\n got := processClient([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00491", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_pipeline(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_pipeline() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_pipeline(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00492", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_module(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessModule, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_module(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00493", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00494", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_sessions;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00495", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_token(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_token_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_token(items) == 6\n\ndef test_token_empty_input():\n assert process_token([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00496", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00497", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processWorker(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('worker', () => {\n it('handles a normal input set', () => {\n expect(processWorker(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00498", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processParser(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ParserTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processParser(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00499", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processReport(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessReport(t *testing.T) {\n got := processReport([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00500", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_profile(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_profile() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_profile(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00501", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_cart(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessCart, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_cart(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00502", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00503", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_cache_keys;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00504", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_job(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_job_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_job(items) == 6\n\ndef test_job_empty_input():\n assert process_job([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00505", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00506", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00507", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processFile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass FileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processFile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00508", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processRecord(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRecord(t *testing.T) {\n got := processRecord([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00509", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_metric(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_metric() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_metric(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00510", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_notification(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessNotification, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_notification(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00511", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00512", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_routes;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00513", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_service(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_service_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_service(items) == 6\n\ndef test_service_empty_input():\n assert process_service([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00514", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00515", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00516", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processController(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ControllerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processController(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00517", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processRepository(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRepository(t *testing.T) {\n got := processRepository([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00518", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_client(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_client() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_client(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00519", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_pipeline(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPipeline, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_pipeline(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00520", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00521", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_invoices;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00522", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_session(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_session_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_session(items) == 6\n\ndef test_session_empty_input():\n assert process_session([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00523", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00524", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00525", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processWorker(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass WorkerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processWorker(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00526", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processParser(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessParser(t *testing.T) {\n got := processParser([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00527", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_report(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_report() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_report(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00528", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_profile(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessProfile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_profile(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00529", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00530", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_orders;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00531", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_cache_key(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cache_key_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cache_key(items) == 6\n\ndef test_cache_key_empty_input():\n assert process_cache_key([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00532", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00533", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00534", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processPayload(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PayloadTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPayload(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00535", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processFile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessFile(t *testing.T) {\n got := processFile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00536", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_record(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_record() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_record(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00537", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_metric(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessMetric, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_metric(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00538", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00539", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_tasks;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00540", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_route(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_route_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_route(items) == 6\n\ndef test_route_empty_input():\n assert process_route([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00541", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00542", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00543", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processHandler(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass HandlerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processHandler(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00544", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processController(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessController(t *testing.T) {\n got := processController([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00545", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_repository(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_repository() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_repository(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00546", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_client(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessClient, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_client(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00547", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00548", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_modules;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00549", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_invoice(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_invoice_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_invoice(items) == 6\n\ndef test_invoice_empty_input():\n assert process_invoice([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00550", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00551", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00552", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processQueue(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass QueueTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processQueue(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00553", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processWorker(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessWorker(t *testing.T) {\n got := processWorker([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00554", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_parser(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_parser() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_parser(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00555", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_report(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessReport, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_report(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00556", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00557", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_carts;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00558", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_order(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_order_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_order(items) == 6\n\ndef test_order_empty_input():\n assert process_order([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00559", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00560", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00561", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processEvent(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass EventTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processEvent(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00562", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processPayload(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPayload(t *testing.T) {\n got := processPayload([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00563", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_file(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_file() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_file(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00564", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_record(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRecord, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_record(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00565", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00566", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_notifications;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00567", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_task(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_task_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_task(items) == 6\n\ndef test_task_empty_input():\n assert process_task([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00568", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00569", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00570", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processAdapter(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass AdapterTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processAdapter(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00571", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processHandler(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessHandler(t *testing.T) {\n got := processHandler([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00572", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_controller(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_controller() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_controller(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00573", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_repository(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRepository, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_repository(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00574", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00575", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_pipelines;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00576", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_module(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_module_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_module(items) == 6\n\ndef test_module_empty_input():\n assert process_module([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00577", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00578", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00579", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processToken(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TokenTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processToken(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00580", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processQueue(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessQueue(t *testing.T) {\n got := processQueue([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00581", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_worker(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_worker() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_worker(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00582", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_parser(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessParser, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_parser(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00583", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00584", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_profiles;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00585", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_cart(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cart_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cart(items) == 6\n\ndef test_cart_empty_input():\n assert process_cart([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00586", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00587", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00588", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processJob(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass JobTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processJob(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00589", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processEvent(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessEvent(t *testing.T) {\n got := processEvent([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00590", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_payload(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_payload() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_payload(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00591", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_file(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessFile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_file(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00592", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00593", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_metrics;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00594", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_notification(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_notification_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_notification(items) == 6\n\ndef test_notification_empty_input():\n assert process_notification([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00595", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00596", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00597", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processService(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ServiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processService(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00598", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processAdapter(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessAdapter(t *testing.T) {\n got := processAdapter([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00599", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_handler(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_handler() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_handler(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00600", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_controller(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessController, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_controller(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00601", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00602", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_clients;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00603", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_pipeline(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_pipeline_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_pipeline(items) == 6\n\ndef test_pipeline_empty_input():\n assert process_pipeline([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00604", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00605", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00606", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processSession(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass SessionTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processSession(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00607", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processToken(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessToken(t *testing.T) {\n got := processToken([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00608", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_queue(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_queue() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_queue(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00609", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_worker(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessWorker, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_worker(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00610", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00611", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_reports;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00612", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_profile(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_profile_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_profile(items) == 6\n\ndef test_profile_empty_input():\n assert process_profile([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00613", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00614", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00615", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processCache_Key(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass Cache_KeyTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCache_Key(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00616", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processJob(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessJob(t *testing.T) {\n got := processJob([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00617", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_event(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_event() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_event(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00618", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_payload(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPayload, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_payload(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00619", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00620", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_records;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00621", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_metric(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_metric_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_metric(items) == 6\n\ndef test_metric_empty_input():\n assert process_metric([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00622", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00623", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00624", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processRoute(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RouteTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRoute(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00625", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processService(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessService(t *testing.T) {\n got := processService([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00626", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_adapter(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_adapter() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_adapter(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00627", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_handler(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessHandler, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_handler(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00628", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00629", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_repositorys;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00630", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_client(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_client_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_client(items) == 6\n\ndef test_client_empty_input():\n assert process_client([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00631", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00632", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00633", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processInvoice(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass InvoiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processInvoice(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00634", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processSession(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessSession(t *testing.T) {\n got := processSession([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00635", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_token(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_token() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_token(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00636", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_queue(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessQueue, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_queue(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00637", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00638", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_parsers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00639", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_report(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_report_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_report(items) == 6\n\ndef test_report_empty_input():\n assert process_report([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00640", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00641", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00642", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processOrder(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass OrderTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processOrder(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00643", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processCache_Key(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCache_Key(t *testing.T) {\n got := processCache_Key([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00644", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_job(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_job() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_job(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00645", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_event(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessEvent, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_event(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00646", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00647", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_files;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00648", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_record(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_record_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_record(items) == 6\n\ndef test_record_empty_input():\n assert process_record([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00649", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00650", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00651", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processTask(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TaskTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processTask(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00652", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processRoute(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRoute(t *testing.T) {\n got := processRoute([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00653", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_service(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_service() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_service(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00654", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_adapter(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessAdapter, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_adapter(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00655", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00656", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_controllers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00657", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_repository(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_repository_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_repository(items) == 6\n\ndef test_repository_empty_input():\n assert process_repository([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00658", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00659", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00660", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processModule(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ModuleTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processModule(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00661", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processInvoice(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessInvoice(t *testing.T) {\n got := processInvoice([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00662", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_session(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_session() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_session(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00663", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_token(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessToken, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_token(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00664", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00665", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_workers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00666", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_parser(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_parser_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_parser(items) == 6\n\ndef test_parser_empty_input():\n assert process_parser([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00667", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00668", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00669", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processCart(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass CartTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCart(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00670", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processOrder(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessOrder(t *testing.T) {\n got := processOrder([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00671", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_cache_key(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cache_key() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cache_key(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00672", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_job(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessJob, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_job(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00673", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00674", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_payloads;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00675", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_file(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_file_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_file(items) == 6\n\ndef test_file_empty_input():\n assert process_file([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00676", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00677", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00678", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processNotification(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass NotificationTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processNotification(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00679", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processTask(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessTask(t *testing.T) {\n got := processTask([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00680", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_route(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_route() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_route(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00681", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_service(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessService, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_service(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00682", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00683", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_handlers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00684", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_controller(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_controller_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_controller(items) == 6\n\ndef test_controller_empty_input():\n assert process_controller([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00685", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00686", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00687", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processPipeline(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PipelineTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPipeline(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00688", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processModule(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessModule(t *testing.T) {\n got := processModule([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00689", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_invoice(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_invoice() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_invoice(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00690", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_session(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessSession, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_session(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00691", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00692", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_queues;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00693", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_worker(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_worker_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_worker(items) == 6\n\ndef test_worker_empty_input():\n assert process_worker([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00694", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00695", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00696", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processProfile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ProfileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processProfile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00697", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processCart(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCart(t *testing.T) {\n got := processCart([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00698", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_order(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_order() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_order(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00699", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_cache_key(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessCache_Key, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_cache_key(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00700", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00701", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_events;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00702", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_payload(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_payload_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_payload(items) == 6\n\ndef test_payload_empty_input():\n assert process_payload([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00703", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00704", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00705", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processMetric(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass MetricTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processMetric(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00706", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processNotification(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessNotification(t *testing.T) {\n got := processNotification([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00707", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_task(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_task() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_task(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00708", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_route(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRoute, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_route(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00709", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00710", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_adapters;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00711", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_handler(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_handler_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_handler(items) == 6\n\ndef test_handler_empty_input():\n assert process_handler([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00712", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00713", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00714", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processClient(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ClientTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processClient(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00715", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processPipeline(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPipeline(t *testing.T) {\n got := processPipeline([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00716", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_module(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_module() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_module(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00717", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_invoice(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessInvoice, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_invoice(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00718", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00719", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_tokens;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00720", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_queue(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_queue_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_queue(items) == 6\n\ndef test_queue_empty_input():\n assert process_queue([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00721", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processWorker(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('worker', () => {\n it('handles a normal input set', () => {\n expect(processWorker(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00722", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00723", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processReport(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ReportTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processReport(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00724", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processProfile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessProfile(t *testing.T) {\n got := processProfile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00725", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_cart(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cart() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cart(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00726", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_order(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessOrder, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_order(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00727", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00728", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_jobs;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00729", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_event(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_event_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_event(items) == 6\n\ndef test_event_empty_input():\n assert process_event([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00730", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00731", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00732", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processRecord(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RecordTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRecord(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00733", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processMetric(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessMetric(t *testing.T) {\n got := processMetric([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00734", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_notification(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_notification() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_notification(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00735", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_task(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessTask, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_task(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00736", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00737", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_services;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00738", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_adapter(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_adapter_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_adapter(items) == 6\n\ndef test_adapter_empty_input():\n assert process_adapter([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00739", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00740", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00741", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processRepository(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RepositoryTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRepository(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00742", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processClient(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessClient(t *testing.T) {\n got := processClient([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00743", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_pipeline(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_pipeline() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_pipeline(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00744", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_module(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessModule, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_module(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00745", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00746", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_sessions;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00747", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_token(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_token_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_token(items) == 6\n\ndef test_token_empty_input():\n assert process_token([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00748", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00749", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processWorker(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('worker', () => {\n it('handles a normal input set', () => {\n expect(processWorker(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00750", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processParser(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ParserTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processParser(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00751", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processReport(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessReport(t *testing.T) {\n got := processReport([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00752", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_profile(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_profile() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_profile(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00753", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_cart(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessCart, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_cart(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00754", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00755", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_cache_keys;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00756", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_job(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_job_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_job(items) == 6\n\ndef test_job_empty_input():\n assert process_job([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00757", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00758", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00759", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processFile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass FileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processFile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00760", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processRecord(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRecord(t *testing.T) {\n got := processRecord([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00761", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_metric(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_metric() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_metric(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00762", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_notification(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessNotification, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_notification(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00763", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00764", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_routes;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00765", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_service(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_service_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_service(items) == 6\n\ndef test_service_empty_input():\n assert process_service([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00766", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00767", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00768", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processController(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ControllerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processController(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00769", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processRepository(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRepository(t *testing.T) {\n got := processRepository([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00770", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_client(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_client() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_client(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00771", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_pipeline(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPipeline, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_pipeline(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00772", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00773", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_invoices;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00774", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_session(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_session_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_session(items) == 6\n\ndef test_session_empty_input():\n assert process_session([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00775", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00776", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00777", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processWorker(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass WorkerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processWorker(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00778", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processParser(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessParser(t *testing.T) {\n got := processParser([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00779", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_report(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_report() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_report(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00780", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_profile(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessProfile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_profile(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00781", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00782", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_orders;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00783", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_cache_key(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cache_key_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cache_key(items) == 6\n\ndef test_cache_key_empty_input():\n assert process_cache_key([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00784", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00785", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processEvent(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('event', () => {\n it('handles a normal input set', () => {\n expect(processEvent(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00786", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processPayload(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PayloadTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPayload(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00787", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processFile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessFile(t *testing.T) {\n got := processFile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00788", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_record(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_record() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_record(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00789", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_metric(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessMetric, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_metric(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00790", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00791", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_tasks;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00792", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_route(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_route_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_route(items) == 6\n\ndef test_route_empty_input():\n assert process_route([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00793", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00794", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processAdapter(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('adapter', () => {\n it('handles a normal input set', () => {\n expect(processAdapter(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00795", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processHandler(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass HandlerTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processHandler(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00796", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processController(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessController(t *testing.T) {\n got := processController([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00797", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_repository(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_repository() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_repository(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00798", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_client(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessClient, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_client(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00799", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00800", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_modules;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00801", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_invoice(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_invoice_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_invoice(items) == 6\n\ndef test_invoice_empty_input():\n assert process_invoice([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00802", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00803", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processToken(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('token', () => {\n it('handles a normal input set', () => {\n expect(processToken(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00804", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processQueue(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass QueueTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processQueue(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00805", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processWorker(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessWorker(t *testing.T) {\n got := processWorker([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00806", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_parser(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_parser() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_parser(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00807", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_report(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessReport, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_report(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00808", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00809", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_carts;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00810", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_order(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_order_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_order(items) == 6\n\ndef test_order_empty_input():\n assert process_order([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00811", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00812", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processJob(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('job', () => {\n it('handles a normal input set', () => {\n expect(processJob(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00813", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processEvent(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass EventTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processEvent(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00814", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processPayload(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPayload(t *testing.T) {\n got := processPayload([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00815", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_file(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_file() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_file(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00816", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_record(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRecord, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_record(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00817", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00818", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_notifications;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00819", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_task(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_task_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_task(items) == 6\n\ndef test_task_empty_input():\n assert process_task([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00820", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00821", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processService(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('service', () => {\n it('handles a normal input set', () => {\n expect(processService(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00822", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processAdapter(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass AdapterTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processAdapter(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00823", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processHandler(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessHandler(t *testing.T) {\n got := processHandler([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00824", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_controller(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_controller() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_controller(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00825", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_repository(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRepository, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_repository(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00826", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00827", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_pipelines;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00828", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_module(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_module_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_module(items) == 6\n\ndef test_module_empty_input():\n assert process_module([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00829", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00830", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processSession(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('session', () => {\n it('handles a normal input set', () => {\n expect(processSession(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00831", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processToken(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TokenTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processToken(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00832", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processQueue(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessQueue(t *testing.T) {\n got := processQueue([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00833", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_worker(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_worker() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_worker(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00834", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_parser(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessParser, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_parser(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00835", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00836", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_profiles;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00837", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_cart(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_cart_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_cart(items) == 6\n\ndef test_cart_empty_input():\n assert process_cart([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00838", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00839", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processCache_Key(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cache_key', () => {\n it('handles a normal input set', () => {\n expect(processCache_Key(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00840", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processJob(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass JobTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processJob(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00841", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processEvent(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessEvent(t *testing.T) {\n got := processEvent([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00842", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_payload(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_payload() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_payload(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00843", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_file(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessFile, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_file(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00844", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00845", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_metrics;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00846", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_notification(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_notification_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_notification(items) == 6\n\ndef test_notification_empty_input():\n assert process_notification([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00847", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00848", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processRoute(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('route', () => {\n it('handles a normal input set', () => {\n expect(processRoute(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00849", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processService(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ServiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processService(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00850", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processAdapter(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessAdapter(t *testing.T) {\n got := processAdapter([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00851", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_handler(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_handler() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_handler(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00852", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_controller(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessController, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_controller(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00853", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00854", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_clients;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00855", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_pipeline(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_pipeline_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_pipeline(items) == 6\n\ndef test_pipeline_empty_input():\n assert process_pipeline([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00856", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00857", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processInvoice(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('invoice', () => {\n it('handles a normal input set', () => {\n expect(processInvoice(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00858", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processSession(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass SessionTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processSession(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00859", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processToken(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessToken(t *testing.T) {\n got := processToken([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00860", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_queue(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_queue() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_queue(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00861", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_worker(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessWorker, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_worker(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00862", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00863", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_reports;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00864", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_profile(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_profile_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_profile(items) == 6\n\ndef test_profile_empty_input():\n assert process_profile([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00865", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00866", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processOrder(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('order', () => {\n it('handles a normal input set', () => {\n expect(processOrder(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00867", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processCache_Key(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass Cache_KeyTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCache_Key(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00868", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processJob(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessJob(t *testing.T) {\n got := processJob([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00869", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_event(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_event() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_event(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00870", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_payload(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessPayload, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_payload(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00871", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00872", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_records;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00873", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_metric(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_metric_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_metric(items) == 6\n\ndef test_metric_empty_input():\n assert process_metric([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00874", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00875", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processTask(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('task', () => {\n it('handles a normal input set', () => {\n expect(processTask(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00876", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processRoute(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RouteTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRoute(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00877", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processService(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessService(t *testing.T) {\n got := processService([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00878", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_adapter(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_adapter() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_adapter(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00879", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_handler(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessHandler, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_handler(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00880", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00881", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_repositorys;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00882", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_client(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_client_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_client(items) == 6\n\ndef test_client_empty_input():\n assert process_client([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00883", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00884", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processModule(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('module', () => {\n it('handles a normal input set', () => {\n expect(processModule(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00885", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processInvoice(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass InvoiceTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processInvoice(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00886", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processSession(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessSession(t *testing.T) {\n got := processSession([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00887", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_token(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_token() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_token(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00888", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_queue(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessQueue, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_queue(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00889", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00890", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_parsers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00891", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_report(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_report_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_report(items) == 6\n\ndef test_report_empty_input():\n assert process_report([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00892", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00893", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processCart(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('cart', () => {\n it('handles a normal input set', () => {\n expect(processCart(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00894", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processOrder(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass OrderTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processOrder(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00895", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processCache_Key(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCache_Key(t *testing.T) {\n got := processCache_Key([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00896", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_job(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_job() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_job(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00897", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_event(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessEvent, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_event(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00898", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00899", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_files;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00900", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_record(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_record_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_record(items) == 6\n\ndef test_record_empty_input():\n assert process_record([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00901", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00902", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processNotification(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('notification', () => {\n it('handles a normal input set', () => {\n expect(processNotification(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00903", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processTask(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass TaskTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processTask(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00904", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processRoute(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessRoute(t *testing.T) {\n got := processRoute([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00905", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_service(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_service() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_service(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00906", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_adapter(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessAdapter, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_adapter(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00907", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00908", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_controllers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00909", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_repository(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_repository_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_repository(items) == 6\n\ndef test_repository_empty_input():\n assert process_repository([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00910", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00911", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processPipeline(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('pipeline', () => {\n it('handles a normal input set', () => {\n expect(processPipeline(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00912", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processModule(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ModuleTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processModule(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00913", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processInvoice(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessInvoice(t *testing.T) {\n got := processInvoice([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00914", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_session(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_session() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_session(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00915", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_token(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessToken, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_token(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00916", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00917", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_workers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00918", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_parser(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_parser_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_parser(items) == 6\n\ndef test_parser_empty_input():\n assert process_parser([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00919", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00920", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processProfile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('profile', () => {\n it('handles a normal input set', () => {\n expect(processProfile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00921", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processCart(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass CartTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processCart(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00922", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processOrder(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessOrder(t *testing.T) {\n got := processOrder([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00923", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_cache_key(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cache_key() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cache_key(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00924", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_job(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessJob, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_job(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00925", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00926", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_payloads;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00927", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_file(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_file_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_file(items) == 6\n\ndef test_file_empty_input():\n assert process_file([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00928", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00929", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the analytics domain.", + "code_under_test": "function processMetric(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('metric', () => {\n it('handles a normal input set', () => {\n expect(processMetric(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00930", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the notifications domain.", + "code_under_test": "public int processNotification(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass NotificationTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processNotification(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00931", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the reports domain.", + "code_under_test": "func processTask(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessTask(t *testing.T) {\n got := processTask([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00932", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the cache domain.", + "code_under_test": "fn process_route(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_route() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_route(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00933", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the scheduler domain.", + "code_under_test": "int process_service(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessService, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_service(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00934", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the uploads domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00935", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the webhooks domain.", + "code_under_test": "SELECT COUNT(*) FROM webhooks_handlers;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00936", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the profiles domain.", + "code_under_test": "def process_controller(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_controller_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_controller(items) == 6\n\ndef test_controller_empty_input():\n assert process_controller([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00937", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the checkout domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00938", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the inventory domain.", + "code_under_test": "function processClient(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('client', () => {\n it('handles a normal input set', () => {\n expect(processClient(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00939", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the recommendations domain.", + "code_under_test": "public int processPipeline(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass PipelineTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processPipeline(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00940", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the audit domain.", + "code_under_test": "func processModule(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessModule(t *testing.T) {\n got := processModule([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00941", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the logging domain.", + "code_under_test": "fn process_invoice(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_invoice() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_invoice(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00942", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the sync domain.", + "code_under_test": "int process_session(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessSession, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_session(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00943", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the streaming domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00944", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the exports domain.", + "code_under_test": "SELECT COUNT(*) FROM exports_queues;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00945", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the imports domain.", + "code_under_test": "def process_worker(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_worker_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_worker(items) == 6\n\ndef test_worker_empty_input():\n assert process_worker([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00946", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the payments domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00947", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the messaging domain.", + "code_under_test": "function processReport(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('report', () => {\n it('handles a normal input set', () => {\n expect(processReport(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00948", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the admin domain.", + "code_under_test": "public int processProfile(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ProfileTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processProfile(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00949", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the dashboard domain.", + "code_under_test": "func processCart(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessCart(t *testing.T) {\n got := processCart([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00950", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the billing domain.", + "code_under_test": "fn process_order(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_order() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_order(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00951", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the auth domain.", + "code_under_test": "int process_cache_key(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessCache_Key, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_cache_key(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00952", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the search domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00953", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the analytics domain.", + "code_under_test": "SELECT COUNT(*) FROM analytics_events;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00954", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the notifications domain.", + "code_under_test": "def process_payload(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_payload_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_payload(items) == 6\n\ndef test_payload_empty_input():\n assert process_payload([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00955", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the reports domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00956", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the cache domain.", + "code_under_test": "function processRecord(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('record', () => {\n it('handles a normal input set', () => {\n expect(processRecord(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00957", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the scheduler domain.", + "code_under_test": "public int processMetric(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass MetricTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processMetric(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00958", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the uploads domain.", + "code_under_test": "func processNotification(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessNotification(t *testing.T) {\n got := processNotification([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00959", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the webhooks domain.", + "code_under_test": "fn process_task(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_task() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_task(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00960", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the profiles domain.", + "code_under_test": "int process_route(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessRoute, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_route(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00961", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the checkout domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00962", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the inventory domain.", + "code_under_test": "SELECT COUNT(*) FROM inventory_adapters;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00963", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the recommendations domain.", + "code_under_test": "def process_handler(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_handler_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_handler(items) == 6\n\ndef test_handler_empty_input():\n assert process_handler([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00964", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the audit domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00965", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the logging domain.", + "code_under_test": "function processRepository(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('repository', () => {\n it('handles a normal input set', () => {\n expect(processRepository(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00966", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the sync domain.", + "code_under_test": "public int processClient(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ClientTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processClient(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00967", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the streaming domain.", + "code_under_test": "func processPipeline(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessPipeline(t *testing.T) {\n got := processPipeline([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00968", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the exports domain.", + "code_under_test": "fn process_module(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_module() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_module(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00969", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the imports domain.", + "code_under_test": "int process_invoice(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessInvoice, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_invoice(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00970", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the payments domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00971", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the messaging domain.", + "code_under_test": "SELECT COUNT(*) FROM messaging_tokens;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00972", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the admin domain.", + "code_under_test": "def process_queue(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_queue_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_queue(items) == 6\n\ndef test_queue_empty_input():\n assert process_queue([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00973", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the dashboard domain.", + "code_under_test": "function processWorker(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('worker', () => {\n it('handles a normal input set', () => {\n expect(processWorker(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the worker logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00974", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the billing domain.", + "code_under_test": "function processParser(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('parser', () => {\n it('handles a normal input set', () => {\n expect(processParser(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the parser logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00975", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the auth domain.", + "code_under_test": "public int processReport(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass ReportTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processReport(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the report logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00976", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the search domain.", + "code_under_test": "func processProfile(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessProfile(t *testing.T) {\n got := processProfile([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the profile logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00977", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the analytics domain.", + "code_under_test": "fn process_cart(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_cart() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_cart(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the cart logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00978", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the notifications domain.", + "code_under_test": "int process_order(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessOrder, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_order(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the order logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00979", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the reports domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the cache_key logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00980", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the cache domain.", + "code_under_test": "SELECT COUNT(*) FROM cache_jobs;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the job logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00981", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the scheduler domain.", + "code_under_test": "def process_event(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_event_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_event(items) == 6\n\ndef test_event_empty_input():\n assert process_event([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the event logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00982", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the uploads domain.", + "code_under_test": "function processPayload(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('payload', () => {\n it('handles a normal input set', () => {\n expect(processPayload(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the payload logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00983", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the webhooks domain.", + "code_under_test": "function processFile(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('file', () => {\n it('handles a normal input set', () => {\n expect(processFile(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the file logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00984", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the profiles domain.", + "code_under_test": "public int processRecord(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RecordTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRecord(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the record logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00985", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the checkout domain.", + "code_under_test": "func processMetric(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessMetric(t *testing.T) {\n got := processMetric([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the metric logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00986", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the inventory domain.", + "code_under_test": "fn process_notification(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_notification() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_notification(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the notification logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00987", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the recommendations domain.", + "code_under_test": "int process_task(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessTask, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_task(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the task logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00988", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the audit domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the route logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00989", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the logging domain.", + "code_under_test": "SELECT COUNT(*) FROM logging_services;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the service logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00990", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the sync domain.", + "code_under_test": "def process_adapter(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_adapter_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_adapter(items) == 6\n\ndef test_adapter_empty_input():\n assert process_adapter([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the adapter logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00991", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the streaming domain.", + "code_under_test": "function processHandler(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('handler', () => {\n it('handles a normal input set', () => {\n expect(processHandler(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the handler logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00992", + "category": "testing", + "language": "typescript", + "framework": "vitest", + "scenario": "Write tests for a TypeScript function used in the exports domain.", + "code_under_test": "function processController(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('controller', () => {\n it('handles a normal input set', () => {\n expect(processController(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use vitest to assert deterministic behavior and protect the controller logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00993", + "category": "testing", + "language": "java", + "framework": "JUnit", + "scenario": "Write tests for a Java function used in the imports domain.", + "code_under_test": "public int processRepository(List items) {\n int total = 0;\n for (String item : items) total += item.length();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import static org.junit.jupiter.api.Assertions.*;\nimport org.junit.jupiter.api.Test;\nimport java.util.List;\n\nclass RepositoryTest {\n @Test\n void shouldProcessItems() {\n assertEquals(6, processRepository(List.of(\"a\", \"bb\", \"ccc\")));\n }\n}", + "explanation": "Use JUnit to assert deterministic behavior and protect the repository logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00994", + "category": "testing", + "language": "go", + "framework": "testing", + "scenario": "Write tests for a Go function used in the payments domain.", + "code_under_test": "func processClient(items []string) int {\n total := 0\n for _, item := range items { total += len(item) }\n return total\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "package main\nimport \"testing\"\n\nfunc TestProcessClient(t *testing.T) {\n got := processClient([]string{\"a\", \"bb\", \"ccc\"})\n if got != 6 {\n t.Fatalf(\"expected 6, got %d\", got)\n }\n}", + "explanation": "Use testing to assert deterministic behavior and protect the client logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_00995", + "category": "testing", + "language": "rust", + "framework": "cargo test", + "scenario": "Write tests for a Rust function used in the messaging domain.", + "code_under_test": "fn process_pipeline(items: &[String]) -> usize {\n items.iter().map(|item| item.len()).sum()\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#[test]\nfn test_process_pipeline() {\n let data = vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")];\n assert_eq!(process_pipeline(&data), 6);\n}", + "explanation": "Use cargo test to assert deterministic behavior and protect the pipeline logic from regressions.", + "difficulty": 5 + }, + { + "id": "AITST_00996", + "category": "testing", + "language": "cpp", + "framework": "GoogleTest", + "scenario": "Write tests for a C++ function used in the admin domain.", + "code_under_test": "int process_module(const vector& items) {\n int total = 0;\n for (const auto& item : items) total += item.size();\n return total;\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#include \n\nTEST(ProcessModule, HandlesInput) {\n std::vector items = {\"a\", \"bb\", \"ccc\"};\n EXPECT_EQ(process_module(items), 6);\n}", + "explanation": "Use GoogleTest to assert deterministic behavior and protect the module logic from regressions.", + "difficulty": 1 + }, + { + "id": "AITST_00997", + "category": "testing", + "language": "bash", + "framework": "bats", + "scenario": "Write tests for a Bash function used in the dashboard domain.", + "code_under_test": "#!/usr/bin/env bash\nprintf '%s\\n' \"$1\" | tr -d ' ' | wc -c", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "#!/usr/bin/env bats\n\n@test \"counts characters\" {\n run ./script.sh \"abc\"\n [ \"$status\" -eq 0 ]\n}", + "explanation": "Use bats to assert deterministic behavior and protect the invoice logic from regressions.", + "difficulty": 2 + }, + { + "id": "AITST_00998", + "category": "testing", + "language": "sql", + "framework": "dbt tests", + "scenario": "Write tests for a SQL function used in the billing domain.", + "code_under_test": "SELECT COUNT(*) FROM billing_sessions;", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "-- Example dbt test\nselect *\nfrom my_table\nwhere id is null;", + "explanation": "Use dbt tests to assert deterministic behavior and protect the session logic from regressions.", + "difficulty": 3 + }, + { + "id": "AITST_00999", + "category": "testing", + "language": "python", + "framework": "pytest", + "scenario": "Write tests for a Python function used in the auth domain.", + "code_under_test": "def process_token(items):\n total = 0\n for item in items:\n total += len(str(item))\n return total", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "import pytest\n\ndef test_token_happy_path():\n items = [\"a\", \"bb\", \"ccc\"]\n assert process_token(items) == 6\n\ndef test_token_empty_input():\n assert process_token([]) == 0", + "explanation": "Use pytest to assert deterministic behavior and protect the token logic from regressions.", + "difficulty": 4 + }, + { + "id": "AITST_01000", + "category": "testing", + "language": "javascript", + "framework": "jest", + "scenario": "Write tests for a JavaScript function used in the search domain.", + "code_under_test": "function processQueue(items) {\n return items.map(item => String(item).trim()).filter(Boolean);\n}", + "testing_goal": "Validate the happy path, edge cases, and error handling.", + "test_code": "describe('queue', () => {\n it('handles a normal input set', () => {\n expect(processQueue(['a', 'bb'])).toEqual(['a', 'bb']);\n });\n});", + "explanation": "Use jest to assert deterministic behavior and protect the queue logic from regressions.", + "difficulty": 5 + } +] \ No newline at end of file