Pengembangan Perangkat Lunak dengan GitHub Copilot
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 ✓
Namun bagaimana dengan...
price negatifdiscount_pct > 100[screencast]
[screencast]

Kasus sederhana
/tests
Kasus khusus
Write pytest unit tests for calculate_discount covering: negative price, discount > 100%, and empty item list. Use parametrize for edge cases.

/tests atau prompt sederhana
#file:/fixTestFailure jika tes gagal
Write integration tests for the checkout flow. Use
#file:cart.pyand#file:payment.py. Mock the payment gateway and assert that order status updates correctly.
@workspace otomatis menemukan kode relevan#terminalLastCommand untuk debug kegagalan
@workspaceTulis tes end-to-end Playwright untuk alur pendaftaran pengguna. Pastikan email konfirmasi terpicu.
[screencast]
Pengembangan Perangkat Lunak dengan GitHub Copilot