Skip to content
Testing & QualityChapter 48 / 57Beginner5 min read

Definition of Done

Definition of done checklist jo batati hai ke kaam kab sach mein khatam hai, typecheck, tests, migrations, env, docs, screenshot aur review tak.

On this page

1. Yeh practice kya hai?

Definition of Done (DoD) ek choti si list hai jo poori team ke liye ek hi hoti hai. Har pull request isi ke against check hoti hai. Is se "done" ka matlab har insaan ke liye barabar ho jata hai.

2. Kyun zaroori hai?

Bina likhi list ke har developer ka "done" alag hota hai. Ek ke liye feature ka screen par aana done hai, doosre ke liye tests ke saath merge hona. Farq baad mein bug, broken deploy aur "yeh kis ne kiya?" ban kar nikalta hai.

Mere machine par chal gayaDefinition of done ke saath
Typecheck sirf editor ne dekhaTypecheck, lint, format CI mein green
Success path haath se test kiyaSuccess, validation aur auth failure ke tests
Naya env variable yaad mein.env.example mein naam aur note
Migration ek dafa chaliMigration do dafa chal kar bhi theek
Reviewer screen khud chala kar dekheScreenshot ya recording PR mein
Khud hi approve kar diyaKisi aur ne approve kiya

3. Kab follow karein?

LevelKitna zarooriKyun
Learning projectChhoti list: typecheck, lint, ek test, README"Khatam" ki aadat yahin banti hai
Production codePoori list, PR template mein checkboxesHar missing item production bug ban sakta hai
Senior levelList ko CI mein automate karnaJo machine check kar sake, us par insaan ka waqt na lage

4. Bura vs acha code

Bura: PR description

bash
added the export feature. done, pls review

Reviewer ko nahi pata kya test hua, kya env chahiye, kya migration hai.

Acha: PR description

bash
add csv export for invoices

why: accountants export invoices by hand every month

how tested:
  npm run typecheck, lint and tests pass
  endpoint tests: success, invalid date range (422), invoice of another org (404)
  migration applied twice locally, second run is a no-op
  screenshot of the export button attached

new env: EXPORT_BUCKET (exports fail with 503 without it)
docs: docs/knowledge/exports.md updated

Farq kya hai?

CheezBuraAcha
TestsPata nahiKaun se cases, saaf likha
EnvChhupa huaNaam aur us ke bina kya tootega
MigrationShayadIdempotent, do dafa chali
ReviewReviewer khud dhoondheSab saamne

5. Kaise apply karein?

Yeh checklist PR template mein checkboxes ki shakal mein rakhein:

#ItemKyun
1Typecheck, lint aur format locally aur CI mein passBasic bugs aur style behas khatam
2Har naye ya badle endpoint ke success, validation aur auth failure testsContract aur security sabit
3Har badli hui branching wali pure function ka unit testLogic ke edge cases
4Migration us database par do dafa chali jahan pehle se lagi thiRe-run par crash nahi
5Generated database types regenerate aur commitCode aur schema ek jaise
6Naya env variable .env.example mein, note ke saathAgla deploy na toote
7Behaviour badla to docs updateDocs jhoot na bolein
8UI change ho to screenshot ya short recordingReviewer ko dikhe kya bana
9Author ke ilawa kisi aur ka approvalDoosri nazar
Done tak ka rasta
Code likha
Local par typecheck, lint, tests
Migration, types, env, docs check
PR template ki checklist bhari
CI green
Kisi aur ka approval
Done

6. Exceptions aur common mistakes

Kab rule nahi lagta: jo item lagu nahi hota woh skip hota hai, lekin likh kar: "no migration", "no UI change". Spike ya prototype jo merge nahi hoga, us par poori list zaroori nahi. Lekin agar woh code baad mein main mein jaye to list wahin se lagti hai.

Galati: Checkbox tick karna bina chalaye

Why? Checklist ka faida sirf tab hai jab woh sach ho, jhoota tick koi safety nahi deta.

Behtar: Jo item check nahi kiya, usay khaali chhorein aur wajah likhein.

Galati: Tests sirf happy path ke

Why? Zyada tar bugs aur security holes failure paths mein hote hain.

Behtar: Har endpoint ke liye validation aur auth failure ke tests bhi likhein.

Galati: Docs ko alag ticket bana dena

Why? Woh ticket kabhi nahi hota aur docs purane ho jate hain.

Behtar: Behaviour badalne wale PR mein hi docs update karein.

7. Pehle aur baad mein kya seekhein?

Final quick revision

CheckHaan?
Typecheck, lint, format green
Endpoint tests teeno paths
Migration idempotent
Types regenerated
.env.example updated
Docs updated
Screenshot attached
Doosre ka approval