• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

martineberlein / debugging-benchmark / 7872967682

12 Feb 2024 02:09PM UTC coverage: 70.936% (-11.7%) from 82.589%
7872967682

Pull #25

github

web-flow
Merge 1536f6e21 into d5a4e936d
Pull Request #25: Stable

16 of 41 new or added lines in 4 files covered. (39.02%)

1296 of 1827 relevant lines covered (70.94%)

0.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.24
/src/debugging_framework/coverage.py
1
from typing import List, Tuple, Callable, Set
1✔
2

3
from fuzzingbook.Coverage import Coverage, Location, BranchCoverage
1✔
4

5
from debugging_framework.input import Input
1✔
6

7

8
def population_coverage(
1✔
9
    population: List[Input | str], function: Callable
10
) -> Tuple[Set[Location], List[int]]:
NEW
11
    cumulative_coverage: List[int] = []
×
NEW
12
    all_coverage: Set[Location] = set()
×
13

NEW
14
    for s in population:
×
NEW
15
        with Coverage() as cov:
×
NEW
16
            try:
×
NEW
17
                function(s)
×
NEW
18
            except:
×
NEW
19
                pass
×
NEW
20
        filtered_set = {
×
21
            (func, line)
22
            for (func, line) in cov.coverage()
23
            if "derivation_tree" not in func and "input" not in func
24
        }
NEW
25
        all_coverage |= filtered_set
×
NEW
26
        cumulative_coverage.append(len(all_coverage))
×
27

NEW
28
    return all_coverage, cumulative_coverage
×
29

30

31
def population_branch_coverage(
1✔
32
    population: List[Input | str], function: Callable
33
) -> Tuple[Set[Location], List[int]]:
NEW
34
    cumulative_coverage: List[int] = []
×
NEW
35
    all_coverage: Set[Location] = set()
×
36

NEW
37
    for s in population:
×
NEW
38
        with BranchCoverage() as cov:
×
NEW
39
            try:
×
NEW
40
                function(s)
×
NEW
41
            except:
×
NEW
42
                pass
×
NEW
43
        filtered_set = {
×
44
            (x, y)
45
            for (x, y) in cov.coverage()
46
            if "derivation_tree" not in x[0] and y[0] and "input" not in x[0] and y[0]
47
        }
NEW
48
        all_coverage |= filtered_set
×
NEW
49
        cumulative_coverage.append(len(all_coverage))
×
50

NEW
51
    return all_coverage, cumulative_coverage
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc