Phát triển phần mềm với 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 ✓
Nhưng còn...
price âmdiscount_pct > 100[screencast]
[screencast]

Trường hợp đơn giản
/tests
Trường hợp đặc biệt
Write pytest unit tests for calculate_discount covering: negative price, discount > 100%, and empty item list. Use parametrize for edge cases.

/tests hoặc prompt đơn giản
#file:/fixTestFailure khi test hỏng
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 tự tìm mã liên quan#terminalLastCommand để debug lỗi
@workspaceWrite Playwright end-to-end tests for the user registration flow. Assert that the confirmation email is triggered.
[screencast]
Phát triển phần mềm với GitHub Copilot