Skip to content

Added pre-condition for non-empty paths in the ExecutionMetric to avoid unclear NPE #267 #567

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
merged 1 commit into from
Jul 21, 2022

Conversation

amandelpie
Copy link
Collaborator

@amandelpie amandelpie commented Jul 21, 2022

Description

The ExecutionMetric works with the non-empty paths, but could obtain it sometimes.
I've added pre-condition checks and throw a few exceptions to handle it later and with the correct message.

Fixes #267

Type of Change

  • Minor bug fix (non-breaking small changes)

How Has This Been Tested?

Automated Testing

Added a new test to reproduce the condition with empty paths
ExecutionMetricTest.computeWithTwoEmptySteps

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

@amandelpie amandelpie requested a review from onewhl July 21, 2022 12:13
@amandelpie amandelpie changed the title Added required pre-condition for the ExecutionMetric to avoid low-level exception #267 Added required pre-condition for the ExecutionMetric to avoid unclear NPE #267 Jul 21, 2022
@amandelpie amandelpie changed the title Added required pre-condition for the ExecutionMetric to avoid unclear NPE #267 Added pre-condition for non-empty paths in the ExecutionMetric to avoid unclear NPE #267 Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

"Array is empty" error message from ExecutionDistance class in utbot-summary module
2 participants