testing-anti-patterns
モックのアンチパターンを避けてテストを改善する
質の低いテストは、実際のアプリケーションの振る舞いではなくモックを検証してしまうことがよくあります。このスキルは、Claude、Codex、Claude Code に、より安全な TDD、焦点を絞ったモック、よりクリーンなテスト設計のためのチェックリストを提供します。
インストール前に停止して確認を求めてください。
計画を確認し、ファイルを変更する前にユーザーの明示的な同意を得てください。
自分のエージェントでインストール
このリクエストをエージェントにコピーしてください。正規の Skill ページとマニフェストが含まれています。
Review the Skillstore skill "testing-anti-patterns" from https://skillstore.io/skills/dyai2025-testing-anti-patterns.md and its manifest at https://skillstore.io/api/skills/dyai2025-testing-anti-patterns/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.エージェントは引き続き計画を提示し、セキュリティポリシーで必要な確認を求める必要があります。
エージェントが読めるリソース
AI エージェント、クローラー、スクリプトがページ全体ではなく整理されたコンテキストを必要とする場合は、これらのリンクを使ってください。
テストする
「testing-anti-patterns」を使用しています。 テストが、ページをレンダリングした後に sidebar-mock が存在することをアサートしている。
期待される結果:
そのテストはページの振る舞いではなく、モックを検証しています。実際のサイドバーをレンダリングするか、ユーザーに見えるナビゲーションの振る舞いをアサートすることを推奨します。
「testing-anti-patterns」を使用しています。 Session クラスに、テストがワークスペースをクリーンアップするためだけに destroy メソッドが追加されている。
期待される結果:
これはテスト上の必要性による本番コードの汚染です。Session が本番環境でそのライフサイクルを所有していない限り、クリーンアップはテストユーティリティへ移動してください。
「testing-anti-patterns」を使用しています。 重複検出テストが、設定状態を書き込むメソッドをモックしている。
期待される結果:
そのモックは、テストが依存している副作用を取り除いています。より下位レベルの遅い依存関係をモックするか、必要な振る舞いを確認するために先に実際のメソッドを実行してください。
セキュリティ監査
安全Most static findings are false positives caused by Markdown code fences and TypeScript examples in SKILL.md. No prompt injection, malicious intent, command execution instruction, or network reconnaissance was found in the reviewed text; the remaining confirmed issue is the unscanned SKILL.zip archive.
リスク要因
⚙️ 外部コマンド (30)
このレポートを共有・引用
バージョン付き評価レポート、中立的なバッジ、埋め込みカード、引用を共有できます。Skillstore は証拠を報告しますが、この Skill が安全かどうかは判断しません。
レポートリンクをコピー
https://skillstore.io/skills/dyai2025-testing-anti-patterns/audits/10?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdownバッジ
[](https://skillstore.io/skills/dyai2025-testing-anti-patterns?utm_source=security_passport_badge)HTMLバッジ
<a href="https://skillstore.io/skills/dyai2025-testing-anti-patterns?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/dyai2025-testing-anti-patterns/security.svg" alt="Skillstore security assessment" loading="lazy"></a>埋め込みカード
<iframe src="https://skillstore.io/embed/skills/dyai2025-testing-anti-patterns.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学術引用 (APA · BibTeX · CFF)
APA形式の引用
DYAI2025. (2026). testing-anti-patterns security audit report (audit version 10) [Author version unspecified]. Skillstore. https://skillstore.io/skills/dyai2025-testing-anti-patterns/audits/10BibTeX形式の引用
@techreport{dyai2025-dyai2025-testing-anti-patterns-2026,
author = {DYAI2025},
title = {testing-anti-patterns security audit report (audit version 10)},
institution = {Skillstore},
year = {2026},
number = {10},
url = {https://skillstore.io/skills/dyai2025-testing-anti-patterns/audits/10},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "testing-anti-patterns security audit report (audit version 10)"
version: "unspecified"
type: report
authors:
- name: "DYAI2025"
date-released: "2026-07-09"
url: "https://skillstore.io/skills/dyai2025-testing-anti-patterns/audits/10"
identifiers:
- type: other
value: "skillstore:dyai2025-testing-anti-patterns:audit:10"
description: "Skillstore immutable audit report identifier"
Skillstore スコア
このスコアの理由 証拠の信頼度: 中作成できるもの
新しい単体テストをレビューする
テストがプロダクトの振る舞いを証明しているのか、それともモックがレンダリングされたことだけを確認しているのかをチェックします。
リファクタリング中のテスト整理を計画する
必要に応じて、クリーンアップ用ヘルパーを本番クラスからテストユーティリティへ移動します。
コントリビューター向けのテスト標準を設定する
モック判断、TDD フロー、統合テストカバレッジについて、レビュアーが共有できるチェックリストを提供します。
これらのプロンプトを試す
Use the testing anti-patterns skill to review this test. Tell me if it verifies real behavior or only verifies a mock.
Review this test with the testing anti-patterns skill. Suggest the smallest change that reduces mocking while preserving useful isolation.
Use the testing anti-patterns skill to inspect this production method and its tests. Decide whether the method is test-only and should move to test utilities.
Apply the testing anti-patterns skill across this feature branch. Identify mock behavior tests, incomplete mocks, missing integration coverage, and places where TDD would improve confidence.
ベストプラクティス
- モックを追加する前に、失敗するテストを書くか確認します。
- 必要な振る舞いを維持しながら、最小の外部境界または遅い境界をモックします。
- 本番 API は、本番ライフサイクル上の責任に集中させます。
回避
- モック要素や偽のテスト ID が存在することをアサートする。
- テストからしか呼び出されない本番メソッドを追加する。
- 実際のレスポンス形状を確認せずに部分的なモックレスポンスを作成する。
よくある質問
このスキルはモックを禁止しますか?
それでも単体テストを使えますか?
いつ統合テストを選ぶべきですか?
これは TDD とどのように関係しますか?
このスキルはテストスイートを実行しますか?
これは TypeScript プロジェクト専用ですか?
開発者情報
作成者
DYAI2025ライセンス
MIT
Skillstore リビジョン
r1
バージョンに関する注意
作者はバージョンを宣言していません。
参照
1ffa7643651792ccb4bd3b15d924d2c97edff755
メンテナンスの新しさ
2026/7/21
利用状況
7 ダウンロード · 265 閲覧