GitHub Copilot के साथ Software Development
Thalia Barrera
AI Engineering Curriculum Manager, DataCamp


def calculate_discount(price, discount_pct):
discount = price * (discount_pct / 100)
return price - discount
calculate_discount(50, 20) # → 40.0 ✓
लेकिन क्या होगा अगर...
pricediscount_pct > 100[screencast]
[screencast]

सीधे-सरल केस
/tests
खास केस
calculate_discount के लिए pytest यूनिट टेस्ट लिखें: negative price, 100% से बड़ा discount, और empty item list को कवर करें। एज केस के लिए parametrize का उपयोग करें।

/tests या एक सरल प्रॉम्प्ट
#file: से जोड़ें/fixTestFailure इस्तेमाल करें
checkout फ्लो के लिए integration tests लिखें।
#file:cart.pyऔर#file:payment.pyउपयोग करें। payment gateway को mock करें और सुनिश्चित करें कि order status सही से अपडेट होता है।
@workspace अपने-आप संबंधित कोड ढूँढ लेता है#terminalLastCommand का उपयोग करें
@workspaceयूज़र रजिस्ट्रेशन फ्लो के लिए Playwright end-to-end tests लिखें। जाँचें कि कन्फर्मेशन ईमेल ट्रिगर होता है।
[screencast]
GitHub Copilot के साथ Software Development