You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/jlearch/execution-state-changes.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,16 +26,16 @@ classDiagram
26
26
27
27
`StateAnalyticsProperties` maintains properties of `ExecutionState`, which don't need for symbolic execution, but need for `JLearch`.
28
28
29
-
*`depth: Int` - number of forks on state's path excluded current state, if it is fork. In this case, fork is a state with more than one successors excluded implicit `NPE` branches.
30
-
*`visitedAfterLastFork: Int` - number of `stmt`, that was visited by `states` on this state's path after last fork in first time.
31
-
*`visitedBeforeLastFork: Int` - number of `stmt`, that was visited by `states` on this state's path before last fork in first time.
32
-
*`stmtsSinceLastCovered: Int` - number of `states` on this state's path after last state that visited any `stmt` in first time.
29
+
*`depth: Int` - number of forks on the state's path excluded current state, if it is fork. In this case, fork is a state with more than one successor excluded implicit `NPE` branches.
30
+
*`visitedAfterLastFork: Int` - number of `stmt`, that was visited by `states` on this state's path after the last fork in first time.
31
+
*`visitedBeforeLastFork: Int` - number of `stmt`, that was visited by `states` on this state's path before the last fork in first time.
32
+
*`stmtsSinceLastCovered: Int` - number of `states` on this state's path after the last state that visited any `stmt` in first time.
33
33
*`parent: ExecutionState?` - parent of current `state`. If `UtSettings.featureProcess == false`, then it is always null, because we don't need this field in this case. If it is not null, then we can't delete `state` until all successors of this state will be deleted, which may cause memory issue.
34
34
*`executingTime: Long` - amount of time, during which this state was traversed.
35
35
*`reward: Double?` - calculated reward of this state
36
36
*`features: List<Double>` - list of extracted features for this state
37
37
38
-
Field with `successor` prefix is used for constructor of successor properties.
38
+
Field with `successor` prefix is used for a constructor of successor properties.
39
39
40
-
*`updateIsFork()` - set `isFork` on true. This method called when traversing of `stmt`produce more than one explicit state. Now it may be during traversing of `IfStmt`, `SwitchStmt`, `AssignStmt` or `InvokeStmt`.
40
+
*`updateIsFork()` - set `isFork` on true. This method is called when traversing of `stmt`produces more than one explicit state. Now it may be during the traversing of `IfStmt`, `SwitchStmt`, `AssignStmt` or `InvokeStmt`.
41
41
*`updateIsCoveredNew()` - set `isVisitedNew` on true, set `stmtsSinceLastCovered` on zero and increase `visitedAfterLastFork` on 1. This method is called in `UtBotSymbolicEngine` after new state `s` is polled and `s.stmt` was not visited yet.
Copy file name to clipboardExpand all lines: docs/jlearch/jlearch-architecture.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ This diagram doesn't illustrate some details, so read them below.
65
65
66
66
# FeatureProcessor
67
67
68
-
It is interface in framework-module, that allow to use implementation from analytics module.
68
+
It is interface in framework-module, that allows to use implementation from analytics module.
69
69
70
70
*`dumpFeatures(state: ExecutionState)` - dump features and rewards in some format on disk. Called at the end of traverse in `UtBotSymbolicEngine`
71
71
@@ -115,28 +115,28 @@ classDiagram
115
115
116
116
Maintains calculation of reward.
117
117
118
-
*`calculateRewards(List<TestCase>): Map<Int, Double>` - calculates `coverage` for each state and `time` for each state. `Coverage` - sum of `newCoverage` by `TestCase` that contain its state. `Time` - sum of `state.executingTime` by all states, that has this state on its path. Then calculates `reward(coverage, time)`.
118
+
*`calculateRewards(List<TestCase>): Map<Int, Double>` - calculates `coverage` for each state and `time` for each state. `Coverage` - sum of `newCoverage` by `TestCase` that contains its state. `Time` - sum of `state.executingTime` by all states, that has this state on its path. Then calculates `reward(coverage, time)`.
119
119
120
120
## FeatureProcessorWithStatesRepetition
121
121
122
122
*`onVisit(state: ExecutionState)` - extractFeatures for state
123
123
*`onTraversed(state: ExecutionState)` - create `TestCase`, so we go from `state` to `state.parent` while it is not root, for each `state` on path add its features to `dumpedStates`, calculate coverage of its `TestCase`, increment `generatedTestCases` on 1 and add new `TestCase` in `testCases`.
124
-
*`dumpFeatures()` - call `RewardEstimator.calculateRewards()` and write `csv` file for each `TestCase` in format: `newCov,features,reward` for each `state` in it. `newCov` - flag that indicates whether this `TestCase` cover something new or not. So in this approach, each `state` will be written as many times as number of `TestCase` that has it.
125
-
For creating `FeatureExtractor` it uses `FeatureExtractorFactory` from `EngineAnalyticsContext`.
124
+
*`dumpFeatures()` - call `RewardEstimator.calculateRewards()` and write `csv` file for each `TestCase` in format: `newCov,features,reward` for each `state` in it. `newCov` - flag that indicates whether this `TestCase` cover something new or not. So in this approach, each `state` will be written as many times as the number of `TestCase` that has it.
125
+
For creating `FeatureExtractor`, it uses `FeatureExtractorFactory` from `EngineAnalyticsContext`.
126
126
127
127
# FeatureExtractor
128
128
129
-
It is interface in framework-module, that allow to use implementation from analytics module.
130
-
*`extractFeatures(state: ExecutionState)` - create features list for state and store it in `state.features`. Now we extract all features, which was described in [paper](https://files.sri.inf.ethz.ch/website/papers/ccs21-learch.pdf). In feature, we can extend feature list by other features, for example, NeuroSMT.
129
+
It is interface in framework-module, that allows to use implementation from analytics module.
130
+
*`extractFeatures(state: ExecutionState)` - create features list for state and store it in `state.features`. Now we extract all features, which were described in [paper](https://files.sri.inf.ethz.ch/website/papers/ccs21-learch.pdf). In feature, we can extend the feature list by other features, for example, NeuroSMT.
131
131
132
132
# NNStateRewardPredictor
133
133
134
134
Interface for reward predictors. Now it has two implementations in `analytics` module:
135
135
136
-
*`NNStateRewardPredictorSmile`: it uses our own format to store feedforward neural network and it uses `Smile` library to do multiplication of matrix.
137
-
*`NNStateRewardPredictorTorch`: it assumed that model is any type of model in `pt` format. It uses `Deep Java library` to use such models.
136
+
*`NNStateRewardPredictorSmile`: it uses our own format to store feedforward neural network, and it uses `Smile` library to do multiplication of matrix.
137
+
*`NNStateRewardPredictorTorch`: it assumed that a model is any type of model in `pt` format. It uses the`Deep Java library` to use such models.
138
138
139
-
It should be created at the beginning of work and stored at `Predictors` class to be used in `NNRewardGuidedSelector` from `framework` module.
139
+
It should be created at the beginning of work and stored at `Predictors` class to be used in `NNRewardGuidedSelector` from the `framework` module.
140
140
141
141
142
142
# NNStateRewardGuidedSelector
@@ -149,4 +149,4 @@ We have two different implementantions:
149
149
150
150
# EngineAnalyticsContext
151
151
152
-
It is object that should be filled by factories in the beginning of work to allow objects from `framework` module using objects from `analytics` module.
152
+
It is an object that should be filled by factories in the beginning of work to allow objects from the`framework` module using objects from `analytics` module.
Copy file name to clipboardExpand all lines: docs/jlearch/new-heuristical-path-selectors.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ classDiagram
30
30
```
31
31
`Subpath` = `List<Edge>`
32
32
33
-
This class maintains frequency of each subpath with length `2^index`, which is presented as `List<Edge>`, on certain instance of `InterproceduralUnitGraph`
33
+
This class maintains frequency of each subpath with length `2^index`, which is presented as `List<Edge>`, in a certain instance of `InterproceduralUnitGraph`
34
34
35
35
*`onVisit(state: ExecutionState)` - we calculate subpath of this state and increment its frequency on `1`
36
36
*`subpathCount(state: ExecutionState)` - we calculate subpath of this state and return its frequency
@@ -45,7 +45,7 @@ classDiagram
45
45
46
46
Inspired by [paper](http://pxzhang.cn/paper/concolic_testing/oopsla13-pgse.pdf).
47
47
48
-
We override `ExecutionState.weight` as `-StatementStatistics.subpathCount(this)`, so we pick `state`, which `subpath` is less traveled.
48
+
We override `ExecutionState.weight` as `-StatementStatistics.subpathCount(this)`, so we pick the `state`, which `subpath` is less traveled.
This class maintains frequency of each `Stmt` and number of `Stmt`, that was visited in some `SootMethod`, on certain instance of `InterproceduralUnitGraph`.
69
+
This class maintains frequency of each `Stmt` and number of `Stmt`, that was visited in some `SootMethod`, on a certain instance of `InterproceduralUnitGraph`.
70
70
71
-
*`onVisit(state: ExecutionState)` - increment frequency of state's `stmt` on 1. If we visit this `stmt` for the first time, then increment number of `Stmt`, that we visit in current state's `method`, on 1.
72
-
*`statementCount(state: ExecutionState)` - get frequency of state's `stmt`
73
-
*`statementsInMethodCount(state: ExecutionState)` - get number of `stmt`, that was visited in current state's `method`.
71
+
*`onVisit(state: ExecutionState)` - increment frequency of state's `stmt` on 1. If we visit this `stmt` for the first time, then increment number of `Stmt`, that we visit in the current state's `method`, on 1.
72
+
*`statementCount(state: ExecutionState)` - get a frequency of state's `stmt`
73
+
*`statementsInMethodCount(state: ExecutionState)` - get number of `stmt`, that was visited in the current state's `method`.
74
74
75
75
# CPInstSelector
76
76
@@ -89,5 +89,5 @@ classDiagram
89
89
ForkDepthSelector --|> NonUniformRandomSearch
90
90
```
91
91
92
-
Override `ExecutionState.cost` as `ExecutionState.depth`, so we are more likely to explore the least deep `state` in terms of number of forks on its path.
92
+
Override `ExecutionState.cost` as `ExecutionState.depth`, so we are more likely to explore the least deep `state` in terms of the number of forks on its path.
0 commit comments