Skip to content

Copilot agentにユニットテスト補完操作モードを追加#737

Merged
7474 merged 2 commits intomasterfrom
copilot/configure-unit-test-support
Feb 20, 2026
Merged

Copilot agentにユニットテスト補完操作モードを追加#737
7474 merged 2 commits intomasterfrom
copilot/configure-unit-test-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 20, 2026

移植進行と並行してCopilot agentが「ユニットテストを補完してください」指示でテスト作成を自律実行できるよう構成。テストはヘルプドキュメント(SRC.Sharp.Help/src/)記載の動作を期待値とする。

Copilot agent設定変更

autonomous-agent.md

  • @copilot ユニットテストを補完してください コマンドを移植を進行してくださいと同格の単一コマンドとして追加
  • タスク種別Eとして Unit Test Completion を実装エージェントプロトコルに追加(未テストコマンド特定→ヘルプ参照→テスト作成→齟齬報告→検証→結果報告)
  • テスト作成ガイドライン(ファイル配置、命名規則、コメント規約)とヘルプとの齟齬時の報告フォーマットを明記
  • 🧪 Unit Test Completion Protocol セクションを独立して追加

copilot-instructions-examples.md

  • 指示例16(全体補完)・17(特定コマンド)を追加
  • まとめに「ユニットテスト補完」を追記

テスト追加(動作実証)

SwitchDoLoopCmdTests.cs を新規作成(14テストケース、全件パス)。ヘルプ記載の期待値に基づく構成例:

// ヘルプ: 一つのCase文に複数のvalueを設定することもできます
[TestMethod]
public void SwitchCmd_MultipleCaseValues_MatchesAny()
{
    src.Expression.SetVariableAsString("emotion", "友");
    var cmds = BuildEvent(src,
        "Switch emotion",    // ID=0
        "Case 同 友",        // ID=1: matches "友"
        "Set result \"いい心がけ\"", // ID=2
        "EndSw"              // ID=3
    );
    RunEvent(src, cmds);
    Assert.AreEqual("いい心がけ", src.Expression.GetValueAsString("result"));
}

// ヘルプ書式2: Do / Loop While は条件に関わらず1回は実行される
[TestMethod]
public void DoLoopWhileCmd_ExecutesAtLeastOnce() { ... }

調査範囲内でヘルプ記載と実装の間に重大な齟齬なし。なお Sort 降順 の数値インデックス配列への適用は、ヘルプ例(文字列インデックスのみ)との照合が不完全なため要確認。


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: 7474 <4744735+7474@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure Copilot agent to accept unit test completions Copilot agentにユニットテスト補完操作モードを追加 Feb 20, 2026
Copilot AI requested a review from 7474 February 20, 2026 16:23
@7474 7474 marked this pull request as ready for review February 20, 2026 16:25
@github-actions
Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-coast-005428600-737.eastasia.azurestaticapps.net

@7474 7474 merged commit 2911aef into master Feb 20, 2026
6 of 7 checks passed
@7474 7474 deleted the copilot/configure-unit-test-support branch February 20, 2026 16:28
@7474 7474 temporarily deployed to SRC#DataViewer dev February 20, 2026 16:28 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants