Skip to content

Conversation

@kylo5aby
Copy link
Contributor

Summary

To quickly improve WAMR's software quality, this PR uses LLM to generate unit test cases for the interpreter module.

Changes

  • Add 15 new unit test cases for iwasm/interpreter module
  • Improve iwasm/interpreter coverage:
    • Lines coverage: 33.7% → 35.0% (+1.3%)
    • Functions coverage: 55.4% → 56.2% (+0.8%)

Testing

All new test cases pass successfully.

Welcome any feedback or suggestions on these AI-generated test cases. Please let me know if you have ideas for improvement.


target_link_libraries (interpreter_test gtest_main )

# Copy WASM files to build directory
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably store all those test cases in a separate directory, such as smart-tests or digit-suite.

please co-sign with ai-assistant in the git comment. https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line


// Complex calculation with overflow handling
// The exact result depends on implementation but should not crash
ASSERT_TRUE(true); // Test passes if no crash occurs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid assertion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd suggest that anyone who wants to submit an AI-generated thing should review it by himself extensively before making it be publicly reviewed.
reviewing AI-generated logic is tiresome.

Signed-off-by: zhenweijin <[email protected]>

Co-authored-by: Gong, Pu <[email protected]>

Co-authored-by: ai-assistant
@lum1n0us
Copy link
Collaborator

lum1n0us commented Dec 4, 2025

The file and directory structure should be organized as follows:

unit
├── CMakeLists.txt              -> add_subdirectory(smart-cases)
└── smart-cases
    ├── CMakeLists.txt          -> add_subdirectory(interpreter)
    └── interpreter
        ├── CMakeLists.txt
        └── wasm-apps

@lum1n0us
Copy link
Collaborator

lum1n0us commented Dec 4, 2025

IMO, ideally, for a function, there should be one positive case, one negative case, and one corner case for testing.

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