Skip to content

Commit 7dddbc5

Browse files
author
Victor Samoilov
committed
Fix spelling
1 parent 65c70f9 commit 7dddbc5

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

docs/jlearch/execution-state-changes.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ classDiagram
2626

2727
`StateAnalyticsProperties` maintains properties of `ExecutionState`, which don't need for symbolic execution, but need for `JLearch`.
2828

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.
3333
* `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.
3434
* `executingTime: Long` - amount of time, during which this state was traversed.
3535
* `reward: Double?` - calculated reward of this state
3636
* `features: List<Double>` - list of extracted features for this state
3737

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.
3939

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`.
4141
* `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.

docs/jlearch/jlearch-architecture.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This diagram doesn't illustrate some details, so read them below.
6565

6666
# FeatureProcessor
6767

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.
6969

7070
* `dumpFeatures(state: ExecutionState)` - dump features and rewards in some format on disk. Called at the end of traverse in `UtBotSymbolicEngine`
7171

@@ -115,28 +115,28 @@ classDiagram
115115

116116
Maintains calculation of reward.
117117

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)`.
119119

120120
## FeatureProcessorWithStatesRepetition
121121

122122
* `onVisit(state: ExecutionState)` - extractFeatures for state
123123
* `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`.
126126

127127
# FeatureExtractor
128128

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.
131131

132132
# NNStateRewardPredictor
133133

134134
Interface for reward predictors. Now it has two implementations in `analytics` module:
135135

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.
138138

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.
140140

141141

142142
# NNStateRewardGuidedSelector
@@ -149,4 +149,4 @@ We have two different implementantions:
149149

150150
# EngineAnalyticsContext
151151

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.

docs/jlearch/new-heuristical-path-selectors.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ classDiagram
3030
```
3131
`Subpath` = `List<Edge>`
3232

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`
3434

3535
* `onVisit(state: ExecutionState)` - we calculate subpath of this state and increment its frequency on `1`
3636
* `subpathCount(state: ExecutionState)` - we calculate subpath of this state and return its frequency
@@ -45,7 +45,7 @@ classDiagram
4545

4646
Inspired by [paper](http://pxzhang.cn/paper/concolic_testing/oopsla13-pgse.pdf).
4747

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.
4949

5050
# StatementStatistics
5151

@@ -66,11 +66,11 @@ classDiagram
6666
TraverseGraphStatistics o-- InterProceduralUnitGraph
6767
```
6868

69-
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`.
7070

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`.
7474

7575
# CPInstSelector
7676

@@ -89,5 +89,5 @@ classDiagram
8989
ForkDepthSelector --|> NonUniformRandomSearch
9090
```
9191

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.
9393

0 commit comments

Comments
 (0)