Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dbeaf15
Add usvm engine option on UI
EgorkaKulikov Dec 11, 2023
8c4a3ea
Sens engine type data to engine process via Rd
EgorkaKulikov Dec 11, 2023
e1e7139
Use appropriate engine in flow
EgorkaKulikov Dec 11, 2023
3fc587e
Introduce `UtilMethodProviderPlaceholder` (#2717)
IlyaMuravjov Dec 13, 2023
5d68839
Make `TestCaseGenerator` use `UsvmSymbolicEngine` for entire class (#…
IlyaMuravjov Dec 13, 2023
24d1003
Initial implementation of usvm tests generation in UtBot flow
EgorkaKulikov Dec 18, 2023
4ad8c4a
Apply some improvements
EgorkaKulikov Dec 19, 2023
91803c2
Update usvm version and related updates in JcContainer
EgorkaKulikov Dec 19, 2023
7779a3b
Update usvm version and related updates in ClassScorer usages
EgorkaKulikov Dec 20, 2023
44f0c2a
Correct applyCommonMappings methods
EgorkaKulikov Dec 20, 2023
ce16821
Several UI corrections
EgorkaKulikov Dec 20, 2023
3b3ab15
Fix JcContainer caching
EgorkaKulikov Dec 20, 2023
3a0da82
Apply discussion fixes.
EgorkaKulikov Dec 21, 2023
cf23242
Fix enablement of useExperimentalEngine
EgorkaKulikov Dec 21, 2023
0108b05
Refactoring
tepa46 Dec 21, 2023
06529ea
Add assemble models in USVM symbolic engine
tepa46 Dec 21, 2023
aba7c4f
Update utResult value
tepa46 Dec 21, 2023
fe1cee7
Resrtore Python IDE
EgorkaKulikov Dec 22, 2023
351c10d
Do not initialize Jc-flow if timeout = 0
EgorkaKulikov Dec 22, 2023
aa84d2a
Fix `modificationsChain` mapping when removing `UtilMethodProviderPla…
IlyaMuravjov Dec 22, 2023
fd47bc7
Make `UtSymbolicExecution.copy` method also copy `containsMocking` field
IlyaMuravjov Dec 22, 2023
e30f887
Set `zip64 = true` in `:utbot-cli:jar` Gradle task
IlyaMuravjov Dec 22, 2023
c8fc4a5
Revert redundant refactoring
IlyaMuravjov Dec 22, 2023
c89b3b2
Use same `memoryScope` to resolve `uTest` and `symbolicResult`.
IlyaMuravjov Dec 22, 2023
8831369
Preserve identity when mapping `MissingState`
IlyaMuravjov Dec 22, 2023
392d784
Set `zip64 = true` in `:utbot-cli-go:jar`, `:utbot-cli-js:jar`, `:utb…
IlyaMuravjov Dec 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add usvm engine option on UI
  • Loading branch information
EgorkaKulikov committed Dec 22, 2023
commit dbeaf15317dd2023c69b81d48e187d5a2196714c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,30 @@ enum class ParametrizedTestSource(
}
}

enum class SymbolicEngineSource(
override val id: String,
override val displayName: String,
override val description: String = "Use $displayName symbolic engine"
) : CodeGenerationSettingItem {
UnitTestBot(
id = "UnitTestBot",
displayName = "UnitTestBot",
description = "Use UnitTestBot symbolic engine",
),
Usvm(
id = "USVM",
displayName = "USVM",
description = "Use USVM symbolic engine",
);

override fun toString(): String = id

companion object : CodeGenerationSettingBox {
override val defaultItem: SymbolicEngineSource = SymbolicEngineSource.UnitTestBot
override val allItems: List<SymbolicEngineSource> = SymbolicEngineSource.values().toList()
}
}

enum class ProjectType {
/**
* Standard JVM project without DI frameworks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.psi.KtFile
import org.utbot.common.PathUtil.fileExtension
import org.utbot.framework.SummariesGenerationType
import org.utbot.framework.UtSettings
import org.utbot.framework.codegen.domain.SymbolicEngineSource
import org.utbot.framework.plugin.api.ClassId
import org.utbot.framework.plugin.api.MockFramework
import org.utbot.framework.plugin.api.MockStrategyApi
Expand Down Expand Up @@ -77,6 +78,7 @@ class GenerateTestsModel(
lateinit var mockFramework: MockFramework
lateinit var staticsMocking: StaticsMocking
lateinit var parametrizedTestSource: ParametrizedTestSource
lateinit var symbolicEngineSource: SymbolicEngineSource
lateinit var runtimeExceptionTestsBehaviour: RuntimeExceptionTestsBehaviour
lateinit var hangingTestsTimeout: HangingTestsTimeout
var useTaintAnalysis: Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ import org.utbot.framework.codegen.domain.ParametrizedTestSource
import org.utbot.framework.codegen.domain.ProjectType
import org.utbot.framework.codegen.domain.SpringModule.*
import org.utbot.framework.codegen.domain.StaticsMocking
import org.utbot.framework.codegen.domain.SymbolicEngineSource
import org.utbot.framework.codegen.domain.TestFramework
import org.utbot.framework.codegen.domain.TestNg
import org.utbot.framework.plugin.api.MockStrategyApi
Expand Down Expand Up @@ -215,6 +216,8 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
}
private val parametrizedTestSources = JCheckBox("Parameterized tests")

private val useExperimentalEngine = JCheckBox("Experimental symbolic engine")

private lateinit var panel: DialogPanel

@Suppress("UNCHECKED_CAST")
Expand Down Expand Up @@ -412,6 +415,13 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
cell(testFrameworks)
}

row {
cell(useExperimentalEngine)
contextHelp("USVM symbolic engine will be used")
}.enabledIf(ComboBoxPredicate(springConfig) {
model.projectType == ProjectType.PureJvm
})

if (model.projectType == ProjectType.Spring) {
row("Spring configuration:") {
cell(springConfig)
Expand Down Expand Up @@ -705,6 +715,8 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
model.mockStrategy = mockStrategies.item
model.parametrizedTestSource =
if (parametrizedTestSources.isSelected) ParametrizedTestSource.PARAMETRIZE else ParametrizedTestSource.DO_NOT_PARAMETRIZE
model.symbolicEngineSource =
if (useExperimentalEngine.isSelected) SymbolicEngineSource.Usvm else SymbolicEngineSource.UnitTestBot

model.mockFramework = MOCKITO
model.staticsMocking = if (staticsMocking.isSelected) MockitoStaticMocking else NoStaticMocking
Expand Down Expand Up @@ -903,6 +915,9 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
parametrizedTestSources.isSelected = (settings.parametrizedTestSource == ParametrizedTestSource.PARAMETRIZE
&& model.projectType == ProjectType.PureJvm)

useExperimentalEngine.isSelected = (settings.symbolicEngineSource == SymbolicEngineSource.Usvm
&& model.projectType == ProjectType.PureJvm)

codegenLanguages.item = model.codegenLanguage

val installedTestFramework = TestFramework.allItems.singleOrNull { it.isInstalled }
Expand Down Expand Up @@ -1212,6 +1227,18 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
updateControlsEnabledStatus()
}

useExperimentalEngine.addActionListener {_ ->
if (useExperimentalEngine.isSelected) {
mockStrategies.isEnabled = false
mockStrategies.item = MockStrategyApi.NO_MOCKS

staticsMocking.isEnabled = false
staticsMocking.isSelected = false
} else {
updateControlsEnabledStatus()
}
}

springTestType.addActionListener { event ->
val comboBox = event.source as ComboBox<*>
val item = comboBox.item as SpringTestType
Expand Down Expand Up @@ -1382,7 +1409,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
}

private fun updateControlsEnabledStatus() {
mockStrategies.isEnabled = true
mockStrategies.isEnabled = !useExperimentalEngine.isSelected

updateParametrizationEnabled()
updateStaticMockEnabled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import java.util.concurrent.CompletableFuture
import kotlin.reflect.KClass
import org.utbot.common.isWindows
import org.utbot.framework.SummariesGenerationType
import org.utbot.framework.codegen.domain.SymbolicEngineSource
import org.utbot.framework.codegen.domain.UnknownTestFramework
import org.utbot.framework.plugin.api.SpringTestType
import org.utbot.framework.plugin.api.isSummarizationCompatible
Expand Down Expand Up @@ -66,6 +67,7 @@ class Settings(val project: Project) : PersistentStateComponent<Settings.State>
var forceStaticMocking: ForceStaticMocking = ForceStaticMocking.defaultItem,
var treatOverflowAsError: TreatOverflowAsError = TreatOverflowAsError.defaultItem,
var parametrizedTestSource: ParametrizedTestSource = ParametrizedTestSource.defaultItem,
var symbolicEngineSource: SymbolicEngineSource = SymbolicEngineSource.defaultItem,
var classesToMockAlways: Array<String> = Mocker.defaultSuperClassesToMockAlwaysNames.toTypedArray(),
var springTestType: SpringTestType = SpringTestType.defaultItem,
var springConfig: String = SpringConfig.defaultItem,
Expand Down Expand Up @@ -98,6 +100,7 @@ class Settings(val project: Project) : PersistentStateComponent<Settings.State>
if (forceStaticMocking != other.forceStaticMocking) return false
if (treatOverflowAsError != other.treatOverflowAsError) return false
if (parametrizedTestSource != other.parametrizedTestSource) return false
if (symbolicEngineSource != other.symbolicEngineSource) return false
if (!classesToMockAlways.contentEquals(other.classesToMockAlways)) return false
if (springTestType != other.springTestType) return false
if (springConfig != other.springConfig) return false
Expand All @@ -124,6 +127,7 @@ class Settings(val project: Project) : PersistentStateComponent<Settings.State>
result = 31 * result + forceStaticMocking.hashCode()
result = 31 * result + treatOverflowAsError.hashCode()
result = 31 * result + parametrizedTestSource.hashCode()
result = 31 * result + symbolicEngineSource.hashCode()
result = 31 * result + classesToMockAlways.contentHashCode()
result = 31 * result + springTestType.hashCode()
result = 31 * result + springConfig.hashCode()
Expand Down Expand Up @@ -174,6 +178,8 @@ class Settings(val project: Project) : PersistentStateComponent<Settings.State>

val parametrizedTestSource: ParametrizedTestSource get() = state.parametrizedTestSource

val symbolicEngineSource: SymbolicEngineSource get() = state.symbolicEngineSource

val classesToMockAlways: Set<String> get() = state.classesToMockAlways.toSet()

val springTestType: SpringTestType get() = state.springTestType
Expand Down