Interval Difference Analyzerのロゴ

Interval Difference Analyzer

コミュニティ
ArabelaTso
interval-difference-analyzer

Analyze differences in program intervals between two versions of a program (old and new) to identify added, removed, or modified intervals. Use when comparing program versions, analyzing variable ranges, detecting behavioral changes in numeric computations, validating refactorings, or assessing migration impacts. Supports optional test suite integration to validate interval changes. Generates comprehensive reports highlighting intervals requiring further testing or verification.

概要

公開者ArabelaTso
リポジトリSkills-4-SE
スキル名interval-difference-analyzer
スター
258
フォーク
25
同梱ファイル
4
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 4個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    ArabelaTsoがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルInterval Difference AnalyzerをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/interval-difference-analyzer
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git /tmp/Skills-4-SE
mkdir -p .claude/skills
cp -r /tmp/Skills-4-SE/skills/interval-difference-analyzer .claude/skills/interval-difference-analyzer
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでInterval Difference Analyzerを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にInterval Difference Analyzerを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Interval Difference Analyzerは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Interval Difference Analyzer

Overview

Analyze differences in program intervals (variable value ranges) between two versions of a program to detect behavioral changes, identify potential bugs, and guide testing efforts.

Core Workflow

1. Setup Program Versions

Prepare both program versions for analysis:

bash
OLD_VERSION=/path/to/old/program
NEW_VERSION=/path/to/new/program
TEST_SUITE=/path/to/tests  # Optional

2. Extract Intervals

Extract interval information from both versions:

bash
python scripts/interval_analyzer.py \
    --program $OLD_VERSION \
    --output old_intervals.json

python scripts/interval_analyzer.py \
    --program $NEW_VERSION \
    --output new_intervals.json

3. Compare Intervals

Compare intervals and identify differences:

bash
python scripts/compare_intervals.py \
    --old old_intervals.json \
    --new new_intervals.json \
    --output interval_diff_report.json

4. Review Report

Examine the generated report for:

  • Added intervals (new variables or wider ranges)
  • Removed intervals (deleted variables or narrower ranges)
  • Modified intervals (changed bounds)
  • Behavioral implications
  • Testing recommendations

What Are Program Intervals?

Program intervals represent the possible ranges of values that variables can take during program execution.

Example:

python
def calculate_discount(price, discount_rate):
    # Intervals:
    # price: [0, 10000]
    # discount_rate: [0.0, 1.0]
    # discount: [0, 10000]
    discount = price * discount_rate
    return discount

Why intervals matter:

  • Detect overflow/underflow risks
  • Identify boundary condition changes
  • Validate numeric computation correctness
  • Guide test case generation

Interval Extraction Methods

Method 1: Static Analysis

Analyze code to infer possible value ranges without execution.

Method 2: Dynamic Analysis

Execute program with test inputs and observe actual ranges.

Method 3: Abstract Interpretation

Use abstract domains to compute sound interval approximations.

Interval Comparison

Identifying Added Intervals

Pattern: New variables or wider ranges in new version

Implications:

  • New computation paths
  • Potential new bugs
  • Requires new tests

Identifying Removed Intervals

Pattern: Deleted variables or narrower ranges in new version

Implications:

  • Simplified computation
  • Reduced intermediate state
  • May affect debugging

Identifying Modified Intervals

Pattern: Changed bounds for existing variables

Example:

python
# Old version: age: [0, 120]
# New version: age: [0, 150]  # Widened!

Implications:

  • Relaxed constraints
  • May accept invalid inputs
  • Requires validation testing

Behavioral Change Detection

Overflow/Underflow Detection

Check if new intervals exceed type bounds.

Example:

python
# Old: result: [0, 1000000] ✓ Safe (int32)
# New: result: [0, 10000000000] ✗ Overflow risk!

Precision Loss Detection

Check if new intervals lose precision.

Example:

python
# Old: result: [0.0, 100.0] (float)
# New: result: [0, 100] (int) - precision loss!

Boundary Condition Changes

Check if interval boundaries change critically.

Example:

python
# Old: index: [0, 99]
# New: index: [-1, 99]  # Negative index possible!

Testing Recommendations

Priority Levels

Critical: Test immediately

  • Overflow/underflow risks
  • Negative indices
  • Division by zero
  • Type mismatches

High: Test soon

  • Widened intervals
  • Boundary changes
  • Precision loss

Medium: Test when convenient

  • Narrowed intervals (safer)
  • Removed intermediate variables

Low: Optional testing

  • Cosmetic changes
  • Unchanged intervals

Test Case Generation

Generate test cases targeting interval boundaries:

python
# Interval: x: [0, 100]
test_cases = [0, 1, 50, 99, 100]

# For modified interval: [0, 100] → [0, 150]
additional_tests = [101, 125, 149, 150]

Report Format

The analyzer generates a comprehensive JSON report:

json
{
  "summary": {
    "total_intervals_old": 45,
    "total_intervals_new": 48,
    "added_intervals": 5,
    "removed_intervals": 2,
    "modified_intervals": 8
  },
  "differences": [
    {
      "type": "modified",
      "variable": "age",
      "old_interval": "[0, 120]",
      "new_interval": "[0, 150]",
      "severity": "high",
      "implications": ["Accepts wider range"],
      "testing_priority": "high",
      "suggested_tests": [121, 135, 149, 150]
    }
  ],
  "recommendations": [
    "Test modified intervals with boundary values",
    "Verify no overflow in calculations"
  ]
}

Integration with Test Suites

Validate Intervals with Tests

Run existing tests and verify intervals:

bash
python scripts/validate_intervals.py \
    --program $NEW_VERSION \
    --intervals new_intervals.json \
    --test-suite $TEST_SUITE

Generate Tests from Intervals

Automatically generate tests for interval boundaries:

bash
python scripts/generate_interval_tests.py \
    --intervals interval_diff_report.json \
    --output generated_tests.py

Best Practices

  1. Use both static and dynamic analysis: Combine for better coverage
  2. Focus on critical intervals: Prioritize safety-critical variables
  3. Test boundary values: Always test interval bounds
  4. Document intentional changes: Mark expected interval modifications
  5. Automate analysis: Integrate into CI/CD pipeline

Resources

  • references/interval_analysis.md: Detailed interval analysis techniques
  • references/abstract_interpretation.md: Abstract interpretation theory
  • scripts/interval_analyzer.py: Main interval extraction tool
  • scripts/compare_intervals.py: Interval comparison engine
  • scripts/validate_intervals.py: Test suite validation
  • scripts/generate_interval_tests.py: Test case generator

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Interval Difference Analyzer」では何ができますか?

Analyze differences in program intervals between two versions of a program (old and new) to identify added, removed, or modified intervals. Use when comparing program versions, analyzing variable ranges, detecting behavioral changes in numeric computations, validating refactorings, or assessing migration impacts. Supports optional test suite integration to validate interval changes. Generates comprehensive reports highlighting intervals requiring further testing or verification.

TypingMindでInterval Difference Analyzerを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Interval Difference Analyzerはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにInterval Difference Analyzerをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/interval-difference-analyzerを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Interval Difference Analyzerを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Interval Difference Analyzerは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもInterval Difference Analyzerを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Interval Difference Analyzer」は無料ですか?

はい。ArabelaTsoがGitHubでApache-2.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇