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.
81
71%
Does it follow best practices?
Impact
100%
1.85xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/interval-difference-analyzer/SKILL.mdAnalyze differences in program intervals (variable value ranges) between two versions of a program to detect behavioral changes, identify potential bugs, and guide testing efforts.
Prepare both program versions for analysis:
OLD_VERSION=/path/to/old/program
NEW_VERSION=/path/to/new/program
TEST_SUITE=/path/to/tests # OptionalExtract interval information from both versions:
python scripts/interval_analyzer.py \
--program $OLD_VERSION \
--output old_intervals.json
python scripts/interval_analyzer.py \
--program $NEW_VERSION \
--output new_intervals.jsonCompare intervals and identify differences:
python scripts/compare_intervals.py \
--old old_intervals.json \
--new new_intervals.json \
--output interval_diff_report.jsonExamine the generated report for:
Program intervals represent the possible ranges of values that variables can take during program execution.
Example:
def calculate_discount(price, discount_rate):
# Intervals:
# price: [0, 10000]
# discount_rate: [0.0, 1.0]
# discount: [0, 10000]
discount = price * discount_rate
return discountWhy intervals matter:
Analyze code to infer possible value ranges without execution.
Execute program with test inputs and observe actual ranges.
Use abstract domains to compute sound interval approximations.
Pattern: New variables or wider ranges in new version
Implications:
Pattern: Deleted variables or narrower ranges in new version
Implications:
Pattern: Changed bounds for existing variables
Example:
# Old version: age: [0, 120]
# New version: age: [0, 150] # Widened!Implications:
Check if new intervals exceed type bounds.
Example:
# Old: result: [0, 1000000] ✓ Safe (int32)
# New: result: [0, 10000000000] ✗ Overflow risk!Check if new intervals lose precision.
Example:
# Old: result: [0.0, 100.0] (float)
# New: result: [0, 100] (int) - precision loss!Check if interval boundaries change critically.
Example:
# Old: index: [0, 99]
# New: index: [-1, 99] # Negative index possible!Critical: Test immediately
High: Test soon
Medium: Test when convenient
Low: Optional testing
Generate test cases targeting interval boundaries:
# Interval: x: [0, 100]
test_cases = [0, 1, 50, 99, 100]
# For modified interval: [0, 100] → [0, 150]
additional_tests = [101, 125, 149, 150]The analyzer generates a comprehensive JSON report:
{
"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"
]
}Run existing tests and verify intervals:
python scripts/validate_intervals.py \
--program $NEW_VERSION \
--intervals new_intervals.json \
--test-suite $TEST_SUITEAutomatically generate tests for interval boundaries:
python scripts/generate_interval_tests.py \
--intervals interval_diff_report.json \
--output generated_tests.py0f00a4f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.