- Notifications
You must be signed in to change notification settings - Fork45
New fuzzing platform#1457
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
New fuzzing platform#1457
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
utbot-fuzzers/src/main/kotlin/org/utbot/fuzzing/providers/Objects.kt OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
| ) | ||
| } | ||
| privatefunshouldPass(type:ClassId):Boolean { |
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.
What "should pass" means in this context?
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.
Changed toisIgnored(type: ClassId)
| valgetter:Method? | ||
| ) | ||
| internalfunfindSuitableFields(classId:ClassId,packageName:String?):List<FieldDescription> { |
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.
I would add a piece of documentation here. Suitable for what?
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.
Changed tofindAccessibleModifableFields(...)
6e39690 to97d8336Compare| * @param description contains user-defined information about current run. Can be used as a state of the run. | ||
| * @param values current values to run. | ||
| */ | ||
| suspendfunrun(description:DESCRIPTION,values:List<RESULT>):FEEDBACK |
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.
Please, find a better naming for the method. 'Run' makes me think that the method is supposed to be called only ones. I would suggest something like: 'hanlde', 'valueUdated' or something similar
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.
Amazing! LGTM :)
| builder=PassRoutine("Main Routine"), | ||
| state=State(1, typeCache), | ||
| ) | ||
| val dynamicallyGenerated= mutableListOf<Node<T,R>>() |
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.
As I understand you use it as a queue, can you replace it with any instance of queue such as LinkedList or Deque.
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.
Looks monumental!
| fun String.findMaxSubstring(s:String) :Int { | ||
| if (s.isEmpty())return-1 | ||
| for (iin s.indices) { | ||
| if (s[i]!=this[i])return i-1 | ||
| } | ||
| return s.length | ||
| } |
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.
I think the name is misleading, because the function looks like a strange variation ofCharSequence.commonPrefixWith()
Also, it may throwStringIndexOutOfBoundsException ifthis is a strict prefix ofs. If this is intentional, please, add a comment describing how fuzzing handle exceptions in this example.
| /** | ||
| * Probability of creating shifted array values instead of generating new values for modification. | ||
| */ | ||
| varprobCollectionMutationInsteadCreateNew:Int =50, |
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.
Here and below: imo, if probability is not in[0, 1] it is worth mentioning that it is in percents
| funmain() { | ||
| val endian=Endian.BE | ||
| println(255.toUByte().toBinaryString(endian)) | ||
| println(2.toBinaryString(endian)) | ||
| println(BitVectorValue.fromInt(2).toBinaryString(endian)) | ||
| print(8.75f.toBinaryString(endian)) | ||
| print(8.75.toBinaryString(endian)) | ||
| } No newline at end of file |
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.
I think this should be either moved to tests or deleted. Same for IEEE754Value.kt
| TrieBasedFuzzerStatistics(coveredInstructionValues), methodUnderTestDescription,*defaultModelMutators().toTypedArray() | ||
| ) | ||
| fuzzedValues.forEach { values-> | ||
| val names= graph.body.method.tags.filterIsInstance<ParamNamesTag>().firstOrNull()?.names?: emptyList() |
volivan239Dec 12, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Thisnames initialization looks weird. Can't we just usemethodUnderTest.parameters.map { it.name } here? If not, please, add comment reasoning such an initialization
b70b8af tof759f20Compare
Uh oh!
There was an error while loading.Please reload this page.
Description
Adds new fuzzing platform that simplifies developing fuzzing for new languages. Old implementation is still in codebase but will be deprecated and removed soon. Only base Java implementation migrated to the new fuzzing platform at the moment.
Please, seeFuzzing Platform Design doc for understanding of basic concepts. In nutshell now any work with fuzzing requires some 'seeds' or 'tasks' which can be 4 types:
There aresome demos that clarify these concepts.
This platform is fully implemented for Java and plugin can be tested withthese samples.
Fixes#1448
Also note, that after short discussion this implementation doesn't use mocks because it looks wrong concepts in terms of fuzzing. Fuzzing doesn't analyze the code therefore it cannot supply correct mock calls for tests. Therefore#747 is discontinued starting this PR.
Type of Change
How Has This Been Tested?
Regression and integration tests
Test samples for manual testing were added. Integration test for fuzzing is being under developing.
Automated Testing
All tests from the
utbot-fuzzerandutbot-fuzzingmodules must pass.Manual Scenario
Samples for manual scenario.
Checklist: