Mjukvaruutveckling med 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 ✓
Men vad händer med...
pricediscount_pct > 100[screencast]
[screencast]

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

/tests eller en enkel prompt
#file:/fixTestFailure om ett test går sönder
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 identifierar relevant kod automatiskt#terminalLastCommand för att felsöka
@workspaceWrite Playwright end-to-end tests for the user registration flow. Assert that the confirmation email is triggered.
[screencast]
Mjukvaruutveckling med GitHub Copilot