Question 420
A developer working in a governed organization reports, the following condition is confirmed: An input validator needs to reject excessively large payloads. What should the team do first?
Explanation
Correct Answer
Given that An input validator needs to reject excessively large payloads, choose "Add limit-boundary and overflow tests". Size constraints should be verified at exact thresholds. This targets the identified problem rather than a neighboring issue.
Incorrect Answers
"Test normalized paths containing traversal segments" targets A file path helper may permit parent-directory traversal. Boundary cases expose unsafe file access assumptions. That differs from An input validator needs to reject excessively large payloads; the required decision here is "Add limit-boundary and overflow tests". Size constraints should be verified at exact thresholds.
The alternative "Add forbidden-role assertions and expected HTTP status" fits another situation: A generated test covers authorized users but not rejected roles. Authorization is validated by negative outcomes. Here the condition is An input validator needs to reject excessively large payloads; use "Add limit-boundary and overflow tests" instead. Size constraints should be verified at exact thresholds.
The alternative "Add malformed and incomplete payload cases" addresses A parser test verifies one valid JSON payload only. Error-path tests establish defensive parsing behavior. It does not resolve An input validator needs to reject excessively large payloads; the correct choice is "Add limit-boundary and overflow tests". Size constraints should be verified at exact thresholds.