انتقل إلى المحتوى
أمين أبوزيد
قيد المراجعةJNR-055-L02

طلبات بالسياق: الكود والقيود والأعراف

  • الدرس 2 من 6
  • 11 دقيقة قراءة
  • Junior
في هذا الدرس 4 موضوعات

محتوى هذا الدرس مكتوب وينتظر المراجعة. يعرض المخطط أدناه ما سيغطيه، وسيُنشر بعد اعتماده.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

write prompts that get useful answers.

الموضوعات المخطط لها

  • Give the relevant code, not the whole project.
  • State constraints: Java version, libraries allowed, no behavior change.
  • State conventions: naming, test style, formatting used by the team.
  • Say the expected result: "return a refactored method and a list of changes".
  • Ask for small steps, then check each one.
تفاصيل المخطط المبدئي

عرض عملي

text
Context: Java, Shop Core, CheckoutService.calculateTotal (code below).
Constraints: no behavior change; keep the public signature; no new libraries.
Conventions: JUnit 5, AssertJ, method names in camelCase.
Task: extract the discount block into a private method.
Result: the changed code only, plus one line per change.

اختبر فهمك

Name three things a good prompt includes.

أظهر الإجابة

Code, constraints, conventions, and the expected result: any three.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.