Software Development with 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 ✓
But what about...
pricediscount_pct > 100[screencast]
[screencast]

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

/tests or a simple prompt
#file:/fixTestFailure if a test breaks
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 discovers relevant code automatically#terminalLastCommand to debug failures
@workspaceWrite Playwright end-to-end tests for the user registration flow. Assert that the confirmation email is triggered.
[screencast]
Software Development with GitHub Copilot