1 00:00:01,140 --> 00:00:02,920 So, let's do this, let's light this candle. 2 00:00:04,060 --> 00:00:06,840 So, we're going to talk about extreme programming using open source tools. 3 00:00:07,920 --> 00:00:10,620 Alright, and I'm Matt, and this is Luis. 4 00:00:11,140 --> 00:00:14,560 That's our contact infos, if you want to talk to us later or whatever. 5 00:00:14,760 --> 00:00:16,900 We're doing two talks, Luis is doing three. 6 00:00:17,740 --> 00:00:19,440 He's a bigger slut than I am. 7 00:00:20,680 --> 00:00:24,600 But, we're doing two talks around this kind of area of discussion. 8 00:00:24,800 --> 00:00:25,980 So, this one's about extreme programming. 9 00:00:25,980 --> 00:00:33,680 We're going to talk about a project that we open sourced from our black hat class that we taught for four days. 10 00:00:35,040 --> 00:00:40,300 And, this is kind of an introduction to that project from the perspective of how the project was developed. 11 00:00:40,860 --> 00:00:54,300 And, what we're going to show you is how to write really fucking badass security tools using kind of common sense engineering instead of like jerking off into a jar and then releasing open source and expecting people to respect you. 12 00:01:01,460 --> 00:01:02,340 No names. 13 00:01:05,480 --> 00:01:09,060 Alright, so I'm Matt, and I've done speaking and writing. 14 00:01:09,180 --> 00:01:13,800 Last time I spoke at DEF CON was in 2000 or 99. 15 00:01:14,020 --> 00:01:15,060 DEF CON 8, I think. 16 00:01:15,600 --> 00:01:16,040 2000. 17 00:01:16,440 --> 00:01:20,500 And, at that time, Luis and I did back-to-back presentations. 18 00:01:21,340 --> 00:01:25,780 And so, I talked about testing IDSs and firewalls using open source tools. 19 00:01:27,080 --> 00:01:32,980 And, how to find exploitable bugs in firewalls and IDSs and other protocol parsing type things. 20 00:01:33,300 --> 00:01:35,140 And, not a whole lot has changed since then. 21 00:01:35,300 --> 00:01:43,000 But, even so, I'm going to talk about something different instead of rehashing the thing I talked about seven years ago, unlike some people. 22 00:01:44,280 --> 00:01:47,720 So, in that time, we released several exploitable security advisories. 23 00:01:48,120 --> 00:01:50,040 Luis and I worked together on a lot of that kind of stuff. 24 00:01:50,760 --> 00:01:52,000 One of them was... 25 00:01:54,680 --> 00:01:55,900 What was one of them? 26 00:01:57,200 --> 00:01:57,720 NetBSD. 27 00:01:58,060 --> 00:01:59,680 What was it? ICMP something? 28 00:01:59,860 --> 00:02:02,320 Oh, yeah. NetBSD, unaligned ICMP option. 29 00:02:02,400 --> 00:02:04,400 We found one packet that would crash. 30 00:02:04,880 --> 00:02:07,260 NetBSD, OpenBSD, or FreeBSD was one packet. 31 00:02:07,460 --> 00:02:08,520 That was kind of fun. 32 00:02:09,140 --> 00:02:10,440 IE5 on UNIX. 33 00:02:11,820 --> 00:02:16,100 Oh, and exploitable bug in Trillian 3.1. 34 00:02:16,180 --> 00:02:17,820 Or, any version of Trillian, really. 35 00:02:18,780 --> 00:02:20,900 And so, various security advisories. 36 00:02:20,920 --> 00:02:25,180 Basically, we know what we're talking about on the exploitable side of the house. 37 00:02:26,780 --> 00:02:30,140 And so, this might seem a little bit fruity, this whole extreme programming thing, 38 00:02:30,340 --> 00:02:34,700 but we're coming from a perspective of deep reverse engineering and very deep technical stuff. 39 00:02:35,140 --> 00:02:40,280 And so, I've worked a lot on product stuff, on security products. 40 00:02:40,560 --> 00:02:43,140 I worked on network security scanners a long time ago. 41 00:02:43,380 --> 00:02:47,760 I worked on one of the first hybrid host-based intrusion detection systems. 42 00:02:47,960 --> 00:02:49,420 That was a little bit too ahead of its time. 43 00:02:49,660 --> 00:02:52,340 And, of course, everyone's like, why would I put an IDS on my host? 44 00:02:52,660 --> 00:02:55,620 And, of course, now that's a gazillion dollar market. 45 00:02:55,620 --> 00:03:00,680 I also contribute a lot to open source and I fund a good deal of open source development. 46 00:03:01,040 --> 00:03:06,380 One of the things I'm funding right now is a PlayStation 2 emulator so I can play it on my Xbox 47 00:03:06,380 --> 00:03:08,940 because I don't want to give Sony a dime and I want to play Katamari. 48 00:03:10,500 --> 00:03:16,660 So, I've been doing extreme programming and natural software development for a little over four years now. 49 00:03:17,000 --> 00:03:19,240 And honing that and getting better and better at it. 50 00:03:19,860 --> 00:03:25,200 And so, I'm going to talk from the perspective of a lot of experience with seeing what goes wrong 51 00:03:25,620 --> 00:03:27,460 and course corrections and things like that. 52 00:03:28,420 --> 00:03:29,540 You can talk about yourself. 53 00:03:34,480 --> 00:03:35,640 So, my name is Luis. 54 00:03:35,960 --> 00:03:38,280 I do a lot of reversing work. 55 00:03:38,700 --> 00:03:44,440 I'm doing another talk here at DEF CON on how to combine disassemblers and debuggers together 56 00:03:44,440 --> 00:03:49,220 to maximize your results, feedback everything from your debugger back into your disassembly 57 00:03:49,220 --> 00:03:51,340 and create this kind of loop of information. 58 00:03:51,820 --> 00:03:54,720 And I've done a lot of hardware and software reversing. 59 00:03:55,620 --> 00:03:58,980 I've worked on different projects, some with Matt and other security projects. 60 00:03:59,360 --> 00:04:04,540 But really, I'm here today to talk about my experiences just starting out doing agile development. 61 00:04:04,740 --> 00:04:09,860 This whole project that we've been working on, I started coding it about four weeks ago. 62 00:04:10,100 --> 00:04:13,960 I'd never touched C-sharp or any type of XP programming before. 63 00:04:14,380 --> 00:04:19,920 And I was just giving some customer tests by Matt and based the whole project around that. 64 00:04:20,300 --> 00:04:24,440 And I thought XP programming was retarded. 65 00:04:24,540 --> 00:04:25,600 Like when I first started programming, I was like, 66 00:04:25,600 --> 00:04:25,940 I don't know if I should have started doing it. 67 00:04:26,260 --> 00:04:32,260 I just thought it was all these really simple tests and it's just like people wasting time 68 00:04:32,260 --> 00:04:34,040 instead of like really doing coding. 69 00:04:34,300 --> 00:04:40,480 But as we'll go through this talk, I'll talk about how my opinions have changed. 70 00:04:40,860 --> 00:04:46,620 And part of it, there's this great quote from Office Space when they're in the car 71 00:04:46,620 --> 00:04:50,840 and they just found out that they got like, I don't know, like $300,000 in their bank account. 72 00:04:51,040 --> 00:04:52,920 And they're only supposed to be taking out pennies a day, right? 73 00:04:53,200 --> 00:04:55,180 And the Michael Bolton guy says, 74 00:04:56,460 --> 00:04:58,420 I always mess up the mundane details. 75 00:04:59,300 --> 00:05:01,200 And that's what this is all about. 76 00:05:01,400 --> 00:05:03,300 This gets rid of all those little bugs. 77 00:05:03,500 --> 00:05:05,160 So I'm going to hand it back off to Matt. 78 00:05:09,620 --> 00:05:12,060 All right, quick agenda thing. 79 00:05:12,260 --> 00:05:15,720 I got to like deep throat this mic for this to work. 80 00:05:15,800 --> 00:05:16,900 It's really strange. 81 00:05:19,220 --> 00:05:20,920 Anyways, so extreme programming. 82 00:05:21,160 --> 00:05:23,580 We're going to talk about stories, which I know sounds really gay, 83 00:05:23,720 --> 00:05:25,500 but you'll understand in a second. 84 00:05:25,600 --> 00:05:28,220 Why it's useful to think about features in this way. 85 00:05:28,940 --> 00:05:32,600 Pair programming, test driven development, incremental design and continuous integration. 86 00:05:33,480 --> 00:05:38,480 And some of the tools that you can use to do remote pair programming and things like that. 87 00:05:38,880 --> 00:05:43,860 And I use these tools a very little bit with Luis leading up to the class 88 00:05:44,180 --> 00:05:45,620 when he was basically done with the code. 89 00:05:45,880 --> 00:05:49,560 And I've also used them when working with outsourced engineers basically 90 00:05:49,560 --> 00:05:54,180 to pair with outsourced engineers and do XP with people who are really far away. 91 00:05:54,180 --> 00:05:58,040 And so this is how this can kind of apply to open source projects 92 00:05:58,040 --> 00:06:02,140 where there's kind of a time disparity between members of the project. 93 00:06:03,140 --> 00:06:07,780 And then we're going to do a quick demo on the involving the code 94 00:06:07,780 --> 00:06:14,080 that the open source project we talked about that analyzes x86 binary code 95 00:06:14,080 --> 00:06:16,620 to find exploitable security vulnerabilities automatically. 96 00:06:17,180 --> 00:06:20,720 And again, there's a second talk where we're going to go way deep down into that tool. 97 00:06:20,860 --> 00:06:24,060 But this talk is more about the process of developing that tool. 98 00:06:24,180 --> 00:06:25,660 Even so, you're going to get a glimpse of it. 99 00:06:27,220 --> 00:06:27,580 Yeah? 100 00:06:27,920 --> 00:06:28,480 All right. 101 00:06:30,280 --> 00:06:31,320 So extreme programming. 102 00:06:31,820 --> 00:06:35,340 Main thing with extreme programming in all Agile software development is you have short release cycles. 103 00:06:35,460 --> 00:06:39,640 There's this open source thing of release early and release often I think is what it is or whatever. 104 00:06:39,940 --> 00:06:42,260 That came from extreme programming in Agile software development. 105 00:06:42,500 --> 00:06:44,060 That wasn't like an incredibly new thing. 106 00:06:44,720 --> 00:06:46,820 And it seems to work really well in the open source world 107 00:06:46,820 --> 00:06:48,720 because you get a tight kind of feedback loop. 108 00:06:48,760 --> 00:06:50,320 You find bugs sooner, et cetera, et cetera. 109 00:06:50,400 --> 00:06:53,540 Your users get a hold of it if they really want to and what have you. 110 00:06:54,220 --> 00:06:59,820 I think some people, a lot of open source projects sort of just release without even thinking about it. 111 00:06:59,940 --> 00:07:04,600 And so it's frustrating to the users because you go download something that supposedly fixes it. 112 00:07:04,640 --> 00:07:07,760 You have to go download like the daily snapshot or nightly snapshot that fixes a bug. 113 00:07:07,880 --> 00:07:11,480 It turns out it won't even run because it just crashes when it starts because they don't do any testing. 114 00:07:12,080 --> 00:07:16,840 But anyway, that's really one of the things Agile software development is all about is release early, release often. 115 00:07:17,020 --> 00:07:21,180 And there's a concept of weekly releases and quarterly releases, quote unquote. 116 00:07:21,460 --> 00:07:24,100 And what they mean by weekly releases is, 117 00:07:24,100 --> 00:07:29,280 basically, you want to plan to have a complete, fully tested working release every week, 118 00:07:29,340 --> 00:07:33,800 maybe two weeks or depending on whatever, three to four weeks, but no more than a month. 119 00:07:34,820 --> 00:07:38,300 And by doing this, basically, you always make sure the code is always releasable 120 00:07:38,300 --> 00:07:41,520 and you basically have to maintain a very high level of quality to make this happen. 121 00:07:41,720 --> 00:07:45,580 Otherwise, you're going to go to release and you're just going to be tripping over your own dick the whole time, 122 00:07:45,680 --> 00:07:50,380 fixing little bugs and other things because you weren't keeping a firm control of quality. 123 00:07:50,660 --> 00:07:53,100 And this is the exact problem that commercial software has. 124 00:07:54,100 --> 00:07:58,000 People respond to simple security bugs where you look at the disassembly, you're like, 125 00:07:58,140 --> 00:08:00,020 why don't they just release a patch and fix this? 126 00:08:00,260 --> 00:08:02,160 It's because they don't have good quality processes. 127 00:08:02,900 --> 00:08:07,180 And so hopefully, for the love of God, the open source community can not make the same mistakes 128 00:08:07,180 --> 00:08:11,200 that the closed source commercial community makes, one would hope. 129 00:08:12,020 --> 00:08:15,540 Quarter releases, so you want to use weekly releases, but then you want to batch things together 130 00:08:15,540 --> 00:08:21,820 in a conceptual continuity package of, here we're adding little features every week to, I don't know, 131 00:08:21,920 --> 00:08:23,600 say like, add VoIP support 132 00:08:23,600 --> 00:08:25,360 to some Jabber client, let's say. 133 00:08:25,640 --> 00:08:30,100 And then at the end of that, you're going to do an official release with everything packaged together 134 00:08:30,100 --> 00:08:32,180 and really well integrated, et cetera, et cetera. 135 00:08:32,520 --> 00:08:36,300 And so you want to kind of plan like, okay, in three months, we're going to do a release of this Jabber client 136 00:08:36,300 --> 00:08:37,500 with VoIP support, let's say. 137 00:08:38,120 --> 00:08:41,340 And then you figure, okay, how are we going to get there, release, you know, little release, 138 00:08:41,500 --> 00:08:43,740 little iteration by little iteration until we are done. 139 00:08:45,700 --> 00:08:51,480 So the other thing with extreme programming in Azure Software Development, documentation that is not in code, 140 00:08:51,680 --> 00:08:53,140 i.e., that is not code. 141 00:08:53,600 --> 00:08:59,420 i.e., you have to update documentation every time you change your code is a waste of time. 142 00:09:00,220 --> 00:09:05,740 Because A, you have to waste time not coding and you have to keep your documentation up to date 143 00:09:05,740 --> 00:09:07,140 if your documentation isn't in code. 144 00:09:07,580 --> 00:09:14,800 And B, if you don't do that, your documentation is worthless at best and misleading at worst. 145 00:09:15,580 --> 00:09:20,340 I don't know if anybody here has ever seen some like, open source API documentation that's totally wrong. 146 00:09:20,340 --> 00:09:27,080 Or read a book, like I was reading a book on cruise control, which is an automated build thing. 147 00:09:27,260 --> 00:09:34,420 And the book was wrong because they were going off of the docs of cruise control and the cruise control docs were wrong. 148 00:09:34,640 --> 00:09:37,100 And that irritated the piss out of me. 149 00:09:38,360 --> 00:09:43,840 So if documentation isn't in code and tests and you're on an open source project and you're trying to move fast, 150 00:09:44,260 --> 00:09:48,780 you're basically slowing yourself down if you don't put your documentation in your code. 151 00:09:49,900 --> 00:09:51,680 Automated tests show progress, basically. 152 00:09:52,200 --> 00:09:56,320 So, you know, if you have automated system tests, and we'll talk about that in a second, 153 00:09:56,420 --> 00:09:59,340 for a feature, you know you're done with that feature when that test passes. 154 00:09:59,680 --> 00:10:05,000 Otherwise, you can continue to just like, you know, like mentally masturbate or whatever 155 00:10:05,000 --> 00:10:08,780 and do all kinds of things that have nothing to do with closing the feature down and getting the feature done. 156 00:10:09,020 --> 00:10:13,680 It's really irritating when your users are waiting for a feature from open source or closed source project 157 00:10:13,680 --> 00:10:18,760 or fix a security bug or a security patch and you can't close it down because there's nothing to focus on. 158 00:10:18,780 --> 00:10:23,040 And so we're going to talk about doing the simplest thing that could possibly work and having tests, 159 00:10:23,720 --> 00:10:26,180 having automated tests focus your work a great deal. 160 00:10:27,160 --> 00:10:32,120 The other thing is evolutionary design is the concept of big design up front or BDUF as it is called. 161 00:10:32,360 --> 00:10:35,480 And so there's two kind of ways I've seen open source projects go. 162 00:10:35,560 --> 00:10:39,920 Either it's all a design and there's no code whatsoever and you're busy like tweaking a design, 163 00:10:40,060 --> 00:10:43,860 this utopian design for God's own whatever it is that you're working on. 164 00:10:44,100 --> 00:10:48,760 Or you shit out code constantly and that doesn't mean there's no cohesion, there's no coherence, 165 00:10:48,780 --> 00:10:49,500 it doesn't make any sense. 166 00:10:49,940 --> 00:10:54,180 Either extreme is really bad and so extreme programming has an approach that basically 167 00:10:54,180 --> 00:10:58,520 and agile development has an approach where you let a design emerge by doing things intelligently. 168 00:10:58,760 --> 00:11:00,160 And you think about it a little bit. 169 00:11:00,280 --> 00:11:06,680 It's not no design, it's the least amount of design that you can do and still produce really good code basically. 170 00:11:07,940 --> 00:11:15,440 The other thing is XP and agile development balances short term instincts and long term kind of needs basically. 171 00:11:15,620 --> 00:11:18,140 Long term needs are code that's not shit. 172 00:11:18,780 --> 00:11:21,780 Or stuff that doesn't crash when you run it. 173 00:11:21,880 --> 00:11:24,260 Or happy users or whatever. 174 00:11:24,940 --> 00:11:27,560 Where short term instincts are we have to get this feature done now. 175 00:11:27,720 --> 00:11:29,200 We have to get this security patch out now. 176 00:11:29,700 --> 00:11:33,900 And how do you balance these two things in a meaningful way without sort of shirking either one. 177 00:11:34,200 --> 00:11:40,020 How do you be responsive without fucking your design to the point where you're going to have to rewrite it from scratch for instance. 178 00:11:41,520 --> 00:11:46,820 And also between all these things like pair programming and test driven development and all those things, 179 00:11:46,940 --> 00:11:47,780 you have no fear. 180 00:11:47,780 --> 00:11:53,000 How many people here have worked on code or worked on a product or worked on whatever where people say things like 181 00:11:53,000 --> 00:11:57,040 you know I could fix that but I'm afraid I might break something. 182 00:11:57,260 --> 00:11:58,160 How many people have heard that? 183 00:11:59,120 --> 00:11:59,560 Yeah. 184 00:12:00,260 --> 00:12:01,560 That's fucking bogus. 185 00:12:01,760 --> 00:12:02,200 Alright. 186 00:12:02,860 --> 00:12:04,500 That's a position of helplessness. 187 00:12:05,100 --> 00:12:06,480 And that's fucked up. 188 00:12:06,600 --> 00:12:08,540 I don't like to be in a position of helplessness. 189 00:12:08,760 --> 00:12:10,960 Especially when it comes to code I just fucking wrote. 190 00:12:11,400 --> 00:12:17,680 And so no, even on an open source project no one should be able to like take away your position of kind of safety or security. 191 00:12:17,680 --> 00:12:18,720 From that perspective. 192 00:12:19,340 --> 00:12:23,060 And this is again where a lot of commercial software companies are where they're like they can't do anything. 193 00:12:23,220 --> 00:12:24,620 It's not because of bureaucracy necessarily. 194 00:12:24,800 --> 00:12:26,900 It's because they're scared of their code. 195 00:12:27,140 --> 00:12:28,540 They don't know all the nooks and crannies. 196 00:12:28,660 --> 00:12:29,640 They don't have automated tests. 197 00:12:29,740 --> 00:12:30,640 They didn't do a pair programming. 198 00:12:31,320 --> 00:12:33,520 So the fearlessness makes us bam. 199 00:12:33,620 --> 00:12:35,600 How many people here know Aqua Teen Hunger Force? 200 00:12:36,500 --> 00:12:37,660 Aqua Teen Hunger Force? 201 00:12:38,040 --> 00:12:40,860 So there is an episode called Super Computer. 202 00:12:41,220 --> 00:12:44,360 So anybody seen this episode of Aqua Teen? 203 00:12:44,520 --> 00:12:45,200 Three people. 204 00:12:45,400 --> 00:12:45,800 Alright. 205 00:12:46,380 --> 00:12:47,960 There's three real fans in the audience. 206 00:12:48,680 --> 00:12:52,260 So Frolok wanted to name the super computer Oogie McTar. 207 00:12:52,600 --> 00:12:54,380 Which is a Klingon name. 208 00:12:54,620 --> 00:12:58,120 And Shake's suggestion was to call it Badass Mother 4000. 209 00:12:59,460 --> 00:13:00,960 Twice as fast as your ass. 210 00:13:01,600 --> 00:13:04,660 When you do XP it'll seem like you're going slow at first. 211 00:13:04,840 --> 00:13:05,600 But here's the thing. 212 00:13:05,640 --> 00:13:07,700 With all these things in place you move fucking fast. 213 00:13:07,980 --> 00:13:08,480 Like that. 214 00:13:08,740 --> 00:13:09,860 And you're always coding. 215 00:13:09,980 --> 00:13:10,660 You're not debugging. 216 00:13:10,840 --> 00:13:12,080 You're doing like worthless shit. 217 00:13:12,340 --> 00:13:13,400 It feels really great. 218 00:13:13,640 --> 00:13:14,860 So it seems slow at first. 219 00:13:14,860 --> 00:13:15,880 But basically what it is. 220 00:13:15,900 --> 00:13:17,320 It allows you to move very, very quickly. 221 00:13:17,480 --> 00:13:19,600 Because you don't have any fear you're going to break something. 222 00:13:19,980 --> 00:13:21,120 Or that, you know, whatever. 223 00:13:28,420 --> 00:13:30,760 So stories are a short description of an end user goal. 224 00:13:31,140 --> 00:13:32,220 An end user goal like. 225 00:13:32,820 --> 00:13:33,960 Here's a small C program. 226 00:13:34,340 --> 00:13:38,120 I want to detect the exploitable format string bug in this particular program. 227 00:13:38,400 --> 00:13:39,160 That's a story. 228 00:13:39,740 --> 00:13:40,180 Right. 229 00:13:40,540 --> 00:13:42,660 And basically what it comes from the perspective is. 230 00:13:42,760 --> 00:13:44,100 What does the user. 231 00:13:44,100 --> 00:13:44,920 What's the user goal. 232 00:13:45,000 --> 00:13:46,200 What's the user trying to accomplish. 233 00:13:46,580 --> 00:13:46,940 Right. 234 00:13:47,480 --> 00:13:48,180 In like. 235 00:13:48,520 --> 00:13:50,140 What's like their primary goal basically. 236 00:13:50,520 --> 00:13:51,580 And it sounds obvious. 237 00:13:51,680 --> 00:13:52,940 But if you don't start from this point. 238 00:13:53,100 --> 00:13:53,320 And you're like. 239 00:13:53,440 --> 00:13:53,800 Yeah. 240 00:13:54,500 --> 00:13:55,400 Avoid Jabber client. 241 00:13:55,620 --> 00:13:57,240 Never mind how people might want to use it. 242 00:13:57,460 --> 00:13:57,820 Right. 243 00:13:57,880 --> 00:13:59,860 And then you make it so it's embedded on a USB key. 244 00:14:00,000 --> 00:14:01,320 And you have to like hook it up to like. 245 00:14:01,500 --> 00:14:01,720 You know. 246 00:14:01,720 --> 00:14:03,660 Two tin cans connected with string for it to work. 247 00:14:03,980 --> 00:14:04,900 This is what happens. 248 00:14:05,240 --> 00:14:05,600 Right. 249 00:14:05,660 --> 00:14:06,960 Well intentioned. 250 00:14:06,960 --> 00:14:07,380 You know. 251 00:14:07,400 --> 00:14:08,860 This would be a really cool tool. 252 00:14:09,000 --> 00:14:09,860 This would be really cool. 253 00:14:10,020 --> 00:14:10,420 You know, whatever. 254 00:14:10,620 --> 00:14:11,440 Or library or whatever. 255 00:14:11,440 --> 00:14:14,000 If you don't think about like how it's actually going to be used. 256 00:14:14,580 --> 00:14:16,500 Which a lot of people seemingly don't. 257 00:14:16,600 --> 00:14:18,340 You're going to produce something that no one wants to use. 258 00:14:18,540 --> 00:14:19,540 And then you just wasted your time. 259 00:14:19,600 --> 00:14:20,580 And a whole bunch of other people's time. 260 00:14:20,960 --> 00:14:22,320 I personally don't like to do that. 261 00:14:22,400 --> 00:14:23,160 Maybe other people do. 262 00:14:23,300 --> 00:14:24,040 But probably not. 263 00:14:25,260 --> 00:14:26,360 So you take this story. 264 00:14:26,460 --> 00:14:26,640 And you're like. 265 00:14:26,720 --> 00:14:26,900 Okay. 266 00:14:26,940 --> 00:14:27,560 How, you know. 267 00:14:27,560 --> 00:14:29,080 How hard is this basically. 268 00:14:29,260 --> 00:14:31,720 Instead of estimating in terms of hours or days or whatever. 269 00:14:32,000 --> 00:14:33,580 You say how hard is this going to be. 270 00:14:33,660 --> 00:14:35,080 So XP has a concept of points. 271 00:14:35,500 --> 00:14:36,820 Or you can call it whatever you want. 272 00:14:36,940 --> 00:14:38,480 Just don't use a time based thing. 273 00:14:38,560 --> 00:14:38,640 Say. 274 00:14:38,800 --> 00:14:40,680 Oh this is one difficulty point. 275 00:14:40,760 --> 00:14:41,420 This is two difficulty points. 276 00:14:41,440 --> 00:14:42,700 This is three difficulty points. 277 00:14:43,340 --> 00:14:43,460 Right. 278 00:14:43,720 --> 00:14:45,500 And so over time you start to figure out. 279 00:14:45,540 --> 00:14:47,540 Oh one difficulty point over time. 280 00:14:47,660 --> 00:14:48,440 You know averaged out. 281 00:14:48,520 --> 00:14:50,560 Takes about eight hours. 282 00:14:50,940 --> 00:14:51,460 Let's say. 283 00:14:51,620 --> 00:14:52,100 Or whatever. 284 00:14:52,460 --> 00:14:53,420 But it's all points. 285 00:14:53,560 --> 00:14:54,100 It's all abstract. 286 00:14:54,360 --> 00:14:55,520 You don't want to like force people to think. 287 00:14:55,580 --> 00:14:56,900 Oh God I've got to get it done in two days. 288 00:14:57,000 --> 00:14:58,900 Otherwise like I look lame or whatever. 289 00:14:59,260 --> 00:15:00,060 This is one of the things. 290 00:15:00,180 --> 00:15:04,860 This is a total trap of software estimation by days or by hours or whatever. 291 00:15:05,200 --> 00:15:06,740 Because as you get closer and closer. 292 00:15:06,780 --> 00:15:08,140 You start taking more and more shortcuts. 293 00:15:08,300 --> 00:15:10,960 So you can meet some deadline that doesn't really matter. 294 00:15:10,960 --> 00:15:13,500 Where the thing that matters is delivering working high quality code. 295 00:15:13,640 --> 00:15:15,560 As opposed to meeting a deadline or winning a race. 296 00:15:17,520 --> 00:15:18,840 Hypothetically speaking and this varies. 297 00:15:19,080 --> 00:15:21,060 Each story should take one to two days at the most. 298 00:15:21,260 --> 00:15:21,580 Right. 299 00:15:21,760 --> 00:15:23,400 If a story is like. 300 00:15:23,520 --> 00:15:27,540 If you can't think of like a way that the story might be completed in like one to two days. 301 00:15:27,900 --> 00:15:29,160 It means it's too big of a story. 302 00:15:29,200 --> 00:15:29,940 You need to split it up. 303 00:15:30,100 --> 00:15:31,320 So instead of like the story is. 304 00:15:31,380 --> 00:15:33,060 We need to have a Jabber Voip client. 305 00:15:33,720 --> 00:15:34,740 That's kind of a big story. 306 00:15:34,800 --> 00:15:36,420 You're not going to finish that in two days most likely. 307 00:15:36,800 --> 00:15:37,780 I don't care who you are. 308 00:15:38,020 --> 00:15:40,920 At least not with high quality and with tests and what have you. 309 00:15:44,060 --> 00:15:46,240 So you have to kind of like learn to break it up. 310 00:15:46,480 --> 00:15:51,360 What's the minimal incremental step we could take that would deliver value basically. 311 00:15:51,420 --> 00:15:52,720 That would be kind of useful. 312 00:15:53,020 --> 00:15:53,420 Right. 313 00:15:53,500 --> 00:15:56,080 Even if it's not releasable to the general public or whatever. 314 00:15:56,220 --> 00:15:57,580 Something we can get started with. 315 00:15:57,720 --> 00:15:58,660 That's like the seed of whatever. 316 00:15:59,080 --> 00:15:59,480 Right. 317 00:15:59,500 --> 00:16:04,320 So maybe like how about just like you know connecting to the Voip network. 318 00:16:04,540 --> 00:16:06,220 Or connecting to the Jabber network or whatever. 319 00:16:06,480 --> 00:16:08,420 Or finishing the first Voip exchange. 320 00:16:08,560 --> 00:16:09,680 Never mind the codex. 321 00:16:09,680 --> 00:16:10,860 Just finishing the handshake. 322 00:16:10,960 --> 00:16:11,720 Or whatever. 323 00:16:12,180 --> 00:16:14,460 And so breaking things up into these little kind of pieces. 324 00:16:14,680 --> 00:16:17,140 And then when you like when you have these pieces you're focused on. 325 00:16:17,240 --> 00:16:18,920 And you make sure they work 100 percent. 326 00:16:19,120 --> 00:16:21,940 Instead of trying to like throw together an entire system all at once. 327 00:16:22,660 --> 00:16:24,560 That's how you make sure that your code is really high quality. 328 00:16:24,740 --> 00:16:27,100 And everything works incrementally as a unit. 329 00:16:27,500 --> 00:16:29,320 Instead of trying to throw it all together at once. 330 00:16:31,480 --> 00:16:34,360 And so the other thing that you do with stories is. 331 00:16:34,460 --> 00:16:35,780 You come up with an automated test. 332 00:16:35,920 --> 00:16:37,140 A way you can automatically test. 333 00:16:37,800 --> 00:16:39,320 And that test fails. 334 00:16:39,660 --> 00:16:40,640 And when you are done. 335 00:16:40,960 --> 00:16:43,240 Implementing the functionality that you're trying to do. 336 00:16:43,560 --> 00:16:44,680 The test passes. 337 00:16:45,000 --> 00:16:46,720 So you know when you're done. 338 00:16:46,920 --> 00:16:49,920 And so you can focus on doing the simplest thing that could possibly work. 339 00:16:50,320 --> 00:16:51,520 To make that pass. 340 00:16:51,780 --> 00:16:53,540 Sometimes that involves cheating. 341 00:16:54,220 --> 00:16:55,620 But we'll talk about that in a minute. 342 00:16:56,120 --> 00:16:58,500 And so in this context how do you deal with bugs. 343 00:16:58,880 --> 00:17:00,420 Like here's a problem with bugs. 344 00:17:00,540 --> 00:17:02,940 Bugs are like fire alarms or whatever. 345 00:17:03,120 --> 00:17:04,280 It's like stop everything you're doing. 346 00:17:04,560 --> 00:17:05,760 We're going to go fix bugs now. 347 00:17:06,120 --> 00:17:07,580 That's horseshit basically. 348 00:17:08,180 --> 00:17:10,040 And that's not the way to develop good software. 349 00:17:10,040 --> 00:17:12,920 Because if people are going to keep distracting you with bugs and bugs and bugs. 350 00:17:13,060 --> 00:17:14,240 You're not going to finish your story. 351 00:17:14,340 --> 00:17:15,400 You're going to forget what you were doing. 352 00:17:15,600 --> 00:17:16,760 And you'll come back to your story. 353 00:17:16,880 --> 00:17:18,500 And be kind of scatterbrained. 354 00:17:18,600 --> 00:17:19,320 And that's not good. 355 00:17:20,200 --> 00:17:21,540 Just common sense basically. 356 00:17:21,860 --> 00:17:23,300 So the way that you deal with bugs. 357 00:17:23,360 --> 00:17:24,380 Bugs are also stories. 358 00:17:24,720 --> 00:17:26,020 So if you have like one week iterations. 359 00:17:26,580 --> 00:17:28,420 And there's like a bug or whatever. 360 00:17:28,840 --> 00:17:30,760 Schedule it to the next iteration instead of the story. 361 00:17:30,980 --> 00:17:31,600 If it's that important. 362 00:17:32,060 --> 00:17:34,420 Usually bugs are usually not actually that important. 363 00:17:35,200 --> 00:17:37,180 When it comes into the grand scheme of things. 364 00:17:40,040 --> 00:17:40,340 Alright. 365 00:17:40,900 --> 00:17:41,580 Pair programming. 366 00:17:41,680 --> 00:17:44,300 This is the most controversial part of XP for some god damn reason. 367 00:17:44,420 --> 00:17:45,160 I really don't know why. 368 00:17:47,880 --> 00:17:49,540 But basically pair programming. 369 00:17:49,760 --> 00:17:50,540 We're going to do a demo. 370 00:17:50,660 --> 00:17:51,260 You're going to see it. 371 00:17:51,280 --> 00:17:53,240 It's two people programming at the same time. 372 00:17:53,380 --> 00:17:54,620 And you're like how the hell is that going to work? 373 00:17:55,140 --> 00:17:56,340 Do I have to share the keyboard? 374 00:17:56,580 --> 00:17:57,280 Or is it two keyboards? 375 00:17:57,540 --> 00:17:57,980 Or what the hell. 376 00:17:58,020 --> 00:17:59,020 We'll show you in the demo. 377 00:17:59,120 --> 00:18:00,760 It's a lot easier to show than to describe. 378 00:18:02,160 --> 00:18:05,220 But basically pair programming is like a constant code review. 379 00:18:06,460 --> 00:18:06,820 Effectively. 380 00:18:07,240 --> 00:18:09,400 And so the general thing to remember is that. 381 00:18:09,400 --> 00:18:12,320 Code written by one person is readable by one person. 382 00:18:12,400 --> 00:18:15,940 Code written by two people is readable by at least two people. 383 00:18:16,040 --> 00:18:16,640 Two different people. 384 00:18:17,320 --> 00:18:17,540 Alright. 385 00:18:17,620 --> 00:18:20,020 How many people here have like worked on an open source project. 386 00:18:20,380 --> 00:18:22,000 And somebody contributes a big chunk of code. 387 00:18:22,140 --> 00:18:23,180 And you can't read it basically. 388 00:18:24,860 --> 00:18:25,260 Okay. 389 00:18:25,480 --> 00:18:27,320 How many of you have thrown away that code. 390 00:18:27,580 --> 00:18:28,660 And rewrote it from scratch? 391 00:18:29,840 --> 00:18:30,240 Right. 392 00:18:30,320 --> 00:18:31,720 That's a big fucking waste of time. 393 00:18:31,980 --> 00:18:32,320 Right. 394 00:18:32,360 --> 00:18:34,100 You're going to piss off the person who thought they were doing good. 395 00:18:34,200 --> 00:18:34,380 Right. 396 00:18:34,480 --> 00:18:35,320 And it's a waste of your time. 397 00:18:35,360 --> 00:18:36,260 Because that's a great feature. 398 00:18:36,460 --> 00:18:39,120 And now you're distracted from working on the thing you were focusing on. 399 00:18:39,400 --> 00:18:40,700 To fix somebody else's shitty code. 400 00:18:40,900 --> 00:18:43,020 For the sake of you know whatever. 401 00:18:43,980 --> 00:18:45,940 And so this helps avoid that problem. 402 00:18:46,780 --> 00:18:49,600 And so one of the problems with pair programming open source stuff. 403 00:18:49,740 --> 00:18:53,040 Is the geographical disparities of time zone disparity. 404 00:18:53,200 --> 00:18:55,340 Like a temporal disparity if you will. 405 00:18:55,620 --> 00:18:56,240 And so. 406 00:18:58,940 --> 00:19:01,560 And kind of like how do you deal with that. 407 00:19:01,620 --> 00:19:03,920 So we're going to show remote pair programming thing using VNC. 408 00:19:04,160 --> 00:19:05,700 And we'll get into that when we get into tools. 409 00:19:07,120 --> 00:19:08,940 But basically you can kind of like. 410 00:19:09,400 --> 00:19:10,420 Ping pong around the world. 411 00:19:10,500 --> 00:19:12,360 Or kind of like pass the torch around the world. 412 00:19:12,440 --> 00:19:16,600 If you have like somebody who's in like you know on the west coast of the US. 413 00:19:16,700 --> 00:19:17,740 On the east coast of the US. 414 00:19:17,900 --> 00:19:18,860 And somebody who's in the UK. 415 00:19:19,100 --> 00:19:20,080 And then somebody who's an Indian. 416 00:19:20,160 --> 00:19:21,140 And someone who's an Asian. 417 00:19:21,200 --> 00:19:21,700 Someone who's whatever. 418 00:19:22,760 --> 00:19:26,220 You can make sure that that's like everybody's pairing with someone. 419 00:19:26,440 --> 00:19:27,320 As you go around the world. 420 00:19:27,500 --> 00:19:29,120 Or you don't have to pair all the time right. 421 00:19:29,240 --> 00:19:30,840 You know you don't have to pair all the time. 422 00:19:31,100 --> 00:19:33,260 There's a practicality that comes into play basically. 423 00:19:34,140 --> 00:19:37,500 You know and so you want to just like kind of make sure people new to the project. 424 00:19:37,600 --> 00:19:38,540 Are on the right track. 425 00:19:39,400 --> 00:19:39,700 Perhaps. 426 00:19:40,200 --> 00:19:42,380 Or you know make sure that they're always checking in tests. 427 00:19:42,600 --> 00:19:44,660 TDD test driven development which is I think is the next slide. 428 00:19:44,820 --> 00:19:47,700 Is probably the most difficult part of extreme programming. 429 00:19:48,200 --> 00:19:49,720 Everyone focuses on pair programming. 430 00:19:49,940 --> 00:19:53,520 Because I don't know it's the programming is less about their ego. 431 00:19:53,760 --> 00:19:56,640 Or I'm not sure what the real sort of social problem is. 432 00:19:56,760 --> 00:20:00,600 But TDD is much much more difficult to grasp as a technical concept. 433 00:20:00,700 --> 00:20:01,580 And to execute upon. 434 00:20:02,480 --> 00:20:05,740 Another thing too is that it provides sort of check and balances. 435 00:20:05,860 --> 00:20:07,780 Between when you have more than one person. 436 00:20:07,900 --> 00:20:08,860 You have two people. 437 00:20:09,400 --> 00:20:12,380 You're not going to write crappy code when someone else is looking at it at the same time. 438 00:20:12,620 --> 00:20:14,180 And it keeps the standards up. 439 00:20:14,340 --> 00:20:16,420 And you can also be like hey does this look cool. 440 00:20:16,640 --> 00:20:17,780 Am I like smoking crack. 441 00:20:17,940 --> 00:20:18,740 Or is this is this wrong. 442 00:20:18,920 --> 00:20:19,300 Is this right. 443 00:20:19,560 --> 00:20:20,660 And you go back and forth. 444 00:20:20,860 --> 00:20:24,580 And you brainstorm ideas and it works out quite well. 445 00:20:25,980 --> 00:20:26,420 Yeah. 446 00:20:26,640 --> 00:20:29,580 The code basically ends up really bad ass. 447 00:20:29,960 --> 00:20:30,980 Right off the bat. 448 00:20:31,160 --> 00:20:31,800 No time wasted. 449 00:20:31,860 --> 00:20:32,800 No throwing out code. 450 00:20:33,020 --> 00:20:34,180 No like writing and then a rewrite. 451 00:20:34,420 --> 00:20:36,540 If you're rewriting code you're a fucking idiot. 452 00:20:36,860 --> 00:20:39,100 If you're like oh we're going to rewrite this in six months. 453 00:20:39,100 --> 00:20:39,560 Blah blah blah. 454 00:20:39,820 --> 00:20:39,940 Yeah. 455 00:20:40,000 --> 00:20:41,180 Why don't you just do it right now. 456 00:20:41,760 --> 00:20:43,200 So that you can move on with your life. 457 00:20:43,480 --> 00:20:43,840 Basically. 458 00:20:44,040 --> 00:20:48,760 I really don't understand why people choose to like take steps that are ultimately going to waste their time. 459 00:20:48,860 --> 00:20:51,600 And produce code that no one wants to use or contribute to. 460 00:20:53,180 --> 00:20:54,680 Maybe it's some S&M thing. 461 00:20:54,860 --> 00:20:57,340 I don't know like some kind of kink. 462 00:20:57,460 --> 00:20:59,080 Like you know I want to waste my time. 463 00:20:59,200 --> 00:21:00,520 That's the only way I can come or something. 464 00:21:00,660 --> 00:21:01,000 I don't know. 465 00:21:02,180 --> 00:21:02,860 But anyways. 466 00:21:05,320 --> 00:21:08,980 And so there's a kind of a with Parapro is kind of like a ping pong that goes on basically. 467 00:21:09,100 --> 00:21:09,760 It's like well. 468 00:21:09,960 --> 00:21:12,920 And so one of the responses when I had a job I had. 469 00:21:13,020 --> 00:21:15,500 It's like something I was like I don't want to pay a program. 470 00:21:15,660 --> 00:21:17,920 I don't want someone to watch me pair approach program all day. 471 00:21:17,980 --> 00:21:20,260 I'm like no one wants to fucking watch you program all day. 472 00:21:20,840 --> 00:21:21,360 All right. 473 00:21:21,380 --> 00:21:22,280 This isn't about you. 474 00:21:22,420 --> 00:21:27,320 Like his response is like very kind of indicative of his kind of overall megalomania. 475 00:21:27,620 --> 00:21:28,900 But you know no one wants to. 476 00:21:29,040 --> 00:21:31,140 Nobody wants to watch you program all day. 477 00:21:31,220 --> 00:21:32,060 You know it's an interaction. 478 00:21:32,340 --> 00:21:33,580 It's a back and forth basically. 479 00:21:33,840 --> 00:21:36,540 And you'll see in the demo when we pair program kind of what goes on. 480 00:21:36,720 --> 00:21:38,920 And so one of the ways to like make sure. 481 00:21:39,100 --> 00:21:41,080 It's kind of even is one person writes a unit test. 482 00:21:41,140 --> 00:21:42,780 The other person makes a pass right. 483 00:21:42,840 --> 00:21:45,600 Then the other person refactors and you kind of go back and forth. 484 00:21:45,740 --> 00:21:48,720 Anti patterns you want to avoid are only one person. 485 00:21:48,800 --> 00:21:49,940 The pair writes the tests. 486 00:21:50,220 --> 00:21:53,100 That's that sucks just as much as watching somebody program basically. 487 00:21:53,420 --> 00:21:57,440 Or or you know or someone's a keyboard hog or whatever. 488 00:21:58,240 --> 00:22:02,940 And so these issues are easy to get around if you're physically pair program with someone. 489 00:22:03,060 --> 00:22:06,920 If someone's like cogging the keyboard just like poking with a stick and say knock it off. 490 00:22:07,440 --> 00:22:08,340 If it's remote. 491 00:22:09,100 --> 00:22:12,340 It's kind of just say over the VoIP or whatever that you're using. 492 00:22:12,440 --> 00:22:13,300 And we'll get into that in a second. 493 00:22:13,720 --> 00:22:17,560 Is is this like hey you know why don't you sit on your hands for a second. 494 00:22:18,040 --> 00:22:20,420 And once you tell me what you'd like me to do. 495 00:22:20,640 --> 00:22:22,940 So I get a chance to type right. 496 00:22:23,180 --> 00:22:25,520 It's it's it's it's it's a it's a ping pong thing. 497 00:22:25,620 --> 00:22:26,480 It's a balanced thing. 498 00:22:26,620 --> 00:22:30,100 If it's not basically if there's someone's a keyboard hog or I don't want to pair. 499 00:22:30,360 --> 00:22:33,020 Or the thing to avoid the real thing to avoid. 500 00:22:33,160 --> 00:22:34,520 It's a real big social problem. 501 00:22:34,720 --> 00:22:38,220 That's just going to end in tears as special people who don't need to pair. 502 00:22:38,220 --> 00:22:41,880 Because they're so fucking smart that they're programming dicks are so big. 503 00:22:42,140 --> 00:22:44,120 That they don't have to pair with anyone. 504 00:22:44,340 --> 00:22:45,420 But everybody else does. 505 00:22:45,980 --> 00:22:47,720 That's that's that's fucking bogus. 506 00:22:48,380 --> 00:22:49,840 That's that's completely bogus. 507 00:22:49,880 --> 00:22:51,100 It generates bad feelings. 508 00:22:51,440 --> 00:22:53,620 There's one smart person and everybody else is dumb. 509 00:22:53,680 --> 00:22:55,300 There's a couple smart people everybody else is dumb. 510 00:22:55,860 --> 00:22:57,580 Don't fall into that temptation. 511 00:22:57,980 --> 00:22:59,780 I've worked at two jobs now that have done that. 512 00:22:59,880 --> 00:23:03,660 It generates bad feelings about the people who are special and rightfully so. 513 00:23:03,940 --> 00:23:04,900 Someone doesn't want to pair. 514 00:23:05,040 --> 00:23:06,160 Kick them the fuck off. 515 00:23:06,320 --> 00:23:07,320 I don't care how smart they are. 516 00:23:07,360 --> 00:23:08,200 There's lots of smart people. 517 00:23:08,220 --> 00:23:10,460 And you can find someone with more humility. 518 00:23:10,720 --> 00:23:14,480 The problem with people who don't have humility who won't pair is they won't admit to mistakes. 519 00:23:14,780 --> 00:23:15,700 They'll cover up mistakes. 520 00:23:16,040 --> 00:23:21,960 Because they have to sort of exude this image of being like the most awesomest programmer on the planet or whatever. 521 00:23:22,240 --> 00:23:25,900 So these are the people who'd be who'd be like yeah select is broken on Solaris. 522 00:23:26,340 --> 00:23:26,780 Right. 523 00:23:26,860 --> 00:23:28,080 My program is not fucked up. 524 00:23:28,140 --> 00:23:29,540 Select on Solaris is broken. 525 00:23:29,760 --> 00:23:30,740 Select is not broken. 526 00:23:32,480 --> 00:23:33,520 Select is not broken. 527 00:23:33,740 --> 00:23:34,980 Your code is fucked up. 528 00:23:35,160 --> 00:23:38,080 But this is the kind of shit you hear from people who don't have humility. 529 00:23:38,220 --> 00:23:39,280 It can't be my fault. 530 00:23:39,460 --> 00:23:41,660 My programming dick is this big. 531 00:23:42,160 --> 00:23:42,600 Right. 532 00:23:42,720 --> 00:23:44,600 And if I admit to any mistakes. 533 00:23:45,300 --> 00:23:45,740 Yeah. 534 00:23:45,840 --> 00:23:46,140 Right. 535 00:23:46,220 --> 00:23:48,460 It's just going to like reduce me in the eyes of my peers. 536 00:23:48,680 --> 00:23:49,820 This is a real social problem. 537 00:23:49,860 --> 00:23:50,660 I'm like joking about it. 538 00:23:50,700 --> 00:23:51,740 This is a real social problem. 539 00:23:51,960 --> 00:23:57,700 If you see us on your project open source or otherwise get rid of that person either make them change or get rid of them. 540 00:23:57,820 --> 00:23:59,420 It's ultimately poison. 541 00:24:02,860 --> 00:24:03,960 Test driven development. 542 00:24:06,620 --> 00:24:08,120 I think is probably. 543 00:24:08,220 --> 00:24:17,280 One of the best things to happen to software development since I don't know when since like for GLS or something. 544 00:24:17,460 --> 00:24:19,140 It's really really quite amazing. 545 00:24:19,480 --> 00:24:21,560 So let me try to go through this relatively quickly. 546 00:24:22,480 --> 00:24:25,020 So the first thing you do you start out with a failing system test. 547 00:24:25,160 --> 00:24:27,980 Like I said you have a feature like the negotiation has to finish. 548 00:24:28,120 --> 00:24:28,280 Right. 549 00:24:28,460 --> 00:24:33,980 So how let's say it's a joint joint Weber client a jabber VoIP clients. 550 00:24:35,480 --> 00:24:37,320 Good thing I didn't drink any caffeine. 551 00:24:37,320 --> 00:24:39,200 Or otherwise I'd be totally incomprehensible. 552 00:24:41,100 --> 00:24:43,160 So how would you write an automated system test for that. 553 00:24:43,280 --> 00:24:43,440 Well. 554 00:24:44,560 --> 00:24:45,960 How do you write an automated system test for that. 555 00:24:46,040 --> 00:24:51,060 Well you could start a server background the process a little basic kind of server. 556 00:24:51,180 --> 00:24:53,800 Start your client basically and have them say hello to each other. 557 00:24:54,000 --> 00:24:55,660 And you can verify that that works. 558 00:24:55,840 --> 00:24:59,820 And then when the test is done when the client is done the server exits and et cetera et cetera. 559 00:25:00,760 --> 00:25:01,160 Right. 560 00:25:01,260 --> 00:25:01,900 That's pretty easy. 561 00:25:03,720 --> 00:25:05,220 So you start out with that. 562 00:25:05,300 --> 00:25:05,600 Right. 563 00:25:05,700 --> 00:25:06,860 And that you're failing sort of. 564 00:25:07,320 --> 00:25:09,260 Your failing system test that's going to do that. 565 00:25:09,320 --> 00:25:13,180 Your main goal in life is to make that test pass anything else as a distraction. 566 00:25:14,480 --> 00:25:19,940 So once you have a failing system test you go into failing unit tests and this will make some more sense when we get into it. 567 00:25:19,980 --> 00:25:22,020 When we start programming you buy it open still. 568 00:25:23,740 --> 00:25:25,100 No that's OK. 569 00:25:25,300 --> 00:25:25,640 All right. 570 00:25:25,640 --> 00:25:25,800 Good. 571 00:25:26,880 --> 00:25:28,560 We've been fucking with me all day. 572 00:25:29,000 --> 00:25:31,160 So I just thought he was screwing with me a little bit. 573 00:25:32,320 --> 00:25:32,960 So yeah. 574 00:25:33,060 --> 00:25:34,620 So you have your failing system test. 575 00:25:34,780 --> 00:25:36,900 Then you start writing failing is a TDD. 576 00:25:37,320 --> 00:25:42,020 That is you you have a you write new code to make a test pass basically. 577 00:25:42,360 --> 00:25:47,720 So you start with a failing unit test that probably with brand new code start the failing new test that doesn't even compile. 578 00:25:48,280 --> 00:25:48,680 Right. 579 00:25:48,780 --> 00:25:52,120 The method does the function doesn't exist the class doesn't exist et cetera et cetera. 580 00:25:52,500 --> 00:25:52,900 Right. 581 00:25:53,060 --> 00:25:56,200 You start with the simplest test that could possibly work in the case of a stack. 582 00:25:56,400 --> 00:25:58,560 For instance you'd make a new stack and verify that it's empty. 583 00:25:58,920 --> 00:25:59,320 Right. 584 00:25:59,440 --> 00:26:02,640 Stack doesn't exist and is empty doesn't exist. 585 00:26:02,800 --> 00:26:05,680 And so you go and you implement those things to do the bare minimum to make it work. 586 00:26:06,120 --> 00:26:06,880 And so. 587 00:26:07,560 --> 00:26:11,060 The simplest thing do the simplest thing that could possibly work. 588 00:26:11,340 --> 00:26:14,160 Not the stupidest thing that could possibly work. 589 00:26:14,320 --> 00:26:22,100 This is not a license to sort of duplicate large swath of code and to continue to produce shit just because you have tests basically. 590 00:26:22,600 --> 00:26:23,040 Right. 591 00:26:23,240 --> 00:26:24,700 So you have a failing test. 592 00:26:24,940 --> 00:26:26,860 You make it pass and then you refactor. 593 00:26:27,460 --> 00:26:28,940 This is what you have to do. 594 00:26:29,100 --> 00:26:33,040 Otherwise you're going to have lots of tests for code that is still shitty basically. 595 00:26:33,260 --> 00:26:36,420 And you can't maintain the code and you can't maintain the test and the system 596 00:26:36,420 --> 00:26:37,280 is still very brittle. 597 00:26:37,440 --> 00:26:39,220 It's a very important component basically. 598 00:26:39,420 --> 00:26:40,740 You have to kind of do all these things together. 599 00:26:42,360 --> 00:26:43,960 And so there's kind of a rhythm to TDD. 600 00:26:44,180 --> 00:26:50,640 And that's like test a little code a little test a little code a little test a little code a little refactor to eliminate duplication et cetera et cetera. 601 00:26:51,380 --> 00:26:52,660 Make to make and then make the tent. 602 00:26:53,040 --> 00:26:54,880 So it's like failing test passing. 603 00:26:54,940 --> 00:26:56,120 It's called red green refactor. 604 00:26:56,160 --> 00:26:57,200 It's called the stoplight pattern. 605 00:26:57,440 --> 00:27:01,420 If you read Kent that's Kent Beck's book red green refactor. 606 00:27:01,520 --> 00:27:03,260 It's called stoplight pattern basically. 607 00:27:03,300 --> 00:27:05,740 And you repeat this until your system test passes. 608 00:27:07,160 --> 00:27:07,560 Right. 609 00:27:07,760 --> 00:27:10,640 So that's the kind of rhythm basically that you get into. 610 00:27:10,820 --> 00:27:13,460 And once you and it seems really slow to get into the rhythm basically. 611 00:27:13,500 --> 00:27:15,800 And you're like OK boom boom boom boom. 612 00:27:17,020 --> 00:27:23,620 And so it's red green refactor because in the tools failing tests it gives you red and passing tests gives you green. 613 00:27:23,720 --> 00:27:25,280 You talk about the green addiction. 614 00:27:27,180 --> 00:27:28,480 I think we have to show it. 615 00:27:28,560 --> 00:27:29,560 OK we'll show it. 616 00:27:29,720 --> 00:27:32,320 And then at least we'll commentate upon that. 617 00:27:32,460 --> 00:27:35,360 The other thing is really great about TDD is it just works. 618 00:27:35,360 --> 00:27:42,060 There's none of this like you know spending lots of your time in a debugger trying to figure out what the hell's going on in your program. 619 00:27:42,660 --> 00:27:45,280 I personally find that extremely tedious and boring. 620 00:27:45,460 --> 00:27:46,360 I like to write code. 621 00:27:46,760 --> 00:27:49,100 Debugging is not writing code basically. 622 00:27:49,300 --> 00:27:51,640 I like I like to write code like to write very clean code. 623 00:27:52,020 --> 00:28:01,360 And when I have when I'm in the debugger I am frustrated basically because basically that meant I took too big of a step without tests or something like that. 624 00:28:02,080 --> 00:28:03,620 And do you want to talk about that. 625 00:28:04,820 --> 00:28:05,260 Sure. 626 00:28:05,360 --> 00:28:06,380 Go for it. 627 00:28:11,940 --> 00:28:23,740 So you work in these small incremental steps and when when I started noticing that that things weren't really going as slow as I had originally thought is because I hadn't opened up a debugger at all. 628 00:28:23,860 --> 00:28:31,960 We were coding for I don't know like eight hours straight and not once that I have to open up a debugger and I'm not the type of person that is shy about a debugger. 629 00:28:32,040 --> 00:28:34,200 First time I see any kind of code. 630 00:28:35,360 --> 00:28:44,880 If I even if I source the first thing I'm going to do is I open up in Ida I start all a debug whatever I look at stuff better and assembly a lot of the time than I do in source. 631 00:28:45,100 --> 00:28:46,800 So this was really surprising to me. 632 00:28:47,060 --> 00:28:50,940 And so what we started doing is just do little little incremental changes. 633 00:28:51,100 --> 00:28:58,420 You add one method test that make sure that the interface is working and then then that solid you can move on to something else. 634 00:28:58,480 --> 00:29:02,060 So it's kind of like you have all these little modules you test this module here. 635 00:29:02,160 --> 00:29:03,200 Everything is working fine. 636 00:29:03,440 --> 00:29:04,400 You can set it aside. 637 00:29:04,400 --> 00:29:05,620 You don't have to worry about it anymore. 638 00:29:05,860 --> 00:29:09,580 Then you move on to the next thing and it's like building blocks is you have it like it's like a pyramid. 639 00:29:09,760 --> 00:29:12,540 You start putting things together one after the other after the other. 640 00:29:12,720 --> 00:29:18,760 And then finally you have this complete solution and you can if you want to replace a block you can place a block. 641 00:29:18,920 --> 00:29:19,840 It's not going to all fall down. 642 00:29:20,500 --> 00:29:21,480 Or if it does you know. 643 00:29:21,800 --> 00:29:22,160 Yeah. 644 00:29:22,260 --> 00:29:22,840 If it does you know. 645 00:29:23,820 --> 00:29:24,180 Yeah. 646 00:29:24,420 --> 00:29:27,200 Your tests tell you everything you do one change. 647 00:29:27,420 --> 00:29:29,280 You're like OK I'm going to try to change. 648 00:29:29,680 --> 00:29:34,220 Let's say I'm going to I'm going to try a different protocol with with the server and you write that. 649 00:29:34,400 --> 00:29:37,560 If it doesn't work your tests are going to tell you and you could just revert right back. 650 00:29:38,120 --> 00:29:42,320 Any change you make you'll know right away if it affects any other part of the program. 651 00:29:42,760 --> 00:29:45,360 You don't have to worry about OK if I change the structure here. 652 00:29:45,700 --> 00:29:49,500 It's going to affect everything everywhere and it'll never compile again. 653 00:29:54,640 --> 00:29:58,320 The the very wise phrase I can't remember where I read it. 654 00:29:58,740 --> 00:30:00,620 It was probably Ken Becker Ron Jeffries. 655 00:30:00,700 --> 00:30:02,640 If I say the code will tell you what to do. 656 00:30:03,300 --> 00:30:04,380 The code will tell you what to do. 657 00:30:04,380 --> 00:30:07,500 If you have a failing system test the code is telling you to implement a feature. 658 00:30:07,600 --> 00:30:11,600 If you have a failing unit test the code is telling you to do the simplest thing that could possibly work to implement that test. 659 00:30:11,820 --> 00:30:19,520 If all your tests are passing and you make a minor what you perceive to be a minor optimization such as like changing a class to a struct or what have you. 660 00:30:19,640 --> 00:30:20,940 Now your tests start to fail. 661 00:30:21,180 --> 00:30:25,160 You made like a two line change back back you're back to passing. 662 00:30:25,420 --> 00:30:32,880 As opposed to oh God I guess you have to like figure out how to integrate this or you know just like coded for eight hours straight. 663 00:30:33,040 --> 00:30:34,320 And now like everything's broken. 664 00:30:34,320 --> 00:30:35,660 You don't know what to do. 665 00:30:35,860 --> 00:30:37,000 You're blurry eyed. 666 00:30:37,100 --> 00:30:40,180 The crank that you snorted to program really fast is starting to wear off. 667 00:30:40,480 --> 00:30:41,880 And you're like shit. 668 00:30:42,420 --> 00:30:43,320 What do I do? 669 00:30:44,040 --> 00:30:45,500 Fuck I'll just have to revert. 670 00:30:45,720 --> 00:30:46,800 Eight hours wasted. 671 00:30:47,280 --> 00:30:48,180 Fuck that shit. 672 00:30:48,400 --> 00:30:49,300 I don't like wasting my time. 673 00:30:49,580 --> 00:30:50,700 Maybe some people do again. 674 00:30:51,020 --> 00:30:53,460 Whatever your kink happens to be different strokes make the world go around. 675 00:30:54,480 --> 00:30:56,100 So it just works. 676 00:30:56,360 --> 00:30:57,520 Less debugging more coding. 677 00:30:57,680 --> 00:30:58,540 I fucking hate debugging. 678 00:30:59,680 --> 00:31:00,640 Hate debugging. 679 00:31:01,760 --> 00:31:02,680 Programming by intention. 680 00:31:02,680 --> 00:31:15,640 The other thing with TDD is that since you're like since basically you're writing your test first you're getting like real bird's eye view of kind of what the code's going to look like when people other people go to use it basically. 681 00:31:15,940 --> 00:31:23,660 So if it takes you ten lines of code to make a connection to the Jabber server or whatever I keep using this example but run with me here. 682 00:31:23,900 --> 00:31:24,320 Right. 683 00:31:24,400 --> 00:31:26,560 If it takes ten lines of code your API is wrong. 684 00:31:27,160 --> 00:31:28,780 It's design feedback on your API. 685 00:31:29,000 --> 00:31:30,520 You get that from writing the test first. 686 00:31:30,740 --> 00:31:32,520 So by starting out with a good API. 687 00:31:32,680 --> 00:31:35,300 That's clean from a consuming and test kind of perspective. 688 00:31:35,980 --> 00:31:45,740 You basically get all the advantages of if you had modeled it in UML for six months with no code written whatsoever or did like God's own design for a Jabber client with no working code. 689 00:31:45,900 --> 00:31:56,420 He said not only do you have a very clean decoupled really maintainable and extensible design because you had to write the tests first and for things to be testable they have to have those design qualities. 690 00:31:56,780 --> 00:32:01,440 You don't only have that you have working code and regression tests at the same time. 691 00:32:01,440 --> 00:32:03,140 It's really fucking bad ass. 692 00:32:03,380 --> 00:32:07,560 And this is the thing something that people kind of I think don't get when they read about TDD. 693 00:32:07,920 --> 00:32:11,320 It's more of a design methodology than a testing methodology. 694 00:32:11,820 --> 00:32:14,740 It's like testing is for QA testing is for whatever blah blah. 695 00:32:14,880 --> 00:32:15,280 It's like OK. 696 00:32:15,520 --> 00:32:17,720 So your job is to write shit that doesn't work. 697 00:32:18,620 --> 00:32:19,340 All right. 698 00:32:19,440 --> 00:32:26,320 If you want to admit that see how we see how far that gets you in your career like maybe you know maybe in government work actually. 699 00:32:27,120 --> 00:32:27,600 Anyways. 700 00:32:28,060 --> 00:32:30,740 But probably you know you don't say that out loud. 701 00:32:31,580 --> 00:32:33,580 And so if you kind of like start to think about it. 702 00:32:33,640 --> 00:32:36,840 Yeah I probably should make sure that my code works so I don't waste my peers time. 703 00:32:37,460 --> 00:32:37,820 Right. 704 00:32:37,940 --> 00:32:41,480 Or I don't fuck up this open source project and look like a complete dunce. 705 00:32:42,940 --> 00:32:50,200 It only takes a little bit of foresight to sort of like all of you do like have a little conversation in your head basically and you realize oh why do I think that. 706 00:32:50,300 --> 00:32:53,920 Why do I think testing is for other people and not for me writing the code. 707 00:32:54,480 --> 00:33:00,540 It's a really bad kind of social thing that's been kind of persisted through the years. 708 00:33:00,540 --> 00:33:01,640 I don't understand why. 709 00:33:02,480 --> 00:33:02,840 Anyways. 710 00:33:03,580 --> 00:33:15,080 And so writing things in TD to make sure you're programming by intention things work because you intended them to write how many people have been writing code and you think that you're not done but all of a sudden things work. 711 00:33:15,560 --> 00:33:19,860 And you're like why is this working one two three four five six. 712 00:33:20,060 --> 00:33:20,540 Right. 713 00:33:21,340 --> 00:33:25,340 That's just as bad as if you expect it to work and it doesn't. 714 00:33:25,340 --> 00:33:27,580 Basically you are no longer one with your code. 715 00:33:27,760 --> 00:33:29,100 You don't know what's going on. 716 00:33:29,660 --> 00:33:31,040 That's a bad place to be. 717 00:33:31,140 --> 00:33:32,340 That is a very slippery slope. 718 00:33:32,500 --> 00:33:39,960 And when things work when you don't think that they should that that that's just as dangerous as the opposite kind of situation. 719 00:33:40,540 --> 00:33:40,980 Right. 720 00:33:41,140 --> 00:33:42,900 And that's called programming by coincidence. 721 00:33:43,120 --> 00:33:47,640 That's a pragmatic programmer thing which is really great book pragmatic the pragmatic programmer. 722 00:33:47,880 --> 00:33:49,480 They got programming by coincidence. 723 00:33:49,680 --> 00:33:50,620 It happens to work. 724 00:33:50,720 --> 00:33:51,540 I'm real happy. 725 00:33:51,740 --> 00:33:52,180 Yeah. 726 00:33:52,960 --> 00:33:53,400 Right. 727 00:33:53,520 --> 00:33:55,260 I just happen to not have diabetes. 728 00:33:55,640 --> 00:33:57,340 Does that mean I'm not going to go to my doctor. 729 00:33:57,340 --> 00:33:58,320 No. 730 00:33:58,920 --> 00:33:59,460 Right. 731 00:34:02,220 --> 00:34:07,220 So incremental design so TDD can leads in incremental design or emergent design as it's sometimes called. 732 00:34:07,520 --> 00:34:10,540 And this comes down to what I said earlier the code will tell you what to do. 733 00:34:11,620 --> 00:34:14,240 It is very simple very wise thing. 734 00:34:14,520 --> 00:34:22,560 It is by the way I hope you know this is we're talking about like methodology we're talking about code right talking about plans and designs and documents and bullshit. 735 00:34:22,700 --> 00:34:27,180 We're talking about writing code staying in code as much as possible. 736 00:34:27,340 --> 00:34:30,520 And getting as much done as possible without wasting time. 737 00:34:30,840 --> 00:34:34,020 If you like to write code and you and you like to not waste time. 738 00:34:34,440 --> 00:34:36,380 This is really what you should be doing basically. 739 00:34:37,780 --> 00:34:38,240 Anyways. 740 00:34:38,720 --> 00:34:41,980 So there's a couple things with the emergent design and TDD right. 741 00:34:42,120 --> 00:34:46,940 And one of the things is that if if you can't test if something is difficult to unit test if you can't test it it's wrong. 742 00:34:47,660 --> 00:34:48,960 Your design is wrong. 743 00:34:49,440 --> 00:34:50,380 Get over it. 744 00:34:50,440 --> 00:34:51,240 Make it testable. 745 00:34:51,560 --> 00:34:55,920 If you can't test it if you can't mock out the sockets or you can't do whatever. 746 00:34:56,600 --> 00:34:57,080 You're you're. 747 00:34:57,340 --> 00:34:58,060 You're wrong basically. 748 00:34:58,460 --> 00:35:00,380 And you have to own you have to set up and go OK. 749 00:35:00,500 --> 00:35:03,100 It's difficult to test that doesn't mean unit testing sucks. 750 00:35:03,400 --> 00:35:09,260 That doesn't mean that like the unit testing tool is broken which is similar to the select is broken thing you have to go OK. 751 00:35:09,880 --> 00:35:12,960 This is this is the test code giving me design feedback. 752 00:35:13,280 --> 00:35:19,120 I need to consider this and figure out how this can be made easier to test right or how it can be made to be testable. 753 00:35:19,220 --> 00:35:21,440 If it's not testable your design is wrong. 754 00:35:21,840 --> 00:35:23,840 You have close coupling inappropriate intimacy. 755 00:35:24,000 --> 00:35:25,700 I know coupling and intimacy that's really funny. 756 00:35:25,820 --> 00:35:26,820 I didn't make those up. 757 00:35:26,820 --> 00:35:27,720 Those are object oriented. 758 00:35:27,900 --> 00:35:34,720 Weenies came up with that like in the mid 90s and it's in the design patterns book thinking in for book and stuff like that. 759 00:35:35,240 --> 00:35:44,480 Having a design with these problems with coupling problems and appropriate intimacy and circular dependencies means you're in for a world of pain just like in the Big Lebowski. 760 00:35:44,720 --> 00:35:44,980 Right. 761 00:35:47,600 --> 00:35:49,260 Have you heard of Vietnam Billy. 762 00:35:50,940 --> 00:35:53,840 This is what happens when you fuck a stranger in the ass. 763 00:35:54,560 --> 00:35:56,280 You're hitting for a world of pain. 764 00:35:56,280 --> 00:36:10,400 Basically and this is the test telling you right now when it's easy to change once you have a lot of code all based around design changing it becomes much much more difficult especially when you have coupling and like inappropriate intimacy and circular dependencies. 765 00:36:10,740 --> 00:36:14,060 Good luck refactoring that this is what this is where people hit the brick wall. 766 00:36:14,140 --> 00:36:14,980 They're like shit. 767 00:36:15,060 --> 00:36:16,400 We have to rewrite everything now. 768 00:36:16,740 --> 00:36:18,200 We have to start over from scratch. 769 00:36:18,360 --> 00:36:25,220 Maybe we'll reuse some of the code or whatever every every read I've ever seen has always introduced more bugs and it solves basically. 770 00:36:25,220 --> 00:36:27,760 Because you're not giving yourself the feedback loop. 771 00:36:27,800 --> 00:36:28,820 You think you've learned your lessons. 772 00:36:28,920 --> 00:36:30,060 There's less of salient details. 773 00:36:30,220 --> 00:36:33,320 You have not picked up on as far as the feedback from your design. 774 00:36:33,840 --> 00:36:36,960 I don't care if it's in UML or whatever the test tell you what to do. 775 00:36:37,040 --> 00:36:39,440 The code will tell you what to do as far as your design. 776 00:36:41,320 --> 00:36:44,140 So the other is fake it till you make it right. 777 00:36:44,340 --> 00:36:50,000 Do you need to come up with a complete implementation of the Jabber protocol to pass this one test of the handshake finishing. 778 00:36:50,240 --> 00:36:53,500 No you don't if it's not encrypted. 779 00:36:53,860 --> 00:36:54,880 Do you need to like. 780 00:36:55,220 --> 00:36:56,740 Write use an SSL library or whatever. 781 00:36:56,900 --> 00:37:03,900 No, it's all about scoping scoping your stories down to the point where it's like a small chunk of functionality is going to be easy to easy to implement basically. 782 00:37:05,160 --> 00:37:14,200 And so and so one things you can do is you can fake it till you make it basically and we'll get into that when we start writing the test. 783 00:37:14,320 --> 00:37:23,260 But basically doing the simple thing could possibly work like if you're writing out one test that expects a certain method to return zero and it just make that method return zero right. 784 00:37:23,260 --> 00:37:27,760 And then you write another test that expects one or some other return value. 785 00:37:27,980 --> 00:37:31,780 That's when you that's when you generalize basically you don't generalize up front. 786 00:37:31,920 --> 00:37:32,920 We don't design up front. 787 00:37:33,000 --> 00:37:35,340 We wait for the code to tell us what to do. 788 00:37:37,660 --> 00:37:38,620 Let me see. 789 00:37:38,960 --> 00:37:40,980 So Lynn eliminating duplication. 790 00:37:41,020 --> 00:37:48,620 How many people here have seen like probably I don't know entire functions duplicated across a project like maybe ten plus times. 791 00:37:49,200 --> 00:37:49,720 Yeah. 792 00:37:49,840 --> 00:37:51,820 How many people here think that's fucking retarded. 793 00:37:53,260 --> 00:37:53,380 Yeah. 794 00:37:53,480 --> 00:37:54,040 You're right. 795 00:37:54,200 --> 00:37:55,640 You're not wrong basically. 796 00:37:56,080 --> 00:37:58,100 And so eliminate duplication. 797 00:37:58,220 --> 00:38:00,660 This is another thing of the code will tell you what to do. 798 00:38:00,740 --> 00:38:01,900 You have duplication. 799 00:38:02,180 --> 00:38:04,400 There's two there's two different kind of acronyms. 800 00:38:04,480 --> 00:38:06,180 There's DRI which is don't repeat yourself. 801 00:38:06,920 --> 00:38:08,620 And it was once and only once. 802 00:38:08,700 --> 00:38:12,460 Oh which are two a pragmatic programmer kind of things. 803 00:38:12,720 --> 00:38:14,060 So don't repeat yourself. 804 00:38:14,280 --> 00:38:20,200 If the code is repeating if there's more than one source of information for a particular kind of information in the system. 805 00:38:20,360 --> 00:38:21,800 There's something wrong in your design. 806 00:38:22,020 --> 00:38:22,800 It's it comes down to it. 807 00:38:22,800 --> 00:38:30,940 It's hard to sort of encapsulating responsibility for certain things effectively or coming up with a generalized class design or whatever. 808 00:38:31,240 --> 00:38:34,600 But sharing code is good for the most part if you don't do it stupidly. 809 00:38:34,800 --> 00:38:38,420 And so eliminate duplication is one of the best things you can do to improve your design. 810 00:38:38,680 --> 00:38:41,320 This is another without tests even forget TDD. 811 00:38:41,600 --> 00:38:43,560 If you see duplication refactor. 812 00:38:43,620 --> 00:38:44,760 So there is no duplication. 813 00:38:44,860 --> 00:38:48,220 The code will tell you what to do to improve your design and improve your code. 814 00:38:48,360 --> 00:38:51,780 You just have to stop thinking you're incredibly clever and pay attention. 815 00:38:51,780 --> 00:38:56,360 And listen to the code testing in a coupling and inappropriate intimacy. 816 00:38:56,500 --> 00:38:57,880 So coupling is basically safe. 817 00:38:58,000 --> 00:39:02,700 You have like two classes basically right and they call into each other all the time, right? 818 00:39:02,840 --> 00:39:04,000 It's really close coupling basically. 819 00:39:04,080 --> 00:39:10,980 It's kind of like there's like almost like a sewing pattern design these two between these two classes and basically they're useless without each other. 820 00:39:11,160 --> 00:39:14,640 That's coupling basically and it doesn't make for a very versatile design. 821 00:39:16,500 --> 00:39:19,140 And I mean I'm not going to go into why that's a really bad idea. 822 00:39:19,300 --> 00:39:20,480 Hopefully it's somewhat obvious. 823 00:39:20,480 --> 00:39:23,140 If anybody has any questions come talk to me later and I'll explain it to you. 824 00:39:23,640 --> 00:39:31,540 Inappropriate intimacy is similar where like basically one component of your app knows a little too much about the internal workings of how this other thing works. 825 00:39:31,900 --> 00:39:40,620 Like it knows too much about like it knows that oh it goes eight characters in adds five and does whatever to come up with its IV for its encryption or whatever. 826 00:39:41,120 --> 00:39:44,880 You don't want to have those details spread throughout the system that comes down to once and only once. 827 00:39:45,060 --> 00:39:49,460 The details of how that is done should be expressed once in the system, right? 828 00:39:50,480 --> 00:39:56,680 Sometimes you write tests that know a little bit too much about the underlying class or whatever and you want to kind of pay attention and avoid that also. 829 00:39:56,900 --> 00:39:58,820 And for the sake of brevity I'll move on. 830 00:39:59,780 --> 00:40:01,300 But if anybody has questions let me know. 831 00:40:02,060 --> 00:40:02,420 Okay. 832 00:40:03,360 --> 00:40:04,560 So then there's cohesion. 833 00:40:04,680 --> 00:40:06,440 So I've been talking too much. 834 00:40:06,640 --> 00:40:08,180 So we're going to skip to the next slide. 835 00:40:10,080 --> 00:40:10,680 Continuous integration. 836 00:40:10,980 --> 00:40:11,900 Build your software all the time. 837 00:40:11,980 --> 00:40:13,520 You have an automated build that runs once a day. 838 00:40:13,840 --> 00:40:14,880 Run it all the time. 839 00:40:15,040 --> 00:40:16,040 There's no reason not to. 840 00:40:16,280 --> 00:40:19,000 Why wait until 12 a.m. 841 00:40:19,020 --> 00:40:20,280 or 5 a.m. or whenever your build runs. 842 00:40:20,480 --> 00:40:22,700 You'll find out that your code doesn't compile or your tests are failing. 843 00:40:23,140 --> 00:40:25,500 If you have an automated build run it all the time. 844 00:40:25,680 --> 00:40:27,640 It's just kind of common sense basically. 845 00:40:28,140 --> 00:40:32,520 You don't have to have a dedicated build machine. 846 00:40:32,760 --> 00:40:39,160 You can have a shell script that does an SVN update, compiles the code, runs the unit tests, and then runs the system tests. 847 00:40:39,820 --> 00:40:41,320 That's like a four-line shell script. 848 00:40:43,660 --> 00:40:44,220 Let's see. 849 00:40:45,480 --> 00:40:45,840 Yep. 850 00:40:46,620 --> 00:40:48,540 Oh, the other cool thing is that you know whose fault it is. 851 00:40:48,620 --> 00:40:50,140 It's like, oh, there are 50 check-ins that day 852 00:40:50,140 --> 00:40:51,180 from 100 different developers. 853 00:40:52,660 --> 00:40:53,640 Whose fault is it? 854 00:40:53,740 --> 00:40:54,080 I don't know. 855 00:40:54,180 --> 00:40:56,940 You could go look at diffs for like eight hours to try to figure it out. 856 00:40:57,080 --> 00:40:59,000 When you have a continuous build that runs all the time, 857 00:40:59,220 --> 00:41:02,360 there's probably only a couple of check-ins that have happened since the last build. 858 00:41:02,900 --> 00:41:06,540 So you're going to know who broke it and then you know who to kick in the balls basically. 859 00:41:08,940 --> 00:41:11,240 So we see tools, basically stories. 860 00:41:11,400 --> 00:41:13,480 You don't need anything fancy to do stories. 861 00:41:13,580 --> 00:41:17,120 You just have a wiki basically or on SourceForge they have a feature request tracker, 862 00:41:17,320 --> 00:41:19,700 which is a good place to store stories and things like that. 863 00:41:19,700 --> 00:41:21,540 You don't need a commercial tool or anything fancy. 864 00:41:21,760 --> 00:41:25,240 Some people just have a little text file in their source control repository. 865 00:41:28,880 --> 00:41:30,180 Pair programming remotely. 866 00:41:31,880 --> 00:41:33,500 You just need a remote desktop software. 867 00:41:34,620 --> 00:41:38,520 Luis and I like tight VNC rather than tight. 868 00:41:39,480 --> 00:41:42,540 That's right, just like your mom and your dad. 869 00:41:43,780 --> 00:41:45,400 Yeah, we prefer tight VNC. 870 00:41:45,520 --> 00:41:46,520 It's an open source thing. 871 00:41:46,720 --> 00:41:48,480 It's got a lot of cool optimizations. 872 00:41:48,500 --> 00:41:49,400 It just works really well. 873 00:41:49,400 --> 00:41:52,480 Real VNC is still usable and you should use that. 874 00:41:52,580 --> 00:41:55,460 On Mac OS there's a couple of VNCs that you can use. 875 00:41:55,540 --> 00:41:59,280 Tight VNC doesn't run on Mac OS just yet if you're pairing between different Mac developers. 876 00:42:00,700 --> 00:42:04,140 So here's some command line options I found to be useful. 877 00:42:04,600 --> 00:42:07,300 Dash BGR233 is the best, by the way. 878 00:42:07,420 --> 00:42:12,120 It takes 16-bit color information and puts it down into 8-bit color information, 879 00:42:12,320 --> 00:42:14,700 but it doesn't look really, really weird dithering-wise. 880 00:42:15,440 --> 00:42:19,140 That's really handy if you're pairing with an open source developer. 881 00:42:19,140 --> 00:42:21,060 If you're a developer, say, in India or whatever, 882 00:42:21,260 --> 00:42:23,760 where they have that kind of limited bandwidth coming into the country, 883 00:42:23,880 --> 00:42:26,420 or someone's on a dial-up, this is still utterly doable. 884 00:42:28,360 --> 00:42:32,140 It might look weird depending on the colors and the ID syntax hiding you use and stuff, 885 00:42:32,280 --> 00:42:33,000 but check it out. 886 00:42:33,040 --> 00:42:33,860 It'll basically work. 887 00:42:34,360 --> 00:42:36,840 You can also do it within VMWare. 888 00:42:37,860 --> 00:42:40,540 You don't have to worry about sharing your whole desktop. 889 00:42:40,800 --> 00:42:45,620 You can have a VMWare session running and then also tunnel all the VNC over SSH. 890 00:42:45,900 --> 00:42:46,240 Yep. 891 00:42:46,620 --> 00:42:48,280 It's possible to do this highly securely 892 00:42:48,280 --> 00:42:53,040 if you don't trust that developer in India or Pakistan or Germany or wherever, 893 00:42:53,180 --> 00:42:54,300 or the US for that matter. 894 00:42:54,640 --> 00:42:56,880 Another really key component is audio chat. 895 00:42:57,120 --> 00:42:59,600 There's a bunch of free audio chat stuff that you can do, basically. 896 00:43:00,340 --> 00:43:06,300 Pair programming and having to switch to an IM client in the middle of writing code 897 00:43:06,300 --> 00:43:07,800 to communicate doesn't work. 898 00:43:07,960 --> 00:43:08,380 I tried it. 899 00:43:08,500 --> 00:43:10,600 It seems like it would be okay, but it doesn't work. 900 00:43:11,200 --> 00:43:13,280 Audio chat is really a necessity. 901 00:43:15,840 --> 00:43:17,100 There's free stuff you can use. 902 00:43:17,100 --> 00:43:19,780 Jabber has a thing called Jingle, which I guess was developed by Google. 903 00:43:20,000 --> 00:43:20,760 Was that developed by Google? 904 00:43:21,280 --> 00:43:21,460 Yeah. 905 00:43:22,540 --> 00:43:23,440 There's a lib jingle. 906 00:43:24,660 --> 00:43:28,560 Copete, with my personal preference, 0.12 implements this. 907 00:43:28,740 --> 00:43:30,020 Game 2.0 implements this. 908 00:43:30,380 --> 00:43:33,040 Google Talk is technically not open source, but I figured I'd mention it anyway. 909 00:43:33,320 --> 00:43:34,620 It also implements that. 910 00:43:34,760 --> 00:43:38,480 If you're not totally worried about completely using 100% open source stuff. 911 00:43:38,800 --> 00:43:43,560 There's also GNOME meeting, which uses H.323 or whatever it is. 912 00:43:43,720 --> 00:43:45,340 That can also interact with... 913 00:43:46,320 --> 00:43:47,420 That Windows thing. 914 00:43:49,120 --> 00:43:50,420 I can't remember what it is. 915 00:43:50,580 --> 00:43:51,460 Net meeting, thank you. 916 00:43:52,960 --> 00:43:54,720 There's also Skype, which is not open source. 917 00:43:54,860 --> 00:43:55,580 Please forgive me. 918 00:43:57,660 --> 00:43:58,660 It's still very useful. 919 00:43:59,480 --> 00:44:00,600 It's still a useful tool. 920 00:44:00,680 --> 00:44:02,200 There's a Linux client, there's a Windows client, etc. 921 00:44:03,100 --> 00:44:04,240 Webcams are not necessary. 922 00:44:04,600 --> 00:44:06,280 Don't waste your bandwidth with webcams. 923 00:44:06,400 --> 00:44:08,360 What the fuck are you going to do, sign language to each other? 924 00:44:08,840 --> 00:44:10,880 If you're working with a deaf developer, fine. 925 00:44:12,680 --> 00:44:14,920 If you're not, webcams are a waste of time. 926 00:44:14,920 --> 00:44:15,700 It's a waste of bandwidth. 927 00:44:15,920 --> 00:44:18,120 You want your typing to be very responsive. 928 00:44:18,220 --> 00:44:19,900 You want your audio chat to be very responsive. 929 00:44:24,480 --> 00:44:26,920 I talked for too long. 930 00:44:27,780 --> 00:44:28,440 I'm sorry. 931 00:44:30,920 --> 00:44:32,440 Do we have time for questions? 932 00:44:32,660 --> 00:44:33,220 Where's the person? 933 00:44:35,900 --> 00:44:36,780 Two minutes. 934 00:44:37,280 --> 00:44:38,160 Four questions. 935 00:44:38,540 --> 00:44:41,020 Do you want to ask questions or do you want to see us demo this real quick? 936 00:44:41,300 --> 00:44:41,660 Yes. 937 00:44:42,740 --> 00:44:43,840 Jesus fucking Christ. 938 00:44:46,340 --> 00:44:48,840 The rest of the slides document different tools and things like that. 939 00:44:53,440 --> 00:44:55,160 C-Sharp compiler, blah, blah, blah. 940 00:44:58,200 --> 00:44:58,920 It is good. 941 00:44:59,620 --> 00:45:03,380 The SVN repo for this project is on SourceForge at that URL right there. 942 00:45:03,460 --> 00:45:07,180 It's not in the slides because we wanted to release it exclusively at Black Hat and DEF CON. 943 00:45:07,780 --> 00:45:11,180 It's on the printed slides, so if you're so interested, write it down. 944 00:45:11,380 --> 00:45:12,560 It's not on the CD. 945 00:45:16,480 --> 00:45:17,780 System test failing. 946 00:45:18,840 --> 00:45:19,820 How are we going to do that? 947 00:45:20,720 --> 00:45:21,360 Start VNC. 948 00:45:21,560 --> 00:45:23,500 No, start VNC. 949 00:45:23,620 --> 00:45:24,180 That's a good idea. 950 00:45:24,720 --> 00:45:25,800 Let's just show them the framework. 951 00:45:26,380 --> 00:45:27,720 You can just show them the end unit. 952 00:45:27,940 --> 00:45:28,880 Network is unreachable. 953 00:45:33,180 --> 00:45:34,140 All right, no problem. 954 00:45:45,440 --> 00:45:47,180 It's just, it's not at it anymore, is it? 955 00:45:47,700 --> 00:45:48,140 Oops. 956 00:45:50,900 --> 00:45:51,540 All right. 957 00:45:54,400 --> 00:45:58,300 So, what is it? 958 00:46:00,340 --> 00:46:01,080 That's what I did. 959 00:46:01,960 --> 00:46:02,400 Whoops. 960 00:46:07,720 --> 00:46:08,760 Caps lock on. 961 00:46:10,180 --> 00:46:11,140 Sorry about that. 962 00:46:12,820 --> 00:46:13,640 Sorry about that. 963 00:46:14,000 --> 00:46:14,660 All right, cool. 964 00:46:14,880 --> 00:46:18,760 So, for some reason in Kubuntu, when I do dual monitors, it will only do 640 by 480. 965 00:46:18,840 --> 00:46:22,180 Anybody who knows how to fix this, please let me know so that the talk tomorrow isn't 966 00:46:22,180 --> 00:46:23,820 greater than 640 by fucking 480. 967 00:46:24,060 --> 00:46:29,760 But just to show, like, his laptop is some ungodly 16 by 9 resolution that's, like, 968 00:46:29,760 --> 00:46:32,600 really huge, but just goes to show, like, I can still see. 969 00:46:32,640 --> 00:46:33,420 I can still see the code. 970 00:46:33,480 --> 00:46:34,060 I can still interact. 971 00:46:34,280 --> 00:46:40,160 In fact, I was in the Minneapolis airport stuck because of United Airlines who suck balls. 972 00:46:41,320 --> 00:46:42,280 And Luis was like, 973 00:46:42,560 --> 00:46:43,480 I'm having this compile problem. 974 00:46:43,700 --> 00:46:44,280 I'm not sure what to do. 975 00:46:44,460 --> 00:46:49,760 I was able to use palm VNC on my Treo to VNC into his thing while I was talking with him on the phone 976 00:46:49,760 --> 00:46:52,640 and go, oh, you're using parents and you use less than and greater than. 977 00:46:53,480 --> 00:46:55,080 That's pretty badass in my personal opinion. 978 00:46:56,360 --> 00:46:58,080 So, anyways, so we can see the code here. 979 00:46:58,300 --> 00:47:01,660 And so, this is a, huh? 980 00:47:02,460 --> 00:47:02,940 All right. 981 00:47:03,860 --> 00:47:05,600 It's a VNC connection, basically. 982 00:47:05,740 --> 00:47:11,480 And so, the system sets that we have are one with a simple Python script that will show very briefly for 30 seconds. 983 00:47:13,180 --> 00:47:14,100 These are the unit tests. 984 00:47:14,320 --> 00:47:14,940 This is the green. 985 00:47:15,080 --> 00:47:16,180 You get addicted to the green. 986 00:47:16,420 --> 00:47:19,720 Every time you see more green, it's like you're doing something right. 987 00:47:20,300 --> 00:47:21,920 Every time you see the red, you're like, oh, shit. 988 00:47:22,760 --> 00:47:24,020 That's really what it comes down to. 989 00:47:24,920 --> 00:47:27,940 And every time you see the green, you're like, yes, everything I just did is 100% correct. 990 00:47:28,140 --> 00:47:28,820 And I know it. 991 00:47:29,140 --> 00:47:30,140 It's a real ego boost. 992 00:47:30,680 --> 00:47:33,180 That's basically why there's no other way to work in my personal opinion. 993 00:47:33,800 --> 00:47:35,320 So, the system tests. 994 00:47:35,660 --> 00:47:41,760 We'll show the rest later at the next talk, which is on Saturday at 8 p.m., 995 00:47:41,760 --> 00:47:43,820 assuming that those start on time, et cetera, et cetera. 996 00:47:44,740 --> 00:47:45,100 Thanks.