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
Refactor/enrich the rest of Quark's tests #189
Conversation
Hello @haeter525! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-06-28 09:54:08 UTC |
Thank you @haeter525 for the excellent work! |
Hi, @krnick It looks like CI didn't provide the package I propose to add the following lines into
Please take a look at the following commit. Thanks. |
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
===========================================
+ Coverage 73.58% 83.99% +10.40%
===========================================
Files 35 43 +8
Lines 1772 2168 +396
===========================================
+ Hits 1304 1821 +517
+ Misses 468 347 -121
Continue to review full report at Codecov.
|
tests/utils/test_graph.py
Outdated
analysis_object.find_methods( | ||
"Lahmyth/mine/king/ahmyth/ConnectionManager\\$1;", | ||
"<init>", | ||
"\\(\\)V", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do descriptors \\(\\)V
need to be escaped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Thank you @haeter525 for helping Quark greatly improve the test coverage and consider many aspects of the test problem.
There is only one thing I am not sure that you use find_methods
to search method with the escape character \
inside descriptor in file tests/utils/test_graph.py
.
For example:
analysis_object.find_methods(
"Ljava/lang/Object;",
"<init>",
"\\(\\)V",
In fact, it could be written like this:
analysis_object.find_methods(
"Ljava/lang/Object;",
"<init>",
"()V",
Is there any reason?
Hi @krnick, thank you for your review! The reason is a problem with regular expressions. Because |
In fact, Also, whenever you propose a new PR, please do the following command locally and make sure that every test passes.
|
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 4.79%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Hi @krnick I've pushed a commit to change all the backslashes into the use of find_method in apkinfo.py. |
Thanks for the patch!. LGTM |
1. Support a new Android reversing engineer framework, Rizin to analyze the APK. (#205) 2. Making `click` package optional to install. (#214) @0ssigeno 3. Improve the tainted analysis by @haeter525 in bytecode loader 4. Add an Optional Parameter Filter For JSON Rules (#212) 5. Adjust some directory names. Objects->core, Evaluator->evaluator. 6. Add VirusTotal analysis module by @pulorsok. (#195) 7. More tests for Quark by @haeter525. (#189) 8. Add a new feature to show Parent Functions' Cross-References In Rule Classification by @haeter525. (#192)
Description
Please refer here. For the replacement of Androguard, I want to write tests to improve the test coverage of Quark. This is the final PR. (You can find the previous PR here )
In this PR, I focus on these files.
quark/Objects/analysis.py
quark/Objects/quarkrule.py
quark/report.py
quark/freshquark.py
quark/utils
(colors.py, graph.py, pprint.py, output.py, etc.)Code Changes
test_analysis.py
test_quarkrule.py
test_report.py
test_freshquark.py
test_colors.py
test_graph.py
test_output.py
test_pprint.py
test_regex.py
test_tools.py
test_weight.py
Related Discussions