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
You can read this as a trace of the operations: the counter started off in state `0`, then using operation `inc` when to state `1`, then using operation `dec`
114
+
went to state `0` and so on.
112
115
113
-
You can read this as a trace of the operations: the counter started off in state `0`, then using operation `inc` when to state `1`, then using operation `dec`
114
-
went to state `0` and so on.
116
+
This sequence is first generated using the model only, i.e. no operations are actually applied to any `Counter` objects. After generating a full trace, the operations
117
+
are actually applied to the system under test, using the `Operation.Check` methods of the various `Operation` objects.
115
118
116
-
This sequence is first generated using the model only, i.e. no operations are actually applied to any `Counter` objects. After generating a full trace, the operations
117
-
are actually applied to the system under test, using the `Operation.Check` methods of the various `Operation` objects.
119
+
If a failing test is found, FsCheck will attempt to remove operations from the sequence of operations, as long as the test still fails. So in the example above,
120
+
although the original sequence contains a few superfluous operations, FsCheck normally finds a shorter if not the shortest sequence that leads to the failure.
118
121
119
-
If a failing test is found, FsCheck will attempt to remove operations from the sequence of operations, as long as the test still fails. So in the example above,
120
-
although the original sequence contains a few superfluous operations, FsCheck normally finds a shorter if not the shortest sequence that leads to the failure.
121
-
*)
122
+
Final tip: make the model class immutable. This makes it easier to reason about the model and the operations on it, and it also makes it easier to write the `Check` methods.
123
+
If the model is mutable, you MUST make sure that the result of `Run` is a new instance of the model that you don't modify later on. FsCheck captures these results
124
+
during the test run and during shrinking, and relies on them not changing.
Copy file name to clipboardExpand all lines: docs/index.fsx
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,14 @@ Documentation
29
29
* [Running Tests](RunningTests.html) explains various ways to run FsCheck tests and how to
30
30
integrate with unit testing frameworks.
31
31
32
+
* [Model based testing](StatefulTestingNew.html), for testing stateful systems and objects. Since this is in the Experimental namespace, semantic versioning promises do not apply to this part of the API.
33
+
32
34
* [Tips and tricks](TipsAndTricks.html)
33
35
34
36
* [API Reference](reference/index.html) contains automatically generated documentation for all types, modules
35
37
and functions.
36
38
37
-
* [Model based testing vNext (Experimental)](StatefulTestingNew.html) is a relatively new addition for
38
-
a more powerful model based testing. It's still a bit rough around the edges, some things may not
39
-
work, and it is subject to change (i.e. no promises regarding semantic versioning and breaking changes). Regardless,
0 commit comments