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 ✓
しかし、こんなケースは?
pricediscount_pct > 100[screencast]
[screencast]

単純なケース
/tests
特殊なケース
calculate_discount のpytestユニットテストを作成してください。対象:負の価格、割引率100%超、空アイテムリスト。エッジケースにはparametrizeを使用すること。

/tests またはシンプルなプロンプト
#file: で添付する/fixTestFailure を使用する
チェックアウトフローの統合テストを作成してください。
#file:cart.pyと#file:payment.pyを使用し、決済ゲートウェイをモックして、注文ステータスが正しく更新されることを検証すること。
@workspace が関連コードを自動検出#terminalLastCommand で失敗をデバッグ
@workspaceユーザー登録フローのPlaywright E2Eテストを作成してください。確認メールが送信されることを検証すること。
[screencast]
GitHub Copilot を使ったソフトウェア開発