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

Сonstraint model synthesis #1030

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

Conversation

AbdullinAM
Copy link

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.

This is a new PR for constraint model synthesis with the rebase to master (it was easier to create a new branch than to resolve all the conflicts from the old one). I closed the old PR #966

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

@AbdullinAM
Copy link
Author

tagging @sergeypospelov to ensure that you will see the new PR

AbdullinAM and others added 25 commits October 11, 2022 12:35
…nitTestBot#871)

* Fixed repeated `hashCode` calculation for `Edge`

* Added `toArray` without ClassCastException check API

* Fixed UNSAT core debug logging
* Avoid summary duplication UnitTestBot#985

* Fix rendering for 2022.1.4
* Reordered the test clusters

* Renamed clusters

* Fixed tests

* Fixed tests

Co-authored-by: Zarina Kurbatova <zarina.kurbatova@gmail.com>
UnitTestBot#1047)

IndexNotReadyException thrown in IDEA with installed UnitTestBot plugin UnitTestBot#273

1) Add dumb mode wrapping
2) Split long EDT consumers into chains-of-invokeLater
3) Disable IntentionHelper for a while (it causes tricky exceptions and hanging)
…icatorsSearcher corrected (UnitTestBot#1029)

* Improve modificators analysis in UtBotFieldModificatorsSearcher and AssembleModelGenerator

* Apply review comments

* Fixed test

* One more correction for package names
* Try to fix memory leak in CgFieldStateManager

* Removed unused testClassConstructors

* Make CgContext much more thin

* Clear content related maps before the processing of new test class
In case of repeating SourceFolders action would not be shown.
From now it takes first SourceFolder with the same virtual file source
root
…t#1084)

Include information about triggered recursion to javadocs
* Fix rendering for different IDE versions

* add info about IDE version for each case
[utbot-rd]
1. engine out-of-process
2. removed jdk8+ api calls in engine-related code
3. removed reflection in utbot-intellij to support idea 2022
4. bumped idea version and plugin sdk
5. reactive settings
6. ClientProcessBuilder to support out-of-process
7. moved sarifs, test generation, code generation and TestGenerationReport to another process
EgorkaKulikov and others added 30 commits October 17, 2022 16:58
)

* Improve verification that static mocking is configured

* Wrap file reading with try/catch
)

Setup 222 versions for IntelliJ and plugins
Fix wrong import
Add try/catch temporary wrapping to obtain stacktrace
Update soot version (commit hash)
Get rid of commented lines, better logging added
…t private (UnitTestBot#1106)

* Wrap method reference into @link tag only if the invoked method is not private

* Fix tests
… editor (UnitTestBot#1105)

* Notify and reason to the user that UtBot can't be run on the edited class

* Improve previous implementation
1. added ability to set log level for EngineProcess and ChildProcess.kt. Look for related UtSettings.engineProcessLogLevel and UtSettings.childProcessLogLevels
2. opening additional packages to support jdk17+, see OpenModulesContainer
3. fixed using javaw on unix environments
4. fixed using readaction in dumb mode
…stBot#1065)

* Lessen thisInstance creation in parameterized test generation

* Avoid incorrect configuration

Co-authored-by: Egor Kulikov <egor.k.kulikov@gmail.com>
UnitTestBot#1116)

Fix settings persistence: we save IDs, thus we should parse IDs instead of display names
* Enable android support in kts

* Get rid of AS. Use the path only

* Better naming

* Corrected comment

* Commented Android Studio for other users

Co-authored-by: Denis Fokin <Denis.Fokin@gmail.com>
[utbot-rd]
fixing ubuntu process start and log creating
…t#1131)

Android Studio troubleshooting related to Lombok improved.
* Add parameterized test generation in ci

* Little style corrections

* Move *containsMocking* flag to UtSymbolicExecution

Co-authored-by: Egor Kulikov <egor.k.kulikov@gmail.com>
…stBot#1069)

* Added an initial solution

* Added a method and class references

* Refactor to avoid bugs with private methods

* Handled empty values

* Fixed tests and add a TODO ticket

* Fixed review comments
* Used real variable type after field access with reflection if possible

* Added missing line separator after single-line block comment

* Added missed initial field states for arrays

* Removed field state assertions for failing tests
* [utbot-rd]
more logs, dump mode fixes

* Pathseparator fix, removed useless scheduler
* [utbot-rd]
fixing long delays in summarization, fixing sarif reports resource root creation, fixing kryo serialization error, fixing idea thread relating problems

* [utbot-rd]
compilation fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.