1 00:00:00,000 --> 00:00:02,290 [No Audio] 2 00:00:02,290 --> 00:00:04,628 So the test now with Hamcrest, it's getting better. 3 00:00:04,628 --> 00:00:05,708 It's looking good. 4 00:00:05,708 --> 00:00:09,226 However, it's still not perfect and it can be improved. 5 00:00:09,226 --> 00:00:10,892 And the reason is because here 6 00:00:10,892 --> 00:00:13,834 we're actually invoking a production method. 7 00:00:13,834 --> 00:00:16,004 As we know, whenever we invoke methods which 8 00:00:16,004 --> 00:00:18,958 we've created, then there's scope for bugs. 9 00:00:18,958 --> 00:00:20,996 And not only that as well, you're losing that kind 10 00:00:20,996 --> 00:00:24,046 of scientific quality which you have in unit tests. 11 00:00:24,046 --> 00:00:25,566 We just involve one thing, which is the 12 00:00:25,568 --> 00:00:28,280 method you're testing and change different parts around 13 00:00:28,280 --> 00:00:30,164 it and observe what the effect is. 14 00:00:30,164 --> 00:00:32,780 If you have multiple methods from the same thing. 15 00:00:32,780 --> 00:00:34,424 So multiple methods from the production class 16 00:00:34,424 --> 00:00:36,104 which is being tested, then you've got 17 00:00:36,104 --> 00:00:37,628 extra things that can go wrong. 18 00:00:37,628 --> 00:00:40,124 So you don't have this kind of scientific quality. 19 00:00:40,124 --> 00:00:42,476 And you've kind of sacrificed that just for the sake of 20 00:00:42,476 --> 00:00:44,883 convenience, which is not a good road to go down. 21 00:00:44,883 --> 00:00:48,800 So rather than rely on the logic of create 22 00:00:48,800 --> 00:00:51,233 RegularUse, when we're constructing the objects 23 00:00:51,233 --> 00:00:54,358 that it's going to do its expectations against, instead 24 00:00:54,358 --> 00:00:56,442 of doing that, we can do a different thing and we 25 00:00:56,456 --> 00:00:59,424 can compose properties that we're expecting. 26 00:00:59,424 --> 00:01:01,611 And we'll see how to do that in the next video.