Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let concrete add additional mocks to UtCompositeModel created by the engine #2553

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

IlyaMuravjov
Copy link
Collaborator

Description

Fixes #2549

#2549 shows that symbolic engine may miss some mocks. I suspect that it happens when it doesn't fully execute the method symbolically and lets concrete execution to finish the execution.

Regardless of why symbolic engine misses mocks, we need to deal with missed mocks. This PR makes concrete execution to always use the mechanism for dealing with incomplete mock that was originally developed for dealing with mocks created by the fuzzer (see #2529).

NOTE: generateMockitoAnswerHandlingRedundantAndMissingMocks() should be reviewed before approving this PR.

How to test

Automated tests

The proposed changes are verified with tests:
utbot-framework-test/src/test/kotlin/org/utbot/examples

Manual tests

Issue #2549 should no longer reproduce (NOTE: I wasn't able to reproduce it even before this fix).

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@IlyaMuravjov IlyaMuravjov added comp-symbolic-engine Issue is related to the symbolic execution engine comp-instrumented-process Issue is related to Instrumented process ctg-bug-fix PR is fixing a bug labels Aug 24, 2023
Copy link
Member

@sergeypospelov sergeypospelov left a comment

Choose a reason for hiding this comment

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

LGTM

@EgorkaKulikov EgorkaKulikov merged commit b1075f6 into main Aug 28, 2023
35 checks passed
@EgorkaKulikov EgorkaKulikov deleted the ilya_m/engine_missed_mocks branch August 28, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-instrumented-process Issue is related to Instrumented process comp-symbolic-engine Issue is related to the symbolic execution engine ctg-bug-fix PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MockitoException is expected to be thrown in Unit tests, but the test passes
3 participants