Skip to content
CodeKruPro

Write a defect report beyond the status code

15/32

02 · Build reusable requests and investigate results

Recommended first: Compare replacement, partial change and deletion

Your goal: Write a defect report beyond the status code

Follow one request at a time. Send it yourself, then select that response before you answer.

  1. 1Send requests
  2. 2Submit answers

Start here: sign in to practise.

Jump to practice

What you will learn

A defect is an observed difference from an agreed rule. The report needs the rule, the smallest request, and the actual result. HTTP 200 does not prove the body follows the rule.

Your goals

  • Separate a real rule break from a value that is allowed.
  • Record the status of one real request.

Before you start

Read the previous lesson first if you have not already. This course does not require programming.

Practice setup

These requests use the public TestKru teaching API. No workspace is needed unless a step says so. Leave the body empty for GET, HEAD and OPTIONS. Example people and emails are fictional. Changes to /api/users are simulated and are not saved.

Supplied training evidence / contract

Requirement R16: a product price must be a non-negative number. Faulty example F16: HTTP 200 {"id":1,"price":-10}. Allowed example D16: HTTP 200 {"id":2,"price":0}. Zero is allowed. Legacy probe L16: sending the name "0" is rejected by this teaching API. Cite L16 for that request. Do not invent a different rule.

Follow these steps

  1. Read R16, F16 and D16. Decide which example breaks the price rule and which example is allowed.
  2. Send POST https://testkru.com/api/users with Content-Type application/json and a body whose name is 0 and whose email is a fictional address. Select that response.
  3. Copy the status of that POST.
  4. Choose the faulty example and the allowed example.
  5. Submit Answers. A full report would also include the requirement id, the steps, and the impact. Use the self-review to draft that in your notes.

Investigate before concluding

First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.

What to keep as evidence

  • The negative price is the defect.
  • The zero price is not reported as a defect.
  • The POST status is copied from the selected response.
References for this lesson

Finish this assignment

Select each named response with Use this response. Answer from those responses or the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. Core checks are required to finish. Extra evidence checks are labelled. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.

If something goes wrong
  • Change one part of the request at a time. If a check needs attention, read the note under it and compare it with the response you selected.
Self-review and independent variation
  • The negative price is the defect.
  • The zero price is not reported as a defect.
  • The POST status is copied from the selected response.

Repeat the name test with the text 1 and compare the status.

Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.

Open API reference

Practise and save your evidence

The lesson is public. Sign in to send requests and save progress. You will return to this lesson.

Sign in to practiseCreate an account