Skip to content

Corrected synthetic FuzzedMethodDescription for fuzzing thisInstance #892 #897

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

Merged

Conversation

volivan239
Copy link
Collaborator

Description

Fuzzer uses synthetic methods to create instances of classes under test. However, their FuzzedMethodDescriptions lacked packageName. This lead to using reflection for instantiating package-private classes despite this could be done by constructors. This PR sets correct packageName and className to these descriptions.

Fixes #892

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual Scenario

Launch plugin on example from #892 -- reflections are not used to instantiate class under test anymore.

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@volivan239 volivan239 requested a review from Markoutte September 9, 2022 12:22
@volivan239 volivan239 marked this pull request as ready for review September 9, 2022 12:22
@volivan239 volivan239 merged commit 44e1de9 into main Sep 12, 2022
@volivan239 volivan239 deleted the volivan239/fix_redundant_reflection_usage_in_fuzzer branch September 12, 2022 08:46
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.

Unnecessary reflection usage by fuzzer for instantiating package-private classes
2 participants