Skip to content

Update python unit test generation #1763

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

Merged
merged 192 commits into from
Feb 10, 2023
Merged

Conversation

tamarinvs19
Copy link
Collaborator

@tamarinvs19 tamarinvs19 commented Jan 31, 2023

Description

It is a new version of Python UTBot.

Updates:

  • Now we use only new fuzzing platform
  • New python object serialization and deserialization strategy
  • New type inference algorithm
  • Remove python3parser (it was the biggest dependency)
  • Simple state after / state before asserts

How to test

Manual tests

We have some examples in /utbot-python/samples directory.

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.

@Markoutte
Copy link
Collaborator

At the moment it throws an exception for a method that isn't declared with class:

def test(self, x):
    if (x < 0):
        return -1
    return x*x

print(test(2))

When trying to generate for method test it throws:

java.lang.NullPointerException
	at org.utbot.python.PythonTestCaseGenerator.findMethodByDescription(PythonTestCaseGenerator.kt:54)
	at org.utbot.python.PythonTestCaseGenerator.generate(PythonTestCaseGenerator.kt:98)
	at org.utbot.python.PythonTestGenerationProcessor.processTestGeneration(PythonTestGenerationProcessor.kt:109)
	at org.utbot.python.PythonTestGenerationProcessor.processTestGeneration$default(PythonTestGenerationProcessor.kt:32)
	at org.utbot.intellij.plugin.language.python.PythonDialogProcessor$createTests$1.run(PythonDialogProcessor.kt:161)

Copy link
Collaborator

@Markoutte Markoutte left a comment

Choose a reason for hiding this comment

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

Please, update branch to make it compilable with changes in JS module

repositories {
mavenCentral()
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we can drop lines before this to unify build.gradle with other project's modules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@tamarinvs19 tamarinvs19 merged commit 56f76da into main Feb 10, 2023
@tamarinvs19 tamarinvs19 deleted the tamarinvs19/utbot-python-stable branch February 10, 2023 10:47
@alisevych alisevych added this to the 2023.03 Release milestone Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-fuzzing Issue is related to the fuzzing ctg-enhancement New feature, improvement or change request lang-python Issue is related to python support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants