GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Сonstraint model synthesis by AbdullinAM · Pull Request #966 · UnitTestBot/UTBotJava

Conversation

@AbdullinAM

@AbdullinAM AbdullinAM commented Sep 19, 2022

Copy link
Copy Markdown

Description

Constrained model synthesis prototype. It tries to generate UtAssembleModel that creates an object using it's public API for each argument of the method under test.

Type of Change

New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Automated Testing

Feature was tested on open-source projects: exp4j, guava, fastjson, etc.

Also SynthesisExamplesTest was added.

Manual Scenario

Example class org.utbot.examples.synthesis.SynthesisExamples was added to the utbot-sample module. Running UtBot on the methods from that class with UtSettings.enableSynthesis set to true should show several scenarios of how constrained model synthesis allows to generate test cases that use public API of the objects

Checklist (remove irrelevant options):

This is the author self-check list

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sergey Pospelov and others added 30 commits June 20, 2022 11:56
Sergey Pospelov
Draft: model synthesis
fb0adca
@AbdullinAM
m
11c47d9
@AbdullinAM
first prototype, needs debugging and tuning
4aaa8e5
@AbdullinAM
prototype
9c63ba0
@AbdullinAM
refactor
707fa6d
@AbdullinAM
very early prototype
10c4193
@AbdullinAM
UtConstraintModel implemented
4285a5c
@AbdullinAM
partial UtConstraint to UtExpression convertion
22e2266
@AbdullinAM
working prototypes
6b47a9a
@AbdullinAM
bugfixes + expression support in constraints
a75a840
@AbdullinAM
m
fb392f6
@AbdullinAM
everything kind of works, but some constraints need to be added
5f35311
@AbdullinAM
first working protoype with arrays
ba9bb62
@AbdullinAM
renaming
065924f
@AbdullinAM
first tests and fixes
8cc7515
@AbdullinAM
more expressions supported
4a14606
@AbdullinAM
some cleanup + more expressions supported
bbf525b
@AbdullinAM
cleanup
850b530
@AbdullinAM
support for multidimensional arrays + fix for array generation
8799691
@AbdullinAM
first support of lists
60df4a4
@AbdullinAM
support sets
8963a7e
@AbdullinAM
small refactorings
1578c96
@AbdullinAM
maps
1dd4b25
@AbdullinAM
some cleanup and parameters
313757d
@AbdullinAM
test write fix
faa0047
@AbdullinAM
m
94740c9
@AbdullinAM
Merge branch 'main' into abdullin/constraint-model-synthesis
9920283
# Conflicts:
#	utbot-cli/src/main/kotlin/org/utbot/cli/GenerateTestsAbstractCommand.kt
#	utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt
#	utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/Resolver.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt
#	utbot-junit-contest/src/main/kotlin/org/utbot/contest/Contest.kt
#	utbot-summary/src/main/kotlin/org/utbot/summary/ast/JimpleToASTMap.kt
@AbdullinAM
merge with master
fd22077
@AbdullinAM
first prototype of constraint scoring selector
4e97b5f
@AbdullinAM
m
2544b31
AbdullinAM added 13 commits August 31, 2022 19:03
@AbdullinAM
fixes
e585371
@AbdullinAM
Merge branch 'main' into abdullin/constraint-model-synthesis
d2564e9
# Conflicts:
#	utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt
#	utbot-framework-test/src/test/kotlin/org/utbot/framework/assemble/AssembleModelGeneratorTests.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt
@AbdullinAM
Merge branch 'main' into abdullin/constraint-model-synthesis
bb1acbc
# Conflicts:
#	utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt
#	utbot-framework-test/src/test/kotlin/org/utbot/framework/assemble/AssembleModelGeneratorTests.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt
@AbdullinAM
Split constraint models into a set of non-intersecting subsets before…
c6fbeb0
… synthesis
@AbdullinAM
m
2553ef7
@AbdullinAM
some cleanup
e943a16
@AbdullinAM
more cleanup
cd5fff8
@AbdullinAM
order models in the subsets
c2a7d31
@AbdullinAM
simple caching of synthesis unit contexts
d1b09c8
@AbdullinAM
option to enable/disable caching of synthesis contexts
eedccb9
@AbdullinAM
m
11eea4d
@AbdullinAM
tests
9712e70
@AbdullinAM
unit tests fixed
1c6b679
@AbdullinAM

AbdullinAM commented Sep 19, 2022

Copy link
Copy Markdown
Author

Currently only stateBefore is generated using constrained model synthesis. StateAfter is generated from concrete execution. In the future it is possible to add constrained model synthesis for stateAfter also, but it will at least double UtBot working time.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sergeypospelov

sergeypospelov commented Sep 20, 2022

Copy link
Copy Markdown
Member

I will take a superficial review this week. You also ought to rebase on master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AbdullinAM added 2 commits September 28, 2022 09:10
@AbdullinAM
Merge branch 'main' into abdullin/constraint-model-synthesis
4e37763
# Conflicts:
#	utbot-framework-test/src/test/kotlin/org/utbot/framework/assemble/AssembleModelGeneratorTests.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/Resolver.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/Traverser.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt
#	utbot-framework/src/main/kotlin/org/utbot/external/api/UtModelFactory.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/assemble/AssembleModelGenerator.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgMethodConstructor.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgVariableConstructor.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/concrete/UtExecutionInstrumentation.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/minimization/Minimization.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt
#	utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestSpecificTestCaseGenerator.kt
@AbdullinAM
merge with main
34ed6fe
@AbdullinAM AbdullinAM closed this Sep 29, 2022
@AbdullinAM AbdullinAM mentioned this pull request Sep 29, 2022
Сonstraint model synthesis #1030
Open
7 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@AbdullinAM @sergeypospelov
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.