1 00:00:07,132 --> 00:00:09,570 - We've had lots of experiences where 2 00:00:09,570 --> 00:00:12,078 teams have had bad automation practices, 3 00:00:12,078 --> 00:00:14,610 so we'll share a couple of ours right now. 4 00:00:14,610 --> 00:00:17,320 In one team that I was at, the business people 5 00:00:17,320 --> 00:00:21,438 themselves are not product owners or SMEs, 6 00:00:21,438 --> 00:00:24,078 or Subject Matter Experts, they were the ones 7 00:00:24,078 --> 00:00:26,152 doing the automation, they were getting 8 00:00:26,152 --> 00:00:27,953 pretty good at it, they liked it, 9 00:00:27,953 --> 00:00:30,101 they were using a Fit style tool. 10 00:00:30,101 --> 00:00:31,514 We had done a homegrown one, 11 00:00:31,514 --> 00:00:34,327 but it was very much like Fit. 12 00:00:34,327 --> 00:00:36,749 The problem was exposed when that test 13 00:00:36,749 --> 00:00:39,463 started running longer, and longer, 14 00:00:39,463 --> 00:00:42,125 it started taking the whole night, 15 00:00:42,125 --> 00:00:44,093 running it every night, so they started 16 00:00:44,093 --> 00:00:46,663 running them in parallel, broke them up into suites. 17 00:00:46,663 --> 00:00:48,164 That helped for a little bit, 18 00:00:48,164 --> 00:00:50,010 but then it started getting worse. 19 00:00:50,010 --> 00:00:52,170 So I got the team to start looking 20 00:00:52,170 --> 00:00:55,000 at the tests in a different way, 21 00:00:55,000 --> 00:00:57,463 to start looking at why they were 22 00:00:57,463 --> 00:01:00,404 taking so long, started reviewing them. 23 00:01:00,404 --> 00:01:02,811 We found out there were a lot of duplications 24 00:01:02,811 --> 00:01:05,888 because the people who were automating 25 00:01:05,888 --> 00:01:08,384 don't have test automation experience. 26 00:01:08,384 --> 00:01:10,868 So they would just write up a new one. 27 00:01:10,868 --> 00:01:14,600 They also had a lot of details that didn't belong. 28 00:01:14,600 --> 00:01:16,592 So when we were trying to debug, 29 00:01:16,592 --> 00:01:20,492 we didn't know what was actually causing the failure. 30 00:01:20,492 --> 00:01:24,848 So we invested some time, we actually had somebody, 31 00:01:24,848 --> 00:01:27,741 one of the business users was a little tech savvy, 32 00:01:27,741 --> 00:01:31,066 so she took it on, and she put in a month's worth 33 00:01:31,066 --> 00:01:33,629 of work, so it was a man month's worth of work. 34 00:01:33,629 --> 00:01:35,709 She started cleaning up the tests, 35 00:01:35,709 --> 00:01:37,773 eliminating duplication, taking out 36 00:01:37,773 --> 00:01:42,452 some of those incidental details as I call them, 37 00:01:42,452 --> 00:01:46,880 we cut our test's run down into half the time. 38 00:01:46,880 --> 00:01:49,339 So that was a big win. 39 00:01:49,339 --> 00:01:52,928 But the bigger win was the ease of maintenance. 40 00:01:52,928 --> 00:01:55,306 We were able to now find out, and look at a test, 41 00:01:55,306 --> 00:01:57,440 and say, "I know why it failed," 42 00:01:57,440 --> 00:01:59,586 and we could correct it easy. 43 00:01:59,586 --> 00:02:01,677 What about you, Lisa? 44 00:02:01,677 --> 00:02:03,776 - Well, with your story, it's just kind of like 45 00:02:03,776 --> 00:02:06,682 with Legacy code, you can rescue tests 46 00:02:06,682 --> 00:02:08,372 that aren't necessarily the best 47 00:02:08,372 --> 00:02:10,099 and get some value out of them. 48 00:02:10,099 --> 00:02:13,460 You don't always have to just toss them out. 49 00:02:13,460 --> 00:02:15,754 In my case, I was working on a team 50 00:02:15,754 --> 00:02:18,189 with no automated tests at all, 51 00:02:18,189 --> 00:02:22,256 and as I said, the developers were taking some time 52 00:02:22,256 --> 00:02:23,864 to learn test driven involvement, 53 00:02:23,864 --> 00:02:27,021 took them several months to really get traction on that. 54 00:02:27,021 --> 00:02:29,194 So we didn't, we were all doing the manual 55 00:02:29,194 --> 00:02:31,716 regression testing scripts, every iteration, 56 00:02:31,716 --> 00:02:33,072 and that was painful. 57 00:02:33,072 --> 00:02:37,117 So, I have decent coding skills, I was a programmer before, 58 00:02:37,117 --> 00:02:41,162 and so I wrote some smoke tests through the UI, 59 00:02:41,162 --> 00:02:44,317 using a pretty simple tool to do that, 60 00:02:44,317 --> 00:02:47,450 and I did a pretty good job of designing them, 61 00:02:47,450 --> 00:02:50,496 except that I feel victim to chaining the test 62 00:02:50,496 --> 00:02:51,696 'cause it was very difficult 63 00:02:51,696 --> 00:02:53,964 to set up the data for the test. 64 00:02:53,964 --> 00:02:55,213 And I was like, "Well, as long as I've got 65 00:02:55,213 --> 00:02:57,242 "this test user doing this, let's have 66 00:02:57,242 --> 00:02:59,007 "them do all these other things 67 00:02:59,007 --> 00:03:00,184 " 'cause the data's all set up." 68 00:03:00,184 --> 00:03:03,568 So we had chain tests that were dependent on each other. 69 00:03:03,568 --> 00:03:07,408 And that worked for a while, but as we changed 70 00:03:07,408 --> 00:03:10,446 the application, those tests became harder 71 00:03:10,446 --> 00:03:12,330 and harder to debug when they failed 72 00:03:12,330 --> 00:03:15,655 because, step number 40 failed, and it was 73 00:03:15,655 --> 00:03:18,665 because of something that happened up in step number five. 74 00:03:18,665 --> 00:03:21,450 So we actually had to invest time, 75 00:03:21,450 --> 00:03:24,448 we actually had to stop for two or three weeks, 76 00:03:24,448 --> 00:03:26,538 and not deliver any new features 77 00:03:26,538 --> 00:03:27,725 because you can't really deliver 78 00:03:27,725 --> 00:03:30,208 new features with, you can't change their test 79 00:03:30,208 --> 00:03:32,269 while you're delivering new features. 80 00:03:32,269 --> 00:03:34,192 So we re-factored those tests so that each 81 00:03:34,192 --> 00:03:36,330 test script had one, clear purpose, 82 00:03:36,330 --> 00:03:39,461 and when they failed, we knew what had happened. 83 00:03:39,461 --> 00:03:42,246 And we got help from the developers to do that. 84 00:03:42,246 --> 00:03:45,354 So, it's hard to ask for helps sometimes 85 00:03:45,354 --> 00:03:49,144 and admit that you don't necessarily know the answers. 86 00:03:49,144 --> 00:03:52,133 - Yes, as you can see, we all make mistakes. 87 00:03:52,133 --> 00:03:54,221 Don't get hung up about it. 88 00:03:54,221 --> 00:03:57,638 Automation is hard to do well, but learn. 89 00:03:58,829 --> 00:04:01,360 My example with those business users, 90 00:04:01,360 --> 00:04:03,856 once we cleaned them up, I took the time 91 00:04:03,856 --> 00:04:07,661 to teach them what to do so we didn't run into that again. 92 00:04:07,661 --> 00:04:10,650 You learned not to chain your tests. 93 00:04:10,650 --> 00:04:13,337 Automation really is hard to do well. 94 00:04:13,337 --> 00:04:14,935 But there are some simple ways 95 00:04:14,935 --> 00:04:19,071 you can get benefits, and an easier learning curve. 96 00:04:19,071 --> 00:04:21,053 So we'll finish off this lesson 97 00:04:21,053 --> 00:04:23,911 on automation with some quick wins.