Skip to content

Adapt IdentityValidator with test cases#867

Merged
JonasKlauke merged 6 commits intosoot-oss:developfrom
Momo-Not-Emo:identity-validator
Feb 29, 2024
Merged

Adapt IdentityValidator with test cases#867
JonasKlauke merged 6 commits intosoot-oss:developfrom
Momo-Not-Emo:identity-validator

Conversation

@Momo-Not-Emo
Copy link
Copy Markdown
Contributor

The Identity Validator, based on Soot code, now includes added test cases covering all branches, except for cases where "parameterRef" is out-of-index. This omission is intentional, as it prevents the jimple file from being unloaded due to such jimple methods.

Copy link
Copy Markdown
Collaborator

@JonasKlauke JonasKlauke left a comment

Choose a reason for hiding this comment

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

Thanks for the help 👍
I spotted two improvements. It would be nice if you could include them

List<ValidationException> exceptions = new ArrayList<>();

boolean hasThisLocal = false;
SootMethod method = view.getMethod(body.getMethodSignature()).get();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

handle the case in which the method can not be found in the given view.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

handle the case in which the method can not be found in the given view.

what's the expected behaviour when the method does not present in the given view? Skip this validator or throw an exception?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should not fail - just abort - we can't say anything about it and in this case we should not complain as we could be in in a partial analysis situation - i.e. SootUp should do the most of the available information

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 69.76744% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 68.59%. Comparing base (409c870) to head (e46e939).

Files Patch % Lines
...java/sootup/core/validation/IdentityValidator.java 70.27% 8 Missing and 3 partials ⚠️
...va/sootup/core/validation/ValidationException.java 66.66% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #867      +/-   ##
=============================================
+ Coverage      68.57%   68.59%   +0.01%     
- Complexity      3892     3904      +12     
=============================================
  Files            311      311              
  Lines          15192    15234      +42     
  Branches        2586     2597      +11     
=============================================
+ Hits           10418    10449      +31     
- Misses          3874     3882       +8     
- Partials         900      903       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Momo-Not-Emo
Copy link
Copy Markdown
Contributor Author

Thanks for the help 👍 I spotted two improvements. It would be nice if you could include them

@JonasKlauke I have made changes according to your review. Could you review the changes? Thx~

Copy link
Copy Markdown
Collaborator

@JonasKlauke JonasKlauke left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@JonasKlauke
Copy link
Copy Markdown
Collaborator

Always run the fmt:format plugin before commiting or pushing 😄 I have also created so many fmt commits 😆

@JonasKlauke JonasKlauke merged commit d4f0096 into soot-oss:develop Feb 29, 2024
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