or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/atheris@2.3.x
tile.json

tessl/pypi-atheris

tessl install tessl/pypi-atheris@2.3.0

A coverage-guided fuzzer for Python and Python extensions based on libFuzzer

Agent Success

Agent success rate when using this tile

91%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.28x

Baseline

Agent success rate without this tile

71%

task.mdevals/scenario-4/

Custom Branch Coverage Tracker

Create a Python module that implements a custom branch tracking system using manual coverage counter allocation. The module should track execution of different code branches during testing.

@generates

Requirements

Branch Registration

The module should allow registration of named branches (code paths) that need to be tracked. Each branch gets a unique identifier.

  • Registering a branch named "path_a" allocates a counter and returns a branch ID @test
  • Registering multiple branches ("path_a", "path_b", "path_c") allocates separate counters for each @test

Branch Hit Recording

The module should record when a specific branch is executed using its branch ID.

  • Recording a hit for a registered branch increments its internal counter @test
  • Recording multiple hits for the same branch works correctly @test

Coverage Initialization

The module should initialize the coverage tracking system to make allocated counters visible to the fuzzer.

  • Calling initialize_coverage() after registering branches makes counters active @test

Branch Coverage Reporting

The module should provide a way to check which branches have been executed.

  • Getting covered branches after recording hits returns the set of branch names that were hit @test
  • Getting covered branches before any hits returns an empty set @test

API

class BranchTracker:
    """Tracks coverage of code branches using manual counter allocation."""

    def __init__(self):
        """Initialize a new branch tracker."""
        pass

    def register_branch(self, name: str) -> int:
        """
        Register a named branch for tracking.

        Args:
            name: Unique identifier for the branch

        Returns:
            Branch ID that can be used with record_hit()
        """
        pass

    def initialize_coverage(self) -> None:
        """
        Initialize the coverage tracking system.
        Must be called after all branches are registered and before recording hits.
        """
        pass

    def record_hit(self, branch_id: int) -> None:
        """
        Record that a specific branch was executed.

        Args:
            branch_id: The ID returned from register_branch()
        """
        pass

    def get_covered_branches(self) -> set:
        """
        Get the set of branch names that have been executed.

        Returns:
            Set of branch names that have recorded hits
        """
        pass

Dependencies { .dependencies }

atheris { .dependency }

Provides fuzzing and coverage tracking capabilities.

@satisfied-by