Skip to content

Add comprehensive test cases for cuddDecomp.c#96

Merged
doganulus merged 5 commits into4.0.0from
copilot/add-test-cases-cudddecomp
Dec 4, 2025
Merged

Add comprehensive test cases for cuddDecomp.c#96
doganulus merged 5 commits into4.0.0from
copilot/add-test-cases-cudddecomp

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 1, 2025

Adds test coverage for src/cuddDecomp.c BDD decomposition functions. Coverage improved from 59.17% to 67.69%.

Changes

  • All 8 public decomposition APIs tested: GenConj/GenDisj, ApproxConj/ApproxDisj, IterConj/IterDisj, VarConj/VarDisj
  • BDD structure variations: AND/OR chains, mixed patterns, XOR structures, ITE patterns, complemented edges
  • Stress tests: Large BDDs (100+ vars), complex sharing patterns, multiple decomposition iterations
  • Edge cases: Constants, single variables, zero cofactor paths, timeout handler registration

Coverage Limitation

90% target not achievable without memory allocation mocking:

  • ~252 lines are CUDD_MEMORY_OUT error handlers
  • ~74 lines are rare internal hash table state-dependent paths in CheckInTables, PickOnePair, PairInTables

Theoretical max without mocking: ~75%

Example Test Pattern

TEST_CASE("cuddDecomp - BuildConjuncts specific paths") {
    DdManager *manager = Cudd_Init(0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0);
    
    // Create BDD with Nv==zero structure to trigger ZeroCase path
    DdNode *notx0 = Cudd_Not(vars[0]);
    DdNode *f = Cudd_bddAnd(manager, notx0, complexExpr);
    Cudd_Ref(f);
    
    DdNode **conjuncts = nullptr;
    int result = Cudd_bddGenConjDecomp(manager, f, &conjuncts);
    REQUIRE(result >= 1);
    // cleanup...
}

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/cuddDecomp.c and target 90% coverage for the source file.


💡 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 4 commits December 1, 2025 05:29
Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
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/cuddDecomp.c with 90% coverage Add comprehensive test cases for cuddDecomp.c Dec 1, 2025
Copilot AI requested a review from doganulus December 1, 2025 05:53
@doganulus doganulus marked this pull request as ready for review December 4, 2025 07:25
@doganulus doganulus merged commit 367b7c1 into 4.0.0 Dec 4, 2025
37 checks passed
@doganulus doganulus deleted the copilot/add-test-cases-cudddecomp branch December 5, 2025 14:18
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.

2 participants