Skip to content

Conversation

Copy link

Copilot AI commented Nov 26, 2025

Adds test coverage for the shortest paths subset extraction heuristic (cuddSubsetSP.c), which had 0% coverage.

Coverage achieved

  • Line coverage: 70.6% (404/572 lines)
  • Function coverage: 81.8% (9/11 functions)

Test cases added

  • Cudd_SubsetShortPaths / Cudd_SupersetShortPaths: Constants, single variables, AND/OR/XOR/ITE/XNOR structures, complemented functions
  • Parameter variations: numVars=0 default, thresholds 1-1000+, hardlimit flag (0/1)
  • Edge cases: Path length computation, cache hits, node reuse, threshold exceeds numVars

Why not 80%

The uncovered 168 lines (~29%) are:

  • ResizeNodeDistPages / ResizeQueuePages — require >262K unique nodes to trigger page reallocation
  • Memory error handlers — require ST_OUT_OF_MEM conditions
  • Internal error handlers — unreachable in normal operation
// Example test structure
TEST_CASE("Cudd_SubsetShortPaths - AND function", "[cuddSubsetSP]") {
    DdManager *manager = Cudd_Init(0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0);
    DdNode *x = Cudd_bddNewVar(manager);
    DdNode *y = Cudd_bddNewVar(manager);
    DdNode *f = Cudd_bddAnd(manager, x, y);
    
    DdNode *result = Cudd_SubsetShortPaths(manager, f, 2, 2, 1);
    REQUIRE(Cudd_bddLeq(manager, result, f));  // Result is subset of f
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Complete test cases for src/cuddSubsetSP.c to achieve 80% code coverage.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 26, 2025 09:31
Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test cases for src/cuddSubsetSP.c to achieve 80% coverage Add comprehensive test cases for cuddSubsetSP.c Nov 26, 2025
Copilot AI requested a review from doganulus November 26, 2025 10:03
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19699488655

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+1.4%) to 32.381%

Files with Coverage Reduction New Missed Lines %
src/cuddReorder.c 2 37.84%
Totals Coverage Status
Change from base Build 19697583343: 1.4%
Covered Lines: 9586
Relevant Lines: 29604

💛 - Coveralls

@doganulus doganulus marked this pull request as ready for review November 26, 2025 15:32
@doganulus doganulus merged commit cd0c7c0 into 4.0.0 Nov 26, 2025
70 of 116 checks passed
@doganulus doganulus deleted the copilot/add-test-cases-for-cuddsubsetsp branch November 27, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants