Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 27, 2025

Extended property-based test coverage for the DSL module from 95 to 136 tests using Hypothesis.

New Test Coverage

Created tests/property/test_dsl_extended_properties.py with 41 property tests covering:

  • Expression builder (F) - Complex boolean logic, nested AND/OR, operator chaining
  • Layer algebra - Commutativity, associativity, idempotence, set operations
  • Ordering/Grouping - per_layer(), per_layer_pair(), top_k(), coverage() filtering
  • Export operations - to_pandas(), to_dict(), to_networkx() consistency
  • Edge queries - Intralayer/interlayer predicates, layer filtering
  • Query building - AST generation, compute() accumulation, from_layers() override
  • Error handling - Empty networks, invalid metrics, conflicting conditions

Properties Validated

# Layer algebra is commutative
assert Q.nodes().from_layers(L["a"] + L["b"]) == Q.nodes().from_layers(L["b"] + L["a"])

# Multiple compute() calls accumulate
result = Q.nodes().compute("degree").compute("clustering").execute(net)
assert "degree" in df.columns and "clustering" in df.columns

# Conflicting WHERE conditions return empty
result = Q.nodes().where((F.layer == "a") & (F.layer == "b")).execute(net)
assert len(result) == 0

All tests use Hypothesis for automatic test case generation with edge case coverage.

Original prompt

This section details on the original issue you should resolve

<issue_title>Test coverage dsl</issue_title>
<issue_description>for dsl, imorove prop test coverage. no new md allowed</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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 changed the title [WIP] Improve property test coverage for DSL Add 41 property tests for DSL module (43% coverage increase) Dec 27, 2025
Copilot AI requested a review from SkBlaz December 27, 2025 15:05
@SkBlaz SkBlaz marked this pull request as ready for review December 27, 2025 21:52
@SkBlaz SkBlaz merged commit 19ef587 into master Dec 27, 2025
31 checks passed
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.

Test coverage dsl

2 participants