Skip to content

Commit 82290ba

Browse files
committed
Improve english
1 parent 227319d commit 82290ba

File tree

1 file changed

+43
-42
lines changed

1 file changed

+43
-42
lines changed

resources/docs/UserDocumentation.md

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,93 @@
1-
# FamixDiff: User documentation
1+
# FamixDiff: User Documentation
22

3-
FamixDiff allows one to compute the diff between two Moose models representing two different versions of the same project. It will return a report containing the different kind of changes that happened between those two versions.
4-
To detect entities that got renamed or moved in the project, we are using some heuristics that can be parametrized (See section [Customize the analysis](#customize-the-analysis)).
3+
FamixDiff allows you to compute the difference between two Moose models representing two different versions of the same project. It returns a report containing the different types of changes that occurred between those two versions.
4+
To detect entities that have been renamed or moved in the project, we use heuristics that can be parameterized (see section [Customize the Analysis](#customize-the-analysis)).
55

6-
- [FamixDiff: User documentation](#famixdiff-user-documentation)
7-
- [Launch an analysis](#launch-an-analysis)
6+
- [FamixDiff: User Documentation](#famixdiff-user-documentation)
7+
- [Launch an Analysis](#launch-an-analysis)
88
- [Changes](#changes)
99
- [FamixDiffResult](#famixdiffresult)
10-
- [Customize the analysis](#customize-the-analysis)
11-
- [Possible evolutions](#possible-evolutions)
10+
- [Customize the Analysis](#customize-the-analysis)
11+
- [Possible Evolutions](#possible-evolutions)
1212

13-
## Launch an analysis
13+
## Launch an Analysis
1414

1515
Running a diff computation is as simple as:
1616

1717
```st
1818
| sourceModel targetModel |
19-
sourceModel := MooseModel root at: 1.
20-
targetModel := MooseModel root at: 2.
19+
sourceModel := MooseModel root at: 1.
20+
targetModel := MooseModel root at: 2
2121
22-
FXDiff runOnBaseModel: sourceModel targetModel: targetModel
22+
FXDiff runOnBaseModel: sourceModel targetModel: targetModel.
2323
```
2424

25-
This will return a `FamixDiffResult` containing changes. The different kind of changes will be explained in section [Changes](#changes) and the manipulation of the result will be explained in section [FamixDiffResult](#famixdiffresult).
25+
This will return a `FamixDiffResult` containing changes. The different types of changes are explained in the section [Changes](#changes), and the manipulation of the result is explained in the section [FamixDiffResult](#famixdiffresult).
2626

2727
## Changes
2828

29-
FamixDiff will produce different kind of results:
30-
- `FamixUnchangedChange`: This change represent an entity that is present in both the source and the target model with the same name and the same parents. /!\ It does not mean that this entity had no change at all. The source code of this entity might have changed. This is not yet covered by FamixDiff.
31-
- `FamixAddChange`: This represent an entity that is not present in the base model but present in the target model.
32-
- `FamixRemovalChange`: This represent an entity that is present in the base model but not in the target model.
33-
- `FamixMoveChange`: This represent an entity present in both the source and target model, but that have a different parent between both. This means that the entity is still here but has moved.
34-
- `FamixRenameChange`: This represent an entity that is present in both the source and target model but whose name changed.
29+
FamixDiff produces different types of results:
30+
- `FamixUnchangedChange`: This change represents an entity that is present in both the source and target models with the same name and the same parent. /!\ This does not mean that this entity has not changed at all. Its source code might have changed, but this is not yet covered by FamixDiff.
31+
- `FamixAddChange`: This represents an entity that is not present in the base model but is present in the target model.
32+
- `FamixRemovalChange`: This represents an entity that is present in the base model but not in the target model.
33+
- `FamixMoveChange`: This represents an entity present in both the source and target models but with a different parent in each. This means that the entity is still present but has moved.
34+
- `FamixRenameChange`: This represents an entity that is present in both the source and target models but has a different name.
3535

3636
## FamixDiffResult
3737

38-
A diff analysis will return a `FamixDiffResult`. This class is a collection of changes.
38+
A diff analysis returns a `FamixDiffResult`, which is a collection of changes.
3939

40-
It is possible to act on it as on any other collection.
40+
It can be manipulated like any other collection.
4141

42-
For example:
42+
For example:
4343

4444
```st
45-
result select: [ :change | change baseEntity name beginsWith: 'A' ].
45+
result select: [ :change | change baseEntity name beginsWith: 'A' ]
4646
```
4747

48-
But it also provides an APIto filter the changes. Each of the methods of this API will return a new `FamixDiffResult` with a subset of the changes. Be careful, this subset does not know its superset, so you might want to keep the original result if you wish to do multiple analysis.
48+
However, it also provides an API to filter the changes. Each method in this API returns a new `FamixDiffResult` containing a subset of the changes. Be careful: this subset does not retain a reference to its superset, so you may want to keep the original result if you wish to perform multiple analyses.
4949

50-
It is first possible to filter the changes by kind using:
50+
It is possible to filter changes by type using:
5151
- `#additions`
5252
- `#removals`
5353
- `#moves`
5454
- `#renames`
5555
- `#identities`
5656

57-
It is also possible to ask other filtering such as:
58-
- `#entityChanges`: Will return a result containing only the changes about entities and not about dependencies.
59-
- `#associationChanges`: Will return a result containing only the changes about associations (dependencies) and not about entities.
60-
- `#groupAdditionsAndRemovalsByRoots`: Will return a result removing additions and removals that are themselves into an addition or a removal. For example if a version is adding a package containing classes containing methods, it will only keep the change representing the addition of the package, and not the addition of the classes and methods.
61-
- `#realChanges`: This filters out the unchanged changes. Most of the time, diff analysis is used to analyses entities that changed. This method allows one to concentrate of those and not on the entities that did not change.
62-
- `#withoutStubs`: Filters out the stubs.
57+
Additional filtering options include:
58+
- `#entityChanges`: Returns only changes related to entities, excluding dependencies.
59+
- `#associationChanges`: Returns only changes related to associations (dependencies), excluding entities.
60+
- `#groupAdditionsAndRemovalsByRoots`: Removes additions and removals that are contained within another addition or removal. For example, if a version adds a package containing classes that contain methods, only the change representing the package addition is retained, not the additions of the classes and methods.
61+
- `#realChanges`: Filters out unchanged changes. Most of the time, diff analysis focuses on modified entities. This method allows you to concentrate on those and ignore entities that did not change.
62+
- `#withoutStubs`: Filters out stub entities.
6363

6464
Example:
6565

6666
```st
67-
result realChanges entityChanges withoutStub groupAdditionsAndRemovalsByRoots
67+
result realChanges entityChanges withoutStub groupAdditionsAndRemovalsByRoots.
6868
```
6969

70-
This will return a result without any stub, without changes about dependencies, without the `unchanged` changes and containing only the roots of the additions and removals.
70+
This returns a result without stubs, without dependency changes, without `unchanged` changes, and containing only the root additions and removals.
7171

72-
## Customize the analysis
72+
## Customize the Analysis
7373

74-
In order to detect the entities that got renamed or moved, we are comparing their content and their dependencies. For example, in the case of a Pharo class, we are comparing if the variables, methods, incoming dependencies and outgoing dependencies are the same to know if we renamed or moved two classes. But in general when we rename a class or move it, we can also do other changes which means that their children and dependencies will change a little. In order to take that into account we allow an error margin using a ratio of tolerence.
74+
To detect entities that have been renamed or moved, we compare their content and dependencies. For example, in the case of a Pharo class, we compare variables, methods, incoming dependencies, and outgoing dependencies to determine whether two classes are the same but renamed or moved. However, renaming or moving a class often involves additional modifications, meaning that children and dependencies may change slightly. To account for this, we allow an error margin using a tolerance ratio.
7575

76-
By default this tolerence is at 0.2. This means that if at least 80% of the children and dependencies are the same, we consider that the entity is the same and just got renamed or moved.
76+
By default, this tolerance is set to 0.2. This means that if at least 80% of the children and dependencies remain the same, we consider the entity to be the same and only renamed or moved.
7777

78-
This ratio can by changed:
78+
This ratio can be adjusted:
7979

8080
```st
8181
(FXDiff baseModel: sourceModel targetModel: targetModel)
82-
tolerence: 0.4;
82+
tolerance: 0.4;
8383
run
8484
```
8585

86-
With this snippet of code, we accept 40% of changed children and dependencies.
86+
With this snippet, we allow 40% of changed children and dependencies.
8787

88-
## Possible evolutions
88+
## Possible Evolutions
89+
90+
Some possible future developments for the project include:
91+
- Taking comments into account
92+
- Detecting internal changes to entities that are not related to renaming, moving, addition, or removal (e.g., changes in source code).
8993

90-
Some possible evolutions of the project are:
91-
- Take comments into account
92-
- Detect changes inside entities that are not renaming, moving, addition, removal. For example a change in the source code.

0 commit comments

Comments
 (0)