Automatically updates regression tests based on interval analysis to maintain coverage of key program intervals. Use when code changes affect value ranges, conditionals, or control flow, and existing tests need updating to maintain interval coverage. Analyzes interval information from updated code, identifies coverage gaps, adjusts test inputs and assertions, removes redundant tests, and generates new tests for uncovered intervals. Supports Python, Java, JavaScript, and C/C++ with various test frameworks (pytest, JUnit, Jest, Google Test).
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill interval-guided-regression-test-update
Automatically update regression tests to maintain interval coverage when program code changes.
Intervals represent ranges of values that variables can take during execution. When code changes, intervals may be added, removed, or modified. This skill ensures regression tests continue to cover all important intervals.
Example:
# Old code
def process(x):
if x < 10:
return x * 2
else:
return x + 10
# Intervals: [0, 10), [10, ∞)
# New code (added negative handling)
def process(x):
if x < 0:
return -x
elif x < 10:
return x * 2
else:
return x + 10
# Intervals: (-∞, 0), [0, 10), [10, ∞)
# Need to add test for new interval: x < 0
Parse the current regression test suite:
# Example test analysis
test_process_small: input=5, covers [0, 10)
test_process_large: input=15, covers [10, ∞)
# Coverage: 2/2 intervals = 100%
Obtain interval information from the updated program:
From static analysis:
From profiling:
From symbolic execution:
See references/interval-analysis.md for detailed extraction methods.
Compare current coverage with new intervals:
old_intervals = {[0, 10), [10, ∞)}
new_intervals = {(-∞, 0), [0, 10), [10, ∞)}
added_intervals = {(-∞, 0)} # Need new test
removed_intervals = {}
modified_intervals = {}
Apply appropriate update strategies:
Add tests for new intervals:
# New test for (-∞, 0)
def test_process_negative():
assert process(-5) == 5
Adjust inputs for modified intervals:
# If boundary changed from x < 10 to x < 20
# Old: test_process_large with input=15
# New: test_process_large with input=25
Update assertions for changed behavior:
# If logic changed
# Old: assert process(5) == 10
# New: assert process(5) == 15
Remove redundant tests:
# If intervals merged, remove duplicate coverage
See references/test-update-strategies.md for detailed strategies.
Run the updated test suite:
Provide comprehensive summary:
Scenario: Function adds handling for negative numbers
Original code:
def abs_double(x):
if x < 10:
return x * 2
else:
return x + 10
Original tests:
def test_small():
assert abs_double(5) == 10
def test_large():
assert abs_double(15) == 25
Updated code:
def abs_double(x):
if x < 0:
return -x * 2
elif x < 10:
return x * 2
else:
return x + 10
Updated tests:
def test_negative(): # NEW
assert abs_double(-5) == 10
def test_small():
assert abs_double(5) == 10
def test_large():
assert abs_double(15) == 25
Summary:
Scenario: Threshold value modified
Original code:
def categorize(score):
if score < 60:
return "fail"
else:
return "pass"
Original tests:
def test_fail():
assert categorize(50) == "fail"
def test_pass():
assert categorize(70) == "pass"
Updated code:
def categorize(score):
if score < 50: # Changed from 60
return "fail"
else:
return "pass"
Updated tests:
def test_fail():
assert categorize(40) == "fail" # Changed input from 50
def test_pass():
assert categorize(60) == "pass" # Changed input from 70
Summary:
Scenario: Simplified logic combines cases
Original code:
def classify(x):
if x < 0:
return "negative"
elif x == 0:
return "zero"
else:
return "positive"
Original tests:
def test_negative():
assert classify(-5) == "negative"
def test_zero():
assert classify(0) == "zero"
def test_positive():
assert classify(5) == "positive"
Updated code:
def classify(x):
if x <= 0:
return "non-positive"
else:
return "positive"
Updated tests:
def test_non_positive(): # Merged
assert classify(-5) == "non-positive"
assert classify(0) == "non-positive"
def test_positive():
assert classify(5) == "positive"
Summary:
Modify test inputs to cover new or changed intervals.
When to use:
How:
Modify expected values when behavior changes.
When to use:
How:
Remove redundant or obsolete tests.
When to use:
How:
Create new tests for uncovered intervals.
When to use:
How:
Interval Coverage = (Covered Intervals) / (Total Intervals) × 100%
Example:
Total intervals: 4
Covered by tests: 3
Coverage: 75%
Interval Coverage Report
========================
Before Update:
- Total intervals: 2
- Covered intervals: 2
- Coverage: 100%
After Update:
- Total intervals: 3
- Covered intervals: 3
- Coverage: 100%
Changes:
- Added intervals: 1
- Removed intervals: 0
- Modified intervals: 0
Test Changes:
- Added tests: 1
- Modified tests: 0
- Removed tests: 0
Problem: Code refactored, some logic changed
Solution:
Problem: New feature adds new code paths
Solution:
Problem: Bug fix changes behavior in specific interval
Solution:
Check:
Solution:
Check:
Solution:
Check:
Solution:
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Use when implementing any feature or bugfix, before writing implementation code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Take arabelatso/interval-guided-regression-test-update from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.