Skip to content

Conversation

@devin-ai-integration
Copy link

Add Semantic Fuzz Testing Suite with QuickCheck

This PR adds a new fuzz testing suite in mongosql/src/ast/semantic_fuzz_test.rs that uses the Rust quickcheck crate to assert two properties about semantically valid MongoSQL queries:

  1. Semantically valid queries "compile" via the translate_sql function
  2. The aggregation pipelines from the translations run against mongod without error

Implementation Details

  • Created a test catalog schema with collections covering all MongoSQL types
  • Implemented a post-processing approach to make arbitrary AST nodes semantically valid
  • Added two property-based tests:
    • prop_semantic_queries_translate: Tests that generated queries translate successfully
    • prop_aggregation_pipelines_run: Tests that generated pipelines run against MongoDB

Testing

The fuzz tests can be run with:

cargo test fuzz_test

Note: The tests are designed to fail when they find bugs in the codebase, which is the intended behavior of fuzz testing.

Link to Devin run

https://app.devin.ai/sessions/cb413e7319c6434ab80476bd9ab77d81

Requested by

[email protected]

@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner May 13, 2025 19:30
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 27 commits May 13, 2025 19:58
…it Expression variants and ensure Tuple expressions are properly handled

Co-Authored-By: [email protected] <[email protected]>
@mattChiaravalloti mattChiaravalloti marked this pull request as draft August 29, 2025 14:03
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