1 00:00:06,523 --> 00:00:09,988 - In this Stop and Think, we ask you to think of all 2 00:00:09,988 --> 00:00:13,017 the tests you could come up with for this story, 3 00:00:13,017 --> 00:00:16,833 and where they might fit in the test automation pyramid. 4 00:00:16,833 --> 00:00:19,903 So this story was, as Cindy, cat owner, 5 00:00:19,903 --> 00:00:23,517 I can see available groomers for a particular time slot 6 00:00:23,517 --> 00:00:25,338 to do a cat comb-out 7 00:00:25,338 --> 00:00:28,529 so I can choose my preferred cat specialist. 8 00:00:28,529 --> 00:00:30,238 Now one of the things we may need to do 9 00:00:30,238 --> 00:00:32,345 is to make some assumptions about the story 10 00:00:32,345 --> 00:00:34,031 just so we can go forward. 11 00:00:34,031 --> 00:00:35,563 And so one of the assumptions we might make 12 00:00:35,563 --> 00:00:40,129 is how long various things take, like the cat comb-out 13 00:00:40,129 --> 00:00:41,750 takes 30 minutes. 14 00:00:41,750 --> 00:00:42,583 - So you just... 15 00:00:42,583 --> 00:00:43,959 You want to make a note of that 16 00:00:43,959 --> 00:00:46,262 so that everybody has that in their mind. 17 00:00:46,262 --> 00:00:47,095 - Right. 18 00:00:47,095 --> 00:00:49,244 - So if we start thinking about the types of tests 19 00:00:49,244 --> 00:00:50,411 we want to do. 20 00:00:51,274 --> 00:00:53,635 Required fields, for example. 21 00:00:53,635 --> 00:00:57,802 Maybe there, in the user interface, we're doing that. 22 00:00:59,658 --> 00:01:04,297 So, maybe that's a required field test through the UI. 23 00:01:04,297 --> 00:01:06,104 - That depends on where we have the logic 24 00:01:06,104 --> 00:01:07,511 for those required tests. 25 00:01:07,511 --> 00:01:10,422 Some people might have them at the unit level. 26 00:01:10,422 --> 00:01:12,833 But, actually, I think for this application, 27 00:01:12,833 --> 00:01:15,745 because we want to help the user get that instant response, 28 00:01:15,745 --> 00:01:16,949 it doesn't-- - It might be up there. 29 00:01:16,949 --> 00:01:18,345 - Yeah. - You may even need it 30 00:01:18,345 --> 00:01:22,512 at both levels because you have validation here and here, 31 00:01:23,592 --> 00:01:24,797 or the database-- 32 00:01:24,797 --> 00:01:26,713 - For example, in the database, we want to make sure 33 00:01:26,713 --> 00:01:28,292 we don't try to put null values 34 00:01:28,292 --> 00:01:29,768 into fields that can't be null. 35 00:01:29,768 --> 00:01:32,481 So, I think that would definitely belong down here 36 00:01:32,481 --> 00:01:34,186 in the unit level. 37 00:01:34,186 --> 00:01:37,316 - So, we want to test that there's no groomers available, 38 00:01:37,316 --> 00:01:40,050 or if there is groomers, that they're existing. 39 00:01:40,050 --> 00:01:41,915 I think that they belong at the unit test level, 40 00:01:41,915 --> 00:01:45,021 because I think that they can check that right away. 41 00:01:45,021 --> 00:01:46,347 - My first instinct was the API, 42 00:01:46,347 --> 00:01:47,449 but I think you're right. 43 00:01:47,449 --> 00:01:50,175 I think the way that they're designing this architecture, 44 00:01:50,175 --> 00:01:51,883 that will be possible at the unit level, 45 00:01:51,883 --> 00:01:53,396 which we always want to push them down. 46 00:01:53,396 --> 00:01:56,488 - We want to push them as low as we can. 47 00:01:56,488 --> 00:01:58,216 - What about time format? 48 00:01:58,216 --> 00:02:00,783 - Oh, that's definitely a unit test level, I would think. 49 00:02:00,783 --> 00:02:02,141 - Whether we're gonna do 24-hour. 50 00:02:02,141 --> 00:02:02,974 - Right. - Okay. 51 00:02:02,974 --> 00:02:03,807 - I would definitely think. 52 00:02:03,807 --> 00:02:06,708 Even if it was being done at the UI, 53 00:02:06,708 --> 00:02:09,369 that's a unit test level. 54 00:02:09,369 --> 00:02:11,384 If the time slot's not available, 55 00:02:11,384 --> 00:02:12,860 booked by another user. 56 00:02:12,860 --> 00:02:14,504 - (inhales sharply) Oh, that's almost 57 00:02:14,504 --> 00:02:16,780 a concurrency problem, right? - Yeah. 58 00:02:16,780 --> 00:02:19,283 Or it might be two types of tests. 59 00:02:19,283 --> 00:02:21,572 One that says, "We can't book it," 60 00:02:21,572 --> 00:02:23,360 which would be at an API. 61 00:02:23,360 --> 00:02:25,727 But there might be another one that says, 62 00:02:25,727 --> 00:02:28,448 "Let's make sure it's grayed out or not available 63 00:02:28,448 --> 00:02:30,093 "at the UI level." 64 00:02:30,093 --> 00:02:31,132 - Right. - Possibly. 65 00:02:31,132 --> 00:02:32,490 - That's something we'll probably want to do 66 00:02:32,490 --> 00:02:36,490 exploratory testing around with concurrent users 67 00:02:37,552 --> 00:02:39,744 doing, working on the same time slots. 68 00:02:39,744 --> 00:02:40,577 - Yeah. 69 00:02:41,858 --> 00:02:46,246 - What about just making sure we have the correct groomers 70 00:02:46,246 --> 00:02:49,217 who are available listed out in the UI? 71 00:02:49,217 --> 00:02:50,132 Where would you put that test? 72 00:02:50,132 --> 00:02:52,633 - I might just do that as an exploratory test, actually. 73 00:02:52,633 --> 00:02:53,539 - Oh, okay. - Because the groomers 74 00:02:53,539 --> 00:02:54,622 might change. 75 00:02:55,538 --> 00:02:58,263 And maybe I would do that, possibly. 76 00:02:58,263 --> 00:02:59,096 - Okay. 77 00:02:59,096 --> 00:03:01,006 It could also maybe be an API test, 78 00:03:01,006 --> 00:03:02,860 if we have that data in the database. 79 00:03:02,860 --> 00:03:03,777 - Possibly. 80 00:03:04,810 --> 00:03:07,758 We want to make sure it works in all browsers. 81 00:03:07,758 --> 00:03:09,847 So you can kind of automate that, 82 00:03:09,847 --> 00:03:12,830 but it's kind of tricky, so I would think, 83 00:03:12,830 --> 00:03:15,420 for us, that we would just want to look at it 84 00:03:15,420 --> 00:03:17,438 as an exploratory test. 85 00:03:17,438 --> 00:03:20,337 - Yeah, there are some services that we could buy 86 00:03:20,337 --> 00:03:23,114 that would let us run those automated tests 87 00:03:23,114 --> 00:03:26,084 in all browsers, but this is such a small application. 88 00:03:26,084 --> 00:03:27,908 And the salon doesn't have a lot of money, 89 00:03:27,908 --> 00:03:31,205 so let's just stick to exploratory testing. 90 00:03:31,205 --> 00:03:33,118 And also, mobile browsers. 91 00:03:33,118 --> 00:03:35,271 Because we want this to work in mobile browsers as well. 92 00:03:35,271 --> 00:03:36,481 - Because people will definitely 93 00:03:36,481 --> 00:03:37,718 be doing that on their phones. 94 00:03:37,718 --> 00:03:38,992 - Right. 95 00:03:38,992 --> 00:03:41,895 - And then, of course, we have our work flow, 96 00:03:41,895 --> 00:03:45,646 which we want to probably do something 97 00:03:45,646 --> 00:03:48,540 through the user interface, full work flow. 98 00:03:48,540 --> 00:03:51,400 And we will supplement it with some exploratory tests. 99 00:03:51,400 --> 00:03:52,233 - Yeah. 100 00:03:52,233 --> 00:03:54,284 I would just want that to be a basic smoke test. 101 00:03:54,284 --> 00:03:56,215 Like, mostly happy path things. 102 00:03:56,215 --> 00:03:57,048 - Right. 103 00:03:57,048 --> 00:03:57,881 - Absolutely. 104 00:03:57,881 --> 00:04:00,839 - And similarly, I think maybe error handling, 105 00:04:00,839 --> 00:04:02,588 as part of that, maybe we could test 106 00:04:02,588 --> 00:04:03,988 some of the error handling. 107 00:04:03,988 --> 00:04:05,111 Would you do that there? 108 00:04:05,111 --> 00:04:07,989 - I would like to see it here or here, 109 00:04:07,989 --> 00:04:10,064 but we may want to do a little bit of exploratory tests 110 00:04:10,064 --> 00:04:11,754 just to make it showing up. 111 00:04:11,754 --> 00:04:13,401 - You think we could do it at the API level? 112 00:04:13,401 --> 00:04:14,651 - We might be able to do some through here 113 00:04:14,651 --> 00:04:15,931 to automate this way. 114 00:04:15,931 --> 00:04:16,791 - Okay. 115 00:04:16,791 --> 00:04:20,418 - So, as you can tell, there is no one right way. 116 00:04:20,418 --> 00:04:21,668 It's not magic. 117 00:04:23,145 --> 00:04:26,977 The important part of it is having that discussion. 118 00:04:26,977 --> 00:04:29,117 When you start talking with the programmers. 119 00:04:29,117 --> 00:04:30,732 Where are we putting these tests? 120 00:04:30,732 --> 00:04:32,153 Who's doing them? 121 00:04:32,153 --> 00:04:35,461 That will start to gain trust in your automation as well. 122 00:04:35,461 --> 00:04:37,404 - And help them design the code 123 00:04:37,404 --> 00:04:39,674 so that we can do the tests at the appropriate level. 124 00:04:39,674 --> 00:04:40,791 - Absolutely. 125 00:04:40,791 --> 00:04:44,096 - Next, we're gonna talk about how to start. 126 00:04:44,096 --> 00:04:45,816 Well, where to start, actually. 127 00:04:45,816 --> 00:04:48,733 And then how we're gonna get there.