DEV Community

Arin Goel
Arin Goel

Posted on

We Built a Tiny AI Model That Predicts Which Time-Related Tests Your Python Code Needs

Time-related bugs are particularly frustrating.

A function can pass ordinary unit tests and still fail when it encounters February 29, a daylight-saving transition, a month-end boundary or an unexpected timezone conversion.

The problem isn't necessarily that developers forgot to write tests.

Sometimes it's difficult to know which edge cases are relevant to a particular function in the first place.

We built AEVORUN to explore that problem using a compact machine-learning model.

GitHub: https://github.com/A35-777/AEVORUN

Live playground: https://aevorun.pages.dev/

What is AEVORUN?

AEVORUN is a learned temporal test-scenario prioritization system.

Its model, AEVORUN-T1, analyses Python function structure and predicts which time-related test scenarios are worth prioritizing.

Instead of generating arbitrary tests, it attempts to identify relevant temporal failure categories.

What kinds of edge cases does it recognize?

The model covers 14 documented categories, including:

  • Leap-year and February 29 handling
  • Month-end arithmetic
  • Daylight-saving transitions
  • Ambiguous and nonexistent local times
  • Naive versus timezone-aware datetime mismatches
  • Timestamp precision
  • Calendar-duration mismatches
  • Year and midnight boundaries
  • Timezone conversions
  • Date parsing
  • Recurring schedules
  • Expiration boundaries

These are easy to overlook when testing only ordinary inputs.

How does it work?

AEVORUN uses a safe Python AST feature parser.

It extracts structural and numerical information from a function, then feeds that representation into AEVORUN-T1.

The model contains:

  • 53,711 parameters
  • Layer normalization
  • Residual blocks
  • A temporal-versus-non-temporal gating head
  • A multi-label scenario-scoring head
  • Probability calibration

The result is a ranked list of suggested test scenarios.

A small model, running locally

AEVORUN is designed for offline CPU inference.

The repository reports approximately 0.07 ms single-function inference latency in its benchmark environment.

It doesn't require remote LLM API calls or transmit source code to a remote inference service.

What did the benchmarks show?

The project evaluated the model on held-out repositories using repository-level separation.

Its reported AEVORUN-T1 results include:

Metric Result
Macro F1 0.8760
Micro F1 0.9590
Mean Average Precision 0.9065
Recall@3 93.7%
CPU inference latency 0.07 ms

An important detail: the benchmark also compared simpler approaches.

Multi-output logistic regression achieved a higher Macro F1 of 0.8990, while gradient-boosted trees achieved 0.8842.

That is useful information: the neural model is not automatically the best choice for every metric, even though its inference latency is competitive.

Using AEVORUN

The project includes a Python SDK and command-line interface.

For example:

from aevorun import Aevorun

engine = Aevorun()

code = """
from datetime import datetime, timedelta

def renew(start_date):
    return start_date.replace(
        year=start_date.year + 1
    )
"""

result = engine.analyze_source(code, top_k=3)

print(result.is_temporal)

for scenario in result.scenarios:
    print(scenario.name, scenario.score)
Enter fullscreen mode Exit fullscreen mode

This lets developers incorporate scenario prioritization into their own Python testing workflows.

Why we built it

We wanted to investigate whether a small learned model could identify relevant testing scenarios from source-code structure without requiring a large language model.

AEVORUN is an experiment in combining AST analysis, compact neural inference and practical software testing.

The repository includes the model, dataset and evaluation scripts, documentation and tests.

GitHub: https://github.com/A35-777/AEVORUN

Playground: https://aevorun.pages.dev/

Question for Python developers:

What is the most frequently overlooked datetime edge case in your projects? And would you use a tool that automatically prioritizes these scenarios before you write the tests?

Top comments (0)