Question 330
Copilot writes unit tests only for the successful insert path, omitting deadlock and rollback failures. The team implemented this change: Add failure-case tests and fault injection to the generated suite. Which result would best confirm the change worked?
Explanation
Correct Answer
Failed transactions leave no partial state and retries do not duplicate rows. Automated test generation needs negative paths and boundary conditions to validate database behavior. Test coverage percentages can miss important untested business invariants.
Incorrect Answers
Code coverage does not establish behavioral coverage of error conditions, concurrent writes, or invariants.
Compilation checks syntax and model bindings, not transaction safety under injected faults and retries.
A success-only result cannot prove uniqueness or rollback; require negative fixtures and stable idempotency checks.