File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,16 +20,13 @@ of real objects.
2020
2121** Stub**
2222
23- A stub method is a method that just returns a simple but valid
24- (though not necessarily correct) result.
23+ A stub is a method that just returns a simple but valid (though not necessarily correct) result.
2524
26- Stubs are made when building the infrastructure and we do not
27- want to spend time on every method needed right now. Instead we create stubs
28- so everything compiles and our IDE's auto-complete knows about the methods
25+ During the development of a software system, we do not need every method right now. Instead we
26+ create stubs so everything compiles and our IDE's auto-complete knows about the methods
2927we plan to use.
3028
31- Stubs are using in mocking as well. We supply stub methods instead of the normal
32- dependency through dependency injection which return fixed results and then ensure
33- that the code does the right thing with them.
34- This isolates testing to the code we are trying to test and means we do not need
35- to spin up a database just to run those tests.
29+ Stubs are using in mocking as well. We supply stub methods instead of the normal methods which
30+ return fixed results and then ensure that the code does the right thing with them.
31+ This isolates testing to the code we are trying to test. For instance, we do not need
32+ to spin up a database or have an online service working just to run those tests.
You can’t perform that action at this time.
0 commit comments