1 00:00:07,449 --> 00:00:09,874 - Let's talk about high-level acceptance tests. 2 00:00:09,874 --> 00:00:12,112 You'll be specifying business facing tests that 3 00:00:12,112 --> 00:00:15,309 let your team know when you're done with each story. 4 00:00:15,309 --> 00:00:16,883 We call these acceptance tests. 5 00:00:16,883 --> 00:00:19,466 That's a pretty broad term, it can be confusing to people, 6 00:00:19,466 --> 00:00:22,872 but basically the acceptance criteria for 7 00:00:22,872 --> 00:00:24,598 doneness of a story. 8 00:00:24,598 --> 00:00:27,457 What is key about these tests is having the conversation. 9 00:00:27,457 --> 00:00:30,379 A user story is just a reminder to have a conversation, 10 00:00:30,379 --> 00:00:33,438 and so when we have these conversations we can talk about 11 00:00:33,438 --> 00:00:36,616 these acceptance criteria and how we're gonna test them. 12 00:00:36,616 --> 00:00:40,019 And the story plus the conversation we have about it, 13 00:00:40,019 --> 00:00:42,785 plus these acceptance tests that we write as a result 14 00:00:42,785 --> 00:00:46,421 helps us to have shared understanding on what to deliver. 15 00:00:46,421 --> 00:00:48,392 And again, we're focusing on what's valuable 16 00:00:48,392 --> 00:00:51,052 to the business, to the customers, to the end users. 17 00:00:51,052 --> 00:00:52,433 And at this point we're really 18 00:00:52,433 --> 00:00:55,254 talking about a high level of tests. 19 00:00:55,254 --> 00:00:59,077 Don't get too bogged down in details right now. 20 00:00:59,077 --> 00:01:01,797 The acceptance tests emerge from conversations, 21 00:01:01,797 --> 00:01:05,594 and the details will become detailed story tests later on. 22 00:01:05,594 --> 00:01:08,992 Try out some different approaches that we've covered. 23 00:01:08,992 --> 00:01:11,281 Using concrete examples is key. 24 00:01:11,281 --> 00:01:14,019 Really creating the detailed story tests, to when you start 25 00:01:14,019 --> 00:01:17,223 actually working on the stories during the iteration. 26 00:01:17,223 --> 00:01:20,532 Remember to include those real examples. 27 00:01:20,532 --> 00:01:24,478 So here's an example user story for our Pet Salon website. 28 00:01:24,478 --> 00:01:26,952 As Debbie Dog Owner, I want to enter my appointment 29 00:01:26,952 --> 00:01:30,033 information so that I know when to bring in my dog. 30 00:01:30,033 --> 00:01:31,637 Let's look at some acceptance tests 31 00:01:31,637 --> 00:01:33,336 we might write for this story. 32 00:01:33,336 --> 00:01:35,889 There are a lot of different styles to write acceptance 33 00:01:35,889 --> 00:01:38,102 tests, so here's an example of the behavior during 34 00:01:38,102 --> 00:01:41,412 development test, and it's just a happy past scenario. 35 00:01:41,412 --> 00:01:43,285 That's always where we wanna start. something valuable 36 00:01:43,285 --> 00:01:46,441 to the end user, to the customer, to the business. 37 00:01:46,441 --> 00:01:49,896 So the end user wants to easily confirm her appointment, 38 00:01:49,896 --> 00:01:52,792 and the salon owner wants to save time arranging 39 00:01:52,792 --> 00:01:55,388 the schedule, and the clients want pretty pets. 40 00:01:55,388 --> 00:01:58,652 Given, Debbie has viewed all available services 41 00:01:58,652 --> 00:02:00,263 and timeslots. 42 00:02:00,263 --> 00:02:03,322 When she enters her desired service and timeslot, 43 00:02:03,322 --> 00:02:05,916 then she sees her confirmed appointment. 44 00:02:05,916 --> 00:02:10,235 We also wanna think about maybe a misbehavior 45 00:02:10,235 --> 00:02:12,327 or a sad path acceptance test. 46 00:02:12,327 --> 00:02:15,361 We want to help end users fix their mistakes 47 00:02:15,361 --> 00:02:17,179 quickly and not get frustrated. 48 00:02:17,179 --> 00:02:19,432 That's really important to the pet salon. 49 00:02:19,432 --> 00:02:21,297 And also the pet salon may change 50 00:02:21,297 --> 00:02:23,500 their available services and timeslots. 51 00:02:23,500 --> 00:02:26,756 So we want this test to keep working to verify business 52 00:02:26,756 --> 00:02:29,105 roles, whatever those business roles are. 53 00:02:29,105 --> 00:02:31,521 And when we automate the test, we're gonna hide 54 00:02:31,521 --> 00:02:34,419 some of these details in lower levels of test code. 55 00:02:34,419 --> 00:02:36,406 So again, right now we're just 56 00:02:36,406 --> 00:02:38,817 ensuring that we meet the business needs. 57 00:02:38,817 --> 00:02:42,816 So in this case, given Debbie has viewed available services 58 00:02:42,816 --> 00:02:46,138 and timeslots, when she enters her desired service 59 00:02:46,138 --> 00:02:49,233 into a timeslot that shows as already book. 60 00:02:49,233 --> 00:02:51,677 Then she sees a helpful error message 61 00:02:51,677 --> 00:02:55,693 and she has the ability to choose an alternative timeslot. 62 00:02:55,693 --> 00:02:58,475 Another way to express acceptance tests 63 00:02:58,475 --> 00:03:01,759 is simply as bullet points or sentences. 64 00:03:01,759 --> 00:03:05,227 And some specification in automation tools can work 65 00:03:05,227 --> 00:03:07,742 with this format, or you can transform them into 66 00:03:07,742 --> 00:03:10,419 an appropriate format for your tools later on. 67 00:03:10,419 --> 00:03:12,636 And of course, if you're not gonna automate these tests, 68 00:03:12,636 --> 00:03:15,745 you don't yet have automation, you would do these manually. 69 00:03:15,745 --> 00:03:20,015 In any case, you still need these tests to guide you 70 00:03:20,015 --> 00:03:22,610 as your team is developing the stories. 71 00:03:22,610 --> 00:03:25,430 So you can see just different similar tests 72 00:03:25,430 --> 00:03:28,151 that we've just talked about, expressed as bullet points. 73 00:03:28,151 --> 00:03:29,786 For some business domains, 74 00:03:29,786 --> 00:03:32,586 a spreadsheet or tabular style works best. 75 00:03:32,586 --> 00:03:35,333 For example, in financial services companies, 76 00:03:35,333 --> 00:03:37,142 they use spreadsheets all the time, 77 00:03:37,142 --> 00:03:39,219 and there are lots of frameworks that support this, 78 00:03:39,219 --> 00:03:42,164 or you can build your own framework for testing. 79 00:03:42,164 --> 00:03:45,382 And they're easily turned into executable tests. 80 00:03:45,382 --> 00:03:48,806 In this case, if we wanted to automate these tests, we would 81 00:03:48,806 --> 00:03:52,992 have a test fixer method with the name TestTimeslot, 82 00:03:52,992 --> 00:03:56,194 that we will collaborate with the developers on to automate. 83 00:03:56,194 --> 00:03:58,576 We show the input parameters, 84 00:03:58,576 --> 00:04:00,911 which are Service option and Timeslot. 85 00:04:00,911 --> 00:04:02,982 Then we have an Expected result, whether or not the 86 00:04:02,982 --> 00:04:06,247 appointment should be confirmed, or see an error message. 87 00:04:06,247 --> 00:04:08,038 We can compare expected results 88 00:04:08,038 --> 00:04:09,781 with actual results later on. 89 00:04:09,781 --> 00:04:13,948 We're gonna talk about this process a lot more in Lesson 4.