Lesson 4 of 12 intermediate

Specifications and a full-stack vertical slice

আগে ঠিক করো কী হলে কাজটা সঠিক। তারপর mobile, API আর review screen একই নিয়ম মানবে।

Guess first

Pick an answer. You will see if you were right at the end of the lesson.

What if the first request succeeded but its response was lost?

Open interactive version (quiz + challenge)

Real-world analogy

Agree on a delivery receipt format before the shop, driver and customer each build a different one.

What is it?

A specification captures behaviour before implementation. A vertical slice connects a small user action through UI, storage and backend. It reveals contract mistakes earlier than building all screens first. Specifications do not need to predict every edge case; update them when new evidence appears.

Real-world relevance

One shared support-ticket product, three optional entry points. Frontend: Specify loading, empty, error and success states, keyboard access and double-submit behaviour. Backend: Specify schema validation, authorisation, idempotency and error response contracts. Mobile: Specify offline persistence, reconnect retries, app restart and stale response handling.

Key points

Quick check

Answer from memory — scrolling up first makes it stick less.

What artifact demonstrates this lesson?

Which statement is defensible?

Code example

Feature: idempotent ticket sync
Given request key K was saved successfully
When the client retries K after losing the response
Then the backend returns the same ticket id
And it does not create a second ticket
And a different user cannot retrieve that ticket

Line-by-line walkthrough

  1. 1. This is a behaviour specification, not executable Gherkin without a test runner. Implement a unique key and ownership check in the backend, then an integration test.

Spot the bug

On timeout: generate a new request key and retry
Need a hint?
What if the first request succeeded but its response was lost?
Show answer
Persist one key per user operation and reuse it across retries.

Explain like I'm 5

আগে ঠিক করো কী হলে কাজটা সঠিক। তারপর mobile, API আর review screen একই নিয়ম মানবে।

Fun fact

A useful artifact for this lesson: Capture an offline ticket, reconnect, sync it once and display pending review.

Hands-on challenge

Choose ONE stack; you do not need to build all three. Junior foundation: Write three acceptance cases and build one success path against a fixture. Senior extension: Cover retries, ownership, state transitions and compatibility with contract tests. Evidence: save the input, expected behaviour, actual result and one failure or limitation. Junior means basic coding and Git, not zero programming experience.

More resources

Open interactive version (quiz + challenge) Download the whole course as PDF / Word

Lock it in

← Back to course: AI-Assisted Software Engineering