- Notifications
You must be signed in to change notification settings - Fork45
Extract Traverser from UtBotSymbolicEngine#307
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
8b50bb2 tof7359f3CompareUh oh!
There was an error while loading.Please reload this page.
utbot-framework/src/main/kotlin/org/utbot/engine/TraversalContext.kt OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/UtBotTestCaseGenerator.ktShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
utbot-framework/src/main/kotlin/org/utbot/engine/TraversalContext.kt OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
f7359f3 tof6bca78CompareThere 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.
LGTM
6679597 to5274326CompareThere 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.
Checked force mocks: no regression so far.
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.
Seems nice.
utbot-framework/src/main/kotlin/org/utbot/engine/ExecutionState.kt OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Convert Traversal functions to extension functions
5274326 to33c61d1Compare
Uh oh!
There was an error while loading.Please reload this page.
Description
Split the logic of
UtBotSymbolicEngineinto two classes:UtBotSymbolicEngineTraverserIntroduced new classes and some TODO stubs:
StateLabelis used for markingExecutionStateaccordingly to their status (INTERMIDIATE, CONCRETE, TERMINAL). See the comments in the code for more information.TraversalContextis a context during one Jimple instruction traversal. Now there are some TODO stubs for the future work.Refactored several relevant places with non-functional changes:
SymbolicResultinprocessResultFixes#259
Details
Previously
UtBotSymbolicEnginehad the complex logic of different types:The idea is to split some of the aspects of the engine logic into different classes. In this MR the extraction of Jimple traversal was done. Now we have two classes:
UtBotSymbolicEngine
Now
UtBotSymbolicEngineis a manager class. It's created once for one method analysis process. We can't reuse it for different methods. It sets up everything forTraverser, controls the flow of polling states from the queue and pushing new states to the queue and also processes terminal states.So now the next things are done in
UtBotSymbolicEngine:Traverser
Traverseris responsible for traversing the top instruction from the passedExecutionState. It's created insideUtBotSymbolicEngineand can't be reused between different methods ("method-under-test"s). The main function istraverse(state: ExecutionState): Collection<ExecutionState>which takes anExecutionStateand produces next states, so all other extra information needed for traversal should be passed via the constructor ofTraverser.Please note, that now it's
Traverserresponsibility to choose the right label for the nextExecutionState. ThenUtBotSymbolicEnginematches on this label and decides what to do with this state.So now the next things are done in
Traverser:Type of Change
How Has This Been Tested?
Automated Testing
Ran all tests in IDEA. No new test failures have been detected in this change.
Checklist: