-
Notifications
You must be signed in to change notification settings - Fork 478
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
test: PURL generation for language parsers #3961
Comments
I would like to work on this as I'm already working on PURL generation. Would be a good learning experience. |
Also, the |
Eagerly waiting for response @terriko :) |
The goal is always for us to get as close as possible to 100% test coverage, so definitely both. If you've never worked with code coverage tools like codecov, they can help you figure out what parts your tests cover and which parts are not covered. |
Note that I don't actually expect us to get to 100% over all of cve-bin-tool because it is asymptotically hard, some of the code has to be tested against real data, and some of the tests would take a long time, so we aim to hover around 80% mostly as a balance of coverage vs practicality. But for something like this where you're literally just making a string and it'll execute in a few microseconds, there's no reason not to test Every Possible Code Path, unless of course upon testing it you realize that a lot of them could be collapsed into a single code path so you don't have to write as many tests. Refactoring is a valid way to improve code coverage too. 📈 |
Tagging @inosmeet to take a look at these tests. |
* fixes #3961 Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
We're currently in the process of adding PURL generation to our language parsers, but currently aren't using it for anything. Eventually we will as part of the planned gsoc project described in #3771 . But while we're waiting for bigger things, we could definitely stand to have some unit tests!
To avoid wasting time parsing files twice, we may want to add the
generate_purl
tests into the existingtest_language_package
code, and do really basic unit-tests where we throw both valid and invalidvendor, package, version
info intogenerate_purl
The text was updated successfully, but these errors were encountered: