What this template isما هذا القالب
The unit's standard use case format: thirteen headers covering actors, pre/post-conditions, the main flow, every alternative and exception flow, data specifications with validation rules, UI elements and NFRs — detailed enough that development and QC need nothing else.صيغة حالة الاستخدام المعتمدة في الوحدة: ثلاثة عشر بنداً تغطي الفاعلين والشروط القبلية والبعدية والتدفق الرئيسي وكل تدفق بديل واستثنائي ومواصفات البيانات بقواعد التحقق وعناصر الواجهة والمتطلبات غير الوظيفية — بتفصيل يكفي التطوير والجودة دون أي شيء آخر.
When to use itمتى تستخدمه
- Specifying system behaviour with meaningful flows and business rulesتوصيف سلوك النظام بتدفقات وقواعد عمل ذات معنى
- Handing a feature to development and QC as one self-contained specتسليم ميزة للتطوير والجودة كمواصفة واحدة مكتفية بذاتها
- Complex screens where validation and exceptions carry the real logicالشاشات المعقدة حيث تحمل قواعد التحقق والاستثناءات المنطق الحقيقي
Document structureهيكل الوثيقة
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- Use a stable ID scheme (UC-xx) and a verb-object name from the actor's goal.استخدم ترميزاً ثابتاً (UC-xx) واسماً بصيغة فعل-مفعول من هدف الفاعل.
- Keep one goal per use case — one actor achieving one outcome.اجعل لكل حالة استخدام هدفاً واحداً — فاعل واحد يحقق نتيجة واحدة.
- Record version and owner on the case itself.سجّل الإصدار والمالك على الحالة نفسها.
- Don't name cases after screens ("Invoice screen") — name the goal ("Allocate receipt").لا تسمِّ الحالات بأسماء شاشات («شاشة الفواتير») — سمِّ الهدف («تخصيص مقبوض»).
- Don't renumber IDs after test cases start referencing them.لا تعد ترقيم المعرفات بعد أن تبدأ حالات الاختبار بالإحالة إليها.
- Don't create a use case for every CRUD click — group trivial maintenance.لا تنشئ حالة لكل نقرة إدخال وتعديل — جمّع الصيانة البسيطة.
"UC-07 — Manually Allocate Unmatched Receipt (owner: BA team, v1.1) — the reconciliation officer allocates a receipt the engine could not match."«UC-07 — التخصيص اليدوي لمقبوض غير مطابق (المالك: فريق التحليل، v1.1) — يخصص موظف المطابقة مقبوضاً عجز المحرك عن مطابقته.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- Summarise the goal and business value in 2–3 sentences.لخّص الهدف وقيمته للعمل في جملتين أو ثلاث.
- State the system boundary — what this case includes and which UCs continue it.حدد حدود النظام — ما تشمله الحالة وأي الحالات تكملها.
- Mention frequency and criticality — reviewers prioritise by them.اذكر التكرار ودرجة الحرجية — فبهما يرتب المراجعون الأولوية.
- Don't retell the whole main flow here.لا تعد سرد التدفق الأساسي كاملاً هنا.
- Don't blur scope with neighbouring cases — cross-reference them instead.لا تُذوّب النطاق مع الحالات المجاورة — اربطها بإحالة بدلاً من ذلك.
- Don't skip the business value — a case with no value is a candidate to delete.لا تُغفل قيمة العمل — حالة بلا قيمة مرشحة للحذف.
"Covers manual allocation of the ~6% of receipts auto-matching cannot resolve (~540/month). Excludes bulk re-processing (UC-09). Critical: unallocated cash blocks customer credit release."«تغطي التخصيص اليدوي لنحو 6% من المقبوضات التي لا يحسمها المحرك (~540 شهرياً). ولا تشمل إعادة المعالجة الجماعية (UC-09). حرجة: النقد غير المخصص يجمّد إطلاق ائتمان العملاء.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- Name the primary actor by role and every secondary/system actor.سمِّ الفاعل الرئيس بدوره وكل فاعل ثانوي أو نظامي.
- Use the same actor names across all use cases — keep one actor glossary.استخدم أسماء الفاعلين نفسها عبر كل الحالات — مسرد فاعلين واحد.
- State each actor's needed permission level.اذكر مستوى الصلاحية المطلوب لكل فاعل.
- Don't use department names or personal names as actors.لا تستخدم أسماء إدارات أو أشخاص فاعلين.
- Don't forget system actors (the ERP, the scheduler) — they carry interfaces.لا تنسَ الفاعلين النظاميين (نظام الموارد، المجدول) — فهم يحملون الواجهات.
- Don't mix the approver into a case whose actor is the requester — that's a second case or an extension.لا تُقحم المعتمد في حالة فاعلها مقدّم الطلب — تلك حالة ثانية أو امتداد.
"Primary: Reconciliation Officer (allocation permission). Secondary: Treasury Supervisor (approves above SAR 50K), ERP AR module (posts the allocation)."«الرئيس: موظف المطابقة (صلاحية تخصيص). الثانوي: مشرف الخزينة (يعتمد ما فوق 50 ألف ريال)، ووحدة الذمم في نظام الموارد (تُقيّد التخصيص).»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- List only states that must be true BEFORE the trigger — and are checkable.اذكر فقط الحالات الواجب تحققها قبل الزناد — والقابلة للفحص.
- Phrase each as a verifiable state, not an activity.صُغ كلاً منها حالة يمكن التحقق منها، لا نشاطاً.
- Reference the UC or process that establishes each pre-condition.أحِل إلى الحالة أو العملية التي تُنشئ كل شرط مسبق.
- Don't list obvious platform facts ("system is running").لا تذكر بدهيات المنصة («النظام يعمل»).
- Don't hide business rules here — rules govern the flow, not the entry.لا تُخفِ قواعد العمل هنا — القواعد تحكم التدفق لا الدخول.
- Don't write pre-conditions the actor cannot know or check.لا تكتب شروطاً لا يستطيع الفاعل معرفتها أو فحصها.
"1) The receipt exists with status Unmatched (from UC-03 ingestion). 2) The officer holds the allocation permission. 3) The invoice register is current as of last night."«1) المقبوض قائم بحالة غير مطابق (من حالة الاستقبال UC-03). 2) الموظف يملك صلاحية التخصيص. 3) سجل الفواتير محدّث حتى ليلة أمس.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- State the success end-state AND the failure end-states.اذكر حالة النهاية عند النجاح وحالات النهاية عند الفشل.
- Describe post-conditions as data/state changes an auditor could verify.صِف النواتج تغييرات بيانات وحالات يستطيع مدقق التحقق منها.
- Note side effects: notifications sent, logs written, downstream postings.دوّن الآثار الجانبية: الإشعارات المرسلة والسجلات المكتوبة والقيود اللاحقة.
- Don't promise outcomes the flow doesn't produce.لا تعد بنواتج لا ينتجها التدفق.
- Don't omit the "minimal guarantee" when the case fails midway.لا تُغفل «الضمان الأدنى» عند فشل الحالة في منتصفها.
- Don't restate the main flow's last step as the post-condition.لا تعد صياغة آخر خطوة في التدفق شرطاً لاحقاً.
"Success: receipt Matched, allocation posted to ERP, audit entry written. Failure guarantee: receipt remains Unmatched, no partial posting, attempt logged."«النجاح: المقبوض مطابق والتخصيص مقيّد في نظام الموارد وقيد التدقيق مكتوب. ضمان الفشل: يبقى المقبوض غير مطابق، لا قيد جزئياً، والمحاولة مسجلة.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- State the single event that starts the flow — user action, time, or message.حدد الحدث الواحد الذي يبدأ التدفق — فعل مستخدم أو وقت أو رسالة.
- Distinguish the trigger from the pre-conditions around it.ميّز الزناد عن الشروط المسبقة المحيطة به.
- For time/message triggers, state source and frequency.لزناد الوقت أو الرسائل، اذكر المصدر والتكرار.
- Don't list several triggers — that usually means several use cases.لا تذكر عدة زنادات — فذلك غالباً يعني عدة حالات.
- Don't write vague triggers ("when needed").لا تكتب زنادات مبهمة («عند الحاجة»).
- Don't confuse the trigger with the actor's goal.لا تخلط الزناد بهدف الفاعل.
"Trigger: the officer opens an item from the Unmatched Receipts queue (typically each morning after the 07:30 ingestion run)."«الزناد: يفتح الموظف عنصراً من طابور المقبوضات غير المطابقة (عادة كل صباح بعد تشغيلة الاستقبال 07:30).»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- Number the steps and alternate actor action ↔ system response.رقّم الخطوات وناوب بين فعل الفاعل واستجابة النظام.
- Keep it the SUCCESS path only — 5 to 12 steps.أبقه مسار النجاح فقط — من 5 إلى 12 خطوة.
- Mark the branch points where alternatives/exceptions fork (at step 4 → Alt 4a).علّم نقاط التفرع حيث تنشعب البدائل والاستثناءات (عند الخطوة 4 ← البديل 4أ).
- Don't embed if/else inside the main flow — that's what Alt/Exc flows are for.لا تضمّن إن/وإلا داخل التدفق الأساسي — لهذا وُجدت التدفقات البديلة والاستثنائية.
- Don't describe UI mechanics ("clicks the blue button") — describe intent.لا تصف ميكانيكا الشاشة («ينقر الزر الأزرق») — صِف القصد.
- Don't skip the system's confirmations — testers assert on them.لا تتجاوز تأكيدات النظام — فعليها يبني المختبرون تحققهم.
"1 Officer opens the unmatched receipt. 2 System shows candidate invoices ranked by amount/date. 3 Officer selects invoice(s). 4 System validates totals [Alt 4a partial]. 5 Officer confirms. 6 System posts, marks Matched, logs."«1 يفتح الموظف المقبوض غير المطابق. 2 يعرض النظام الفواتير المرشحة مرتبة بالمبلغ والتاريخ. 3 يختار الموظف الفاتورة/الفواتير. 4 يتحقق النظام من الإجماليات [البديل 4أ جزئي]. 5 يؤكد الموظف. 6 يُقيّد النظام ويحوّل الحالة إلى مطابق ويسجّل.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- Give each alternative an ID tied to its branch step (Alt 4a) and a name.أعطِ كل بديل معرفاً مرتبطاً بخطوة تفرعه (البديل 4أ) واسماً.
- State where the alternative rejoins the main flow (or ends the case).بيّن أين يعود البديل للتدفق الأساسي (أو ينهي الحالة).
- Cover the legitimate variations: partial allocation, multiple invoices, on-account.غطِّ التنويعات المشروعة: التخصيص الجزئي وتعدد الفواتير والدفع تحت الحساب.
- Don't put failures here — failures are exceptions, not alternatives.لا تضع الإخفاقات هنا — فهي استثناءات لا بدائل.
- Don't leave an alternative without its rejoin/exit point.لا تترك بديلاً بلا نقطة عودة أو خروج.
- Don't duplicate main-flow steps inside the alternative — start from the branch.لا تكرر خطوات التدفق الأساسي داخل البديل — ابدأ من نقطة التفرع.
"Alt 4a — Partial allocation: amounts differ; officer allocates part and leaves remainder on-account with a reason code; rejoin at step 5."«البديل 4أ — تخصيص جزئي: المبالغ مختلفة؛ يخصص الموظف جزءاً ويُبقي الباقي تحت الحساب برمز سبب؛ ويعود عند الخطوة 5.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- Cover system failures and business rejections separately, each with its recovery.غطِّ أعطال النظام والرفض النظامي كلاً على حدة مع سبيل التعافي.
- State what the user sees, what is logged, and the guaranteed end-state.بيّن ما يراه المستخدم وما يُسجَّل وحالة النهاية المضمونة.
- Reference the business rule that fires each rejection (BR ref).أحِل إلى قاعدة العمل التي تطلق كل رفض.
- Don't write "system shows an error" — specify which and what next.لا تكتب «يعرض النظام خطأ» — حدد أيّه وما التالي.
- Don't leave exceptions dead-ended without recovery or escalation.لا تترك الاستثناءات طرقاً مسدودة بلا تعافٍ أو تصعيد.
- Don't hide the most instructive cases — reviewers learn most from exceptions.لا تُخفِ أكثر الحالات تعليماً — من الاستثناءات يتعلم المراجعون أكثر.
"Exc 6a — ERP posting fails: system keeps receipt Suspended, queues retry ×3, alerts the supervisor after the third failure; officer sees 'sent for posting — pending confirmation'."«الاستثناء 6أ — فشل القيد في نظام الموارد: يُبقي النظام المقبوض معلّقاً ويعيد المحاولة ثلاثاً وينبّه المشرف بعد الثالثة؛ ويرى الموظف «أُرسل للقيد — بانتظار التأكيد».»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- Number rules (BR-UC07-01) and reference them from the steps they govern.رقّم القواعد (BR-UC07-01) وأحِل إليها من الخطوات التي تحكمها.
- Write each rule as a decision the system can evaluate.اكتب كل قاعدة قراراً يستطيع النظام تقييمه.
- Record the rule's source and owner — who can change it.سجّل مصدر القاعدة ومالكها — من يملك تغييرها.
- Don't bury rules inside flow steps where testers will miss them.لا تدفن القواعد داخل خطوات التدفق حيث يفوّتها المختبرون.
- Don't state rules twice with different thresholds — one rule, one home.لا تذكر القاعدة مرتين بحدّين مختلفين — قاعدة واحدة وموطن واحد.
- Don't encode tomorrow's exceptions as today's rules — keep rules current.لا ترمّز استثناءات الغد قواعد اليوم — أبقِ القواعد بحاضرها.
"BR-UC07-02 (owner: Head of Collections): manual allocations above SAR 50,000 require supervisor approval before posting."«BR-UC07-02 (المالك: مدير التحصيل): التخصيصات اليدوية فوق 50,000 ريال تتطلب اعتماد المشرف قبل القيد.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- List the fields the case reads and writes, with type, mandatory flag and validation.اذكر الحقول التي تقرؤها الحالة وتكتبها، مع النوع والإلزامية والتحقق.
- State default values and where each field's list of values comes from.حدد القيم الافتراضية ومصدر قائمة قيم كل حقل.
- Mark fields that feed the audit trail or downstream postings.علّم الحقول التي تغذي سجل التدقيق أو القيود اللاحقة.
- Don't repeat the whole data dictionary — only this case's fields.لا تكرر قاموس البيانات كاملاً — حقول هذه الحالة فقط.
- Don't leave validation as "as per business" — name the rule.لا تترك التحقق «حسب العمل» — سمِّ القاعدة.
- Don't invent field names that differ from the SRS data section.لا تبتكر أسماء حقول تخالف قسم البيانات في وثيقة SRS.
"Reason Code: mandatory on partial allocation; list maintained by finance (8 values); written to the audit trail and to the ERP posting memo."«رمز السبب: إلزامي عند التخصيص الجزئي؛ قائمته تديرها المالية (8 قيم)؛ يُكتب في سجل التدقيق ومذكرة القيد في نظام الموارد.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- List screens/components the case touches and their key states (empty, loading, error).اذكر الشاشات والمكوّنات التي تمسها الحالة وحالاتها الرئيسة (فارغة، تحميل، خطأ).
- Reference wireframes/prototypes by ID instead of describing pixels.أحِل إلى المخططات أو النماذج بمعرفاتها بدل وصف التفاصيل البصرية.
- Note bilingual and RTL requirements where they bite (numbers, dates, alignment).دوّن متطلبات اللغتين والاتجاه حيث تؤثر (الأرقام والتواريخ والمحاذاة).
- Don't lock visual design here — this is scope, not styling.لا تُقفل التصميم البصري هنا — هذا نطاق لا تنسيق.
- Don't forget the empty and error states — they are half the build.لا تنسَ حالتي الفراغ والخطأ — فهما نصف البناء.
- Don't reference screens that no longer exist in the prototype.لا تُحِل إلى شاشات لم تعد موجودة في النموذج.
"Screens: Unmatched Queue (WF-11), Allocation Workspace (WF-12: candidates panel, split-allocation grid, approval banner). Empty state: 'queue clear' with last-run time."«الشاشات: طابور غير المطابق (WF-11)، ومساحة التخصيص (WF-12: لوحة المرشحات وشبكة التقسيم وشريط الاعتماد). حالة الفراغ: «الطابور خالٍ» مع وقت آخر تشغيلة.»
How to write it — do · don’t · exampleكيف تكتبه — افعل · لا تفعل · مثال
- State case-specific NFRs only: response, volume at peak, permissions.اذكر المتطلبات غير الوظيفية الخاصة بالحالة فقط: الاستجابة وذروة الحجم والصلاحيات.
- Log open issues with an owner and a due date each.سجّل النقاط المفتوحة بمالك وتاريخ استحقاق لكل منها.
- Close the loop: issues resolved move into the flows, not stay parked.أغلق الدائرة: ما يُحسم من النقاط ينتقل إلى التدفقات ولا يبقى مركوناً.
- Don't restate global NFRs from the SRS.لا تعد ذكر المتطلبات غير الوظيفية العامة من وثيقة SRS.
- Don't let open issues age without owners — an ownerless issue is a risk.لا تدع النقاط المفتوحة تشيخ بلا مالك — نقطة بلا مالك خطرٌ.
- Don't baseline the use case while a blocking issue is open.لا تعتمد الحالة خط أساس ونقطة حاجبة ما زالت مفتوحة.
"NFR: candidate list returns in <2s for a payer with 500 open invoices. Open: OI-3 — does on-account require a customer notification? Owner: Head of Collections, due 15 Jul."«غير وظيفي: قائمة المرشحات تعود في أقل من ثانيتين لدافع له 500 فاتورة مفتوحة. مفتوح: OI-3 — هل يستلزم الدفع تحت الحساب إشعار العميل؟ المالك: مدير التحصيل، الاستحقاق 15 يوليو.»
Practitioner tipsنصائح الممارسين
- Every exception flow ends in a defined state — 'show error' without the resulting state is half a flow.كل تدفق استثنائي ينتهي بحالة معرّفة — «إظهار خطأ» دون الحالة الناتجة نصف تدفق.
- The data-spec table is where QC lives; write the error message text, not 'system validates'.جدول مواصفات البيانات هو مسكن الجودة؛ اكتب نص رسالة الخطأ لا «يتحقق النظام».
- Number alternative flows AF-n.m against the main-flow step they branch from.رقّم التدفقات البديلة AF-n.m مقابل خطوة التدفق الرئيسي التي تتفرع منها.