Skip to content
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

Add --fuzzing-ratio to CLI #2496

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Markoutte
Copy link
Collaborator

@Markoutte Markoutte commented Aug 10, 2023

Description

  1. Now, CLI can be set with specific fuzzing ration instead of default 0.1. If no option is specified, then the default one is used.
  2. Source option is not required anymore. When --source option is absent then no javadocs is generated

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

1. Fix error with classloader
2. Add an option to control fuzzer ration
@Markoutte Markoutte added ctg-enhancement New feature, improvement or change request comp-fuzzing Issue is related to the fuzzing comp-cli Issue related to CLI labels Aug 10, 2023
@@ -149,9 +148,12 @@ class GenerateTestsCommand :
projectRootPath == null -> {
println("The path to the project root is required to generate a report. Please, specify \"--project-root\" option.")
}
sourceCodeFile == null -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure if we need curly braces here )

@@ -149,9 +148,12 @@ class GenerateTestsCommand :
projectRootPath == null -> {
println("The path to the project root is required to generate a report. Please, specify \"--project-root\" option.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be we should not ask specifying but suggest specifying the source code. Otherwise the user may think that it is mandatory for proper work of utility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The --project-root is mandatory only when --sarif is set. In others cases it is not mandatory

@@ -131,14 +125,20 @@ abstract class GenerateTestsAbstractCommand(name: String, help: String) :
.long()
.default(LONG_GENERATION_TIMEOUT)

private val fuzzingRation by option(

Choose a reason for hiding this comment

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

Nit: "ration" seems misused here. Consider calling this property fuzzingRatio instead of fuzzingRation.

Comment on lines +128 to +132
private val fuzzingRation by option(
"--fuzzing-ratio",
help = "Specify the ratio between symbolic engine and fuzzing"
)
.double()
Copy link

@liblit-at-amazon liblit-at-amazon Feb 26, 2024

Choose a reason for hiding this comment

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

According to this comment from @tyuldashev, the default is 0.1 fuzzing, 0.9 symbolic. If we take the help text literally, then the default "ratio between symbolic engine and fuzzing" would be 0.9 ÷ 0.1 = 9. But from my understanding of the code, 9 is not a valid value here, and this argument should actually be 0.1 to mimic the default behavior.

Consider revising this option's name and help text to reflect its actual semantics and to document its default behavior. For example:

private val fuzzingFraction by option(
        "-z",
        "--fuzzing-fraction",
        help = "Specifies the fraction of time spent using fuzzing instead of the symbolic engine (default: $DEFAULT_FUZZING_VALUE)"
)
        .double()
        .default(DEFAULT_FUZZING_VALUE)
        .validate { require(it in 0.0 .. 1.0) { "should be between 0.0 and 1.0." } }

where DEFAULT_FUZZING_VALUE is the default value of org.utbot.framework.plugin.api.TestFlow.fuzzingValue: currently 0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-cli Issue related to CLI comp-fuzzing Issue is related to the fuzzing ctg-enhancement New feature, improvement or change request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants