Latest / Talk Python To Me / #45: The Python Testing Column, Now a Thing
Transcript
- 0:00What is the role, the core purpose of writing tests for your application?
- 0:03Should you write more unit tests and fewer integration tests, or is it actually the other
- 0:07way around? You may have heard of the test pyramid with unit tests building the foundation.
- 0:11In this episode, we'll talk about a variation on that theme called the test column. We talk
- 0:16about this and more with Brian Okken on episode number 45 of Talk Python To Me, recorded January
- 0:2227th, 2016.
- 0:24Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the
- 0:53ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter
- 0:57where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm
- 1:02and follow the show on Twitter via at Talk Python.
- 1:05This episode is brought to you by Hired and SnapCI. Thank them for supporting the show on
- 1:11Twitter via at Hired underscore HQ and at Snap underscore CI.
- 1:15Hey, everyone. I hope you're looking forward to an interesting conversation on testing software
- 1:21using Python. This week, our guest, Brian Okken, is giving away five copies of his Python testing
- 1:26frameworks book. If you want to be in the running, be sure to visit talkpython.fm and enter your
- 1:31email address to become a friend of the show. Now, let's get right to the interview with Brian.
- 1:36Brian, welcome to the show.
- 1:37Hey, thanks, Mike.
- 1:39Yeah, it's really great to have another podcaster and a friend and a fellow Portlander here all
- 1:45together on Talk Python to talk about testing in Python.
- 1:49Yeah, I'm excited to be here.
- 1:50Yeah, yeah. It's really cool. So for the listeners out there who don't know,
- 1:55Brian is the host of Python Test Podcast, which is a fairly new, but how many episodes have you had?
- 2:03Are you on the ninth or tenth?
- 2:05Yeah, I can't remember. I think I did number nine recently.
- 2:08Yeah, number nine with Harry Percival. Excellent. Listen, that one, that's great. So I'll put a link
- 2:14to the podcast out there. So you spend a lot of time talking about testing and exploring sort of the
- 2:20whole spectrum or pyramid of testing in Python on your podcast, on your show.
- 2:25Yeah, I really want to cover... Actually, the podcast covers everything. I want to cover everything in
- 2:32software development and software testing.
- 2:34So we're definitely going to spend a good amount of time talking about that. But let's start at the
- 2:39beginning. How do you get into programming, Python, that sort of thing?
- 2:42Well, my first introduction to programming was in high school. I took a basic class.
- 2:48High school offered basic at Pascal, and I figured basic has to be easier, right? Because it's got basic in
- 2:54the name. But at the same time, I didn't really get into it too much then. But at the same time,
- 3:00I had a TRS-80 at home. And I spent a little time like typing in games from game listings from magazines,
- 3:08like Lunar Lander was one of my favorites. And then, yeah, I didn't do much more until college. I entered
- 3:16college intending to be an art and math major. And switched about two or three years in, switched to
- 3:24computer science. And then finished up with a bachelor's and master's at computer science.
- 3:29That's cool. So where'd Python come into the story?
- 3:35I learned C++. I learned all sorts of languages, Perl and C++ and others in college. I got a job at Hewlett-Packard doing,
- 3:44well, at first test systems and then embedded programming of instruments. And that was all C++ and still is.
- 3:54And then, I don't know, maybe four or five years later, I was in a group that had a Python test framework for testing,
- 4:03system testing the instrument. And started, that was probably maybe 2000, 2002. And I've been using Python for testing instruments ever since then.
- 4:14One thing that I think is interesting about that, a lot of times people feel like the programming language that the thing you're testing,
- 4:23the application or whatever is built in, that's the language in which you have to write the test, right?
- 4:29So if you're writing a C++ app, you have to fire up CPP unit and do C++ unit testing.
- 4:36That's not really what you're doing, right? Like you're actually testing code that maybe isn't Python, right?
- 4:42Yeah, it's all C++ and other languages inside. And we've got, but it's got a, the interface is available.
- 4:50Anything with an interface that's available from Python, you can use Python test frameworks to test them.
- 4:56And, you know, right off the bat, I had frameworks that the company gave me and didn't even think about it.
- 5:04But, yeah, it was probably 2010 when I started looking into other frameworks like unit test and pi test.
- 5:11Yeah, okay. So let's dig into a little bit of the type of stuff that you test at work, and then we'll come back and talk about your podcast a little more.
- 5:19So what exactly are you talking about instruments and physical things that you're testing?
- 5:25And these are written in what, C++ or like embedded systems with C++ or C?
- 5:31Yeah, it's C++. But these are, you know, there's lots of levels of embedded programming.
- 5:37There's, you know, embedded programming in like, you know, your car or your phone or your watch or whatever.
- 5:45But these are big instruments. These are, I don't know, they look like stereo components, but they're, they've got many processors inside.
- 5:54The box I work on right now runs Windows.
- 5:56So I'm really writing a Windows application, but I don't really do any Windows stuff myself.
- 6:03But it's all written in C++, all of my code.
- 6:06Yeah, the user interface, a lot of people use these for the boxes I work on are mainly used in production lines.
- 6:14And the production line control uses a, I guess, a string based, it's called Skippy, but it's a, it's a special language to control instruments with.
- 6:26Yeah, we, so that's, that's how our users control the box. So that's how we test them.
- 6:30Is that like for like managing factories? So if you're like building cars, like the machines, like put the door on or whatever, like those types of devices?
- 6:39Or what do you, what exactly are you thinking?
- 6:41Well, okay, so the box I work on right now is, is called the communications test box, one box tester, but it, so it tests all the RF, the transmit and receive abilities of a mobile phone.
- 6:54So pretty much, yeah, every, every phone that sells in the world has to go through testing to make sure it, you know, it does it, it, since it's a transmitter, it has to follow FCC rules.
- 7:07I see. So if I like lived down in San Diego and worked at Qualcomm, maybe I would buy your company's product to test the phone internals that we're building, something like that?
- 7:18Yeah. And anybody that's got, and any, we do not just cellular, but also like Wi-Fi broadcasting.
- 7:28So we do Wi-Fi testing and Bluetooth and anything that transmits and receives this box will test pretty much.
- 7:35Okay, cool. And so to test this embedded C++ app, basically, do you do some sort of C level interop with Python?
- 7:46And do you expose some kind of API that Python can understand? Or do you do this Skippy API against it? Or what's the story there?
- 7:53Well, so the magic that glues it all together is a library that's available on PiPi called PiVisa.
- 8:03So, yeah, there's a, Roden Schwartz and National Instruments and others have these Visa DLLs that you can use to interact, to send Skippy over LAN.
- 8:17And I use PiVisa to get at that. So it's really easy. You connect those up and you got to, you just have an object that you can send write and read commands to.
- 8:29Works great.
- 8:30Would you say that that kind of testing is sort of more holistic or is that more like unit testing?
- 8:36It sounds to me like my first guess is like you're kind of hitting the outside, like so maybe an integration test type story, yeah?
- 8:43Yeah, it's definitely like an end-to-end test.
- 8:45We test, I'm testing our entire system.
- 8:50But the kind of the, there is, so, you know, in looking at test frameworks, I'm way more interested in how the fixture model is because I use, we use setup and teardown to actually do things like, you know, move signals around and hit switch boxes.
- 9:08Definitely more of an end-to-end.
- 9:10But we do use ideas like mock, like if I'm testing the measurement capabilities, for instance, it's difficult to test that against a, like a moving target, like an actual mobile.
- 9:23So we'll have an arbitrary waveform generator generate a known signal and we test the receive side against the known signal.
- 9:32And then we can do the other end also, we send our transmission to like a different instrument to test it against something else.
- 9:40When you think of software architectures, you often hear people talk about things like dependency injection and basically managing and decoupling the dependencies of your software so that you can test the individual pieces, right?
- 9:55Yeah.
- 9:56Yeah, definitely.
- 9:57Yeah, but you, it sounds like your dependencies are more solid than, than maybe others, right?
- 10:04Like you've got physical devices and like scientific information coming in and, you know, like waveforms.
- 10:11And so you've, what kind of stuff do you do?
- 10:14That part actually isn't that different, really.
- 10:16I mean, because like on a, if you had like a big user database or something on a web application, the real, the real database on in, in the world is going to be a lot different than your like test database.
- 10:28So that's similar to how our real signals are different from our test signals.
- 10:32The diff, the difficulty is, is the fuzziness.
- 10:35So, we often don't really get, because even with a, a, a pure signal from a generator, we've got, you've got noise in the system.
- 10:45So you can't, you can't just get a, get a number out of a, out of a, a measurement and say, if it's 3.2, then it's correct.
- 10:53Otherwise it's wrong.
- 10:55And almost all of our measurements are, are, we've got tolerances around them.
- 10:59That's really interesting.
- 11:00a lot of people write software that is basically deterministic in, in ways that are easy to assess.
- 11:09So I get a Boolean back or I query for a user and the user is either there or they're not, or they're an, they're an admin or they're a regular user, right?
- 11:19These super clear distinctions.
- 11:21But when you get into sort of sciencey spaces, it gets really hard to actually just know, know that you're right.
- 11:31Yeah.
- 11:31I mean, if you get back a number and it's off by a thousandth, is that still the same?
- 11:37Does that count as okay or not?
- 11:39Right.
- 11:39That, that can be really challenging.
- 11:41Yeah.
- 11:41But there's, I mean, there's, there's ways to do it.
- 11:43We've got, we, we can, there's, we can split the, we, when we're testing the entire system, it's difficult to tell because it, you know,
- 11:51if it's off by 10%, it's hard to, you know, visually know, but, but we can, the actual numbers that go through the system go through, you know, there's, there's the different pieces are, are tested with different rigor.
- 12:08So it all works out.
- 12:09Yeah.
- 12:09That's an interesting point.
- 12:11And I'm, I'm actually not, I'm not the guy that, that tests the box to make sure that the, that it like actually, like if we say we're putting out like minus 10 dB, that it's actually really 10 dB, minus 10 dB.
- 12:25That's like some other guy in, in like a manufacturing facility.
- 12:28I'm, I'm mostly concerned with that, making sure all the heart, all the software didn't muck things up.
- 12:35So, in, in the end, I trust that the hardware is working correctly and I just want to make sure that the software hasn't mucked up the pristine hardware.
- 12:45Right, right, right.
- 12:46So you assume that the hardware you've got is actually processing everything.
- 12:50Okay.
- 12:51But you've got to gather it, save it, interpret it, all that kind of stuff.
- 12:55And so you kind of start at that level, right?
- 12:57Yeah.
- 12:58And then the measurement data that we're turning back, I mean, we're, we're sending back, we've got like thousands of different like measurement points that we're sending back and making sure that we don't muck one of those up.
- 13:10And then we don't put some, some array in the wrong place.
- 13:14that's, that's the sort of stuff that I'm really concerned with.
- 13:17Yeah, that's interesting.
- 13:19One of my first jobs was working at a place called eye tracking, Inc.
- 13:23eye tracking.com.
- 13:25And we would build these scientific visualization tools and sort of data analysis on top of eye tracking data, right?
- 13:33Pupil dilation over time, where you're looking, that, that kind of stuff.
- 13:36And we would end up doing really complicated math sort of pipelines on it, you know, Fourier analysis,
- 13:43wavelet decomposition, those kinds of things.
- 13:45And you try to, you know, test the results of one of those things, you know, it's super hard.
- 13:51So we basically would come up with a reference input and a reference output and go, if the deviation from, from this graph to that graph is, it's not too large, we'll call it, we'll call it the same, right?
- 14:03Because the, maybe they use something like MATLAB to generate the reference results.
- 14:08And, you know, the way it deals with floating point numbers might be slightly different than the language we were using or something like that.
- 14:13Yeah.
- 14:14It's an interesting challenge that I think a lot of people building, I don't know, more standard business apps.
- 14:20It doesn't really get on your radar, right?
- 14:22Because the user is either an admin or not.
- 14:24You know, assert true, done.
- 14:26Yeah.
- 14:27I mean, actually, people that have that sort of a test job, I'm like, what's so hard about this?
- 14:33Just, you know, write the test and get on with life.
- 14:36Yeah.
- 14:36So, okay.
- 14:37So let's, let's look at some of the frameworks and get some of your thoughts on that.
- 14:42So let's say the majority of people listening know what unit testing is, what the goals are.
- 14:48But I know a lot of my listeners are sort of scientists getting into programming or new programmers.
- 14:54So maybe give us just the elevator pitch.
- 14:57What is unit testing?
- 14:58Why do we care?
- 14:59I'm not sure why we care about unit testing, actually.
- 15:02Or software testing, rather.
- 15:05No, so that, that's a, the phrase unit test is a, is one that's kind of a, a sticky point for me because the, in extreme programming, the, they use the term unit test.
- 15:18And that just meant any developer test, anything written by developers, not written by the QA team.
- 15:23And, and in a lot of communities, it's stuck with that.
- 15:27It is, that's the use model.
- 15:31That's what a lot of people commonly term, term a unit test is something written by a developer.
- 15:35And then in the TDD community, that often isn't the definition.
- 15:41The unit test is often the smallest possible, like one function.
- 15:45You're testing one function at a time.
- 15:48And I look at, so there's the most importantly is that the entire, the entire thing is tested.
- 15:56Your entire software is tested.
- 15:57And unit testing is, I think there's certain places where you want to go in and test.
- 16:04I like to put tests anywhere where I have a promise.
- 16:07If I'm promising anybody other than myself that things are going to work right, we need tests there.
- 16:12So if I've got a, a library that other team, other team members use or other, other groups use, that needs tests around it.
- 16:19But the, and in your, anywhere there's interfaces, interfaces between groups or between components.
- 16:26Those are great places to put tests.
- 16:28And then of course the entire system function tests.
- 16:31I think the focus on unit testing, unfortunately takes some of the responsibility out of system level testing where I think it's unfortunate.
- 16:43I think there's different scenarios where things like unit tests matter more and other times they matter less.
- 16:49So times I think they matter a lot are when you have a lot of people all in the same general code base making changes.
- 16:58And you don't necessarily know everything that's changing.
- 17:00Right.
- 17:01So, so people are checking in changes and you're not necessarily, I mean, you're doing code reviews and stuff, but you're not necessarily like always aware like, oh, they actually changed this method that I was depending on.
- 17:12And they didn't understand this like implicit contract I built around the return value here or something like that.
- 17:19Right.
- 17:19Yeah.
- 17:19So I think it's really valuable there.
- 17:22And I think it's valuable for helping, helping build apps where fewer people are working on it.
- 17:28There there's less churn.
- 17:29But one of the things that I saw, you know, early two thousands and in response to the extreme programming was people saw that they, they thought they had to do, you know, 95% code coverage.
- 17:44Everything is TDD.
- 17:45If you don't start that way, it's bad software.
- 17:49You just can't write it.
- 17:50How can you possibly stand up for it?
- 17:52And, you know, over time I saw a lot of people saying, well, we can't do that.
- 17:57Right.
- 17:58We are in too much of a hurry or whatever.
- 18:00You know, they have whatever excuse.
- 18:02A lot of times it wasn't totally unreasonable.
- 18:04We basically say we can't match that level of commitment to testing.
- 18:10So we're not going to do any.
- 18:11And I think that that's one of the places where it can actually, that message of like test everything can become negative.
- 18:19Because, you know, if they had written, like you had said, the thing you're making a promise about, right?
- 18:23Like if, if you're writing like stock trading software, the part that actually says buy or sell, there should probably be tests on that.
- 18:29The, the part that logs that the app started probably doesn't need you in a test, right?
- 18:35There's lots of parts of apps that are just there to support some sort of core.
- 18:39And that core is much more important that it's tested, I think.
- 18:42And what do you, what do you think?
- 18:44Yeah, totally.
- 18:45It's like, I think, actually, I think you brought it up in one of your podcasts recently that, that it's the thing that, the thing that's making you money.
- 18:53The reason why somebody is buying your thing.
- 18:55That's what you should test the heck out of.
- 18:57Yes, absolutely.
- 18:58Like if, if, if that is your thing that you build for the world, that little essence of it, you had better test that, right?
- 19:05Yeah.
- 19:06But there's, as you know, you ship real software.
- 19:09It's like, that's like 20% of the code you write.
- 19:12There's 80% that isn't that.
- 19:14Well, and then I like, I like code coverage tools.
- 19:18But my, a lot of times I think that they're, instead of looking at the, there's two ways to get to 100%, right?
- 19:26There's a, you can either write more tests or you can delete code.
- 19:31I think you should delete more code.
- 19:33If you've got, if you've got a, a bunch of software that is not reachable from the user interface.
- 19:40If, if I can't make some section of the code hit that piece of code with, with normal user input, maybe it doesn't need to be there.
- 19:49That's a really interesting point.
- 19:50Yeah.
- 19:50Yeah.
- 19:51Yeah.
- 19:51This episode is brought to you by Hired.
- 20:04Hired is a two-sided curated marketplace that connects the world's knowledge workers to the best opportunities.
- 20:10Each offer you receive has salary and equity presented right up front, and you can view the offers to accept or reject them before you even talk to the company.
- 20:17Typically, candidates receive five or more offers within the first week, and there are no obligations, ever.
- 20:23Sounds awesome, doesn't it?
- 20:25Well, did I mention the signing bonus?
- 20:26Everyone who accepts a job from Hired gets a $1,000 signing bonus.
- 20:30And as Talk Python listeners, it gets way sweeter.
- 20:32Use the link Hired.com slash Talk Python To Me, and Hired will double the signing bonus to $2,000.
- 20:38Opportunity's knocking.
- 20:40Visit Hired.com slash Talk Python To Me and answer the call.
- 20:49I've spent more than once, I've been giving some big software projects and said, you know, have a look at this, and then we're going to need to have you help us add a feature or recommend some change.
- 21:01And there'll be like some method.
- 21:02I'm like, what does this do?
- 21:04What does this have anything to do with this code?
- 21:07It doesn't seem to do anything.
- 21:08And I'll like study the code and then, you know, two hours later, I'm like, oh, it's never called at all.
- 21:15Yeah.
- 21:15Somebody should have just deleted it.
- 21:17They should have just deleted it and the world would have been a better place.
- 21:20But instead, you know, I wasted two hours.
- 21:23Somebody else probably wasted two hours.
- 21:24And it just gets kicked down the road.
- 21:26The other thing, one of the things that I actually like, I'm writing more lower level tests than I used to.
- 21:33I used to mostly focus on high level tests.
- 21:37But the, and I still do, but lower level tests do have their place.
- 21:43But the, I like the model of, in test-driven development of the red-green refactor.
- 21:48But just don't forget the refactor part.
- 21:51So if a test, putting a test in place makes it so that you cannot refactor something, then maybe that test isn't quite right.
- 22:00I don't want to, I don't want to restrict my ability to change my mind and redesign something.
- 22:05So.
- 22:05I had brought up the, you know, the perfect being the enemy of the good sort of thing where people say, if I can't have really good test coverage, like what, what is it?
- 22:13Well, I'm not even going to start.
- 22:14Forget this.
- 22:15It's too much work to do testing, right?
- 22:17Yeah.
- 22:17Well, and that's, you see that a lot when, when a team like looks at, looks at their code and they go, they get a new manager in or a new, somebody comes in and says, hey, we need to add a bunch of tests to this.
- 22:28But where do you start when you have like a 10 years of legacy code?
- 22:32You can't just cover everything.
- 22:34So yeah, there's a, you got to just start somewhere.
- 22:38You know, I have a book recommendation actually, now that you bring that up.
- 22:42So there, you know, Michael Feathers is a guy that in the early days of test driven development and extreme programming and all that sort of stuff, he was really active.
- 22:52And he wrote a book called Working Effectively with Legacy Code.
- 22:58And it's, you know, given the time, it was a little more C++ focused, but it has some really amazing ideas of like, how do I take this app, which has a million lines of code and zero tests, and start carving out little epochs of code functionality that are supported by tests and ways you can do that that are safe.
- 23:20And definitely recommend it.
- 23:22If people are dealing with like huge apps that are not yet tested and put together in a way that makes them basically untestable, check out Michael Feathers' book.
- 23:31Okay.
- 23:32Yeah.
- 23:32Have you seen that one?
- 23:33Definitely.
- 23:34I've got a difference of opinion on that one, but I'll just let that go.
- 23:38No, no, no, no, no.
- 23:39I wouldn't hear it.
- 23:40Tell me.
- 23:40I think it just seems silly to try to add a bunch of unit tests to a bunch of existing code.
- 23:46I think it's way more profitable for your company to put functionality testing around it.
- 23:52And because they like the end to end functionality testing of your system.
- 23:57If, if you know, like you, you need to know if you're going to refactor something, you need to know that the end functionality is still working solid.
- 24:06And if you have tests in place to guarantee that, then what value is it to, to go in and add like thousands of unit tests?
- 24:16Sure.
- 24:17So I think that's a totally, totally valid point.
- 24:20And I think, you know, it's been like, gosh, it's probably been 12, 13 years since I read that book.
- 24:25So, you know, I'm, I'm going to only get it like a little bit, right.
- 24:28But I think the idea was like, suppose you've got some huge, you've got a library you're calling and like you hit the outside method, like some, you know, do your thing library.
- 24:37And it gives you an answer back rather than trying to set up a whole bunch of tests inside there.
- 24:42The question was like, well, how could I refactor some dependency or some bits?
- 24:48Right.
- 24:48So maybe what you do is you just come up with a bunch of inputs, save the outputs and go long as those don't change.
- 24:53We're going to call it good.
- 24:55It was some, some like really basic scaffolding to say the thing kind of looks still okay.
- 25:01Yeah.
- 25:02I mean, I think looking at, putting tests around the outside and then also looking at the different interfaces in the side of the system and, and maybe sure, maybe adding some different interfaces that weren't there before to try to separate the design.
- 25:14But all of that involves like a redesign and you're not going to, you're not going to guarantee that you're not breaking external functionality.
- 25:22It's just, it's just, they don't, they don't test for that.
- 25:27Yeah, that's right.
- 25:29So I think that's, that's probably an interesting thing to explore a bit is, can we be talking about unit tests and the whole extreme programming origins of it and all that, but there's kind of what you refer to on your show as like a pyramid of testing capabilities or functionality.
- 25:46Can you go into that a bit?
- 25:47Yeah, sure.
- 25:48Well, I don't really like the test pyramid, but if you, if you do much reading about software testing, you'll run into a test pyramid.
- 25:55All right.
- 25:56So the test pyramid, the notion, if you read in, do any reading on test software testing, you'll run across references to a test pyramid.
- 26:05So the idea is, a foundation of unit tests and some integration tests and very little functional tests, just end to end tests.
- 26:16And, um.
- 26:17Right.
- 26:17Kind of like a food pyramid where like the dessert is at the top.
- 26:20You should have just a little tiny bit and that's the functional bit at the top.
- 26:23Yeah.
- 26:24And, what, what, and the, there's the reason is because supposedly functional system testing is, doesn't give you much benefit and it, they break and they're brittle and they're fragile.
- 26:37I just don't buy it.
- 26:39and what, what happens I think is developers see that and they go, Oh, okay.
- 26:44Focus on unit tests and leave, leave the end to end test to QA.
- 26:48The problem with that big problem with that is a lot of teams don't have a QA anymore.
- 26:53So there's nobody doing end to end tests.
- 26:56Somebody's got to.
- 26:58so it's, if there's no QA, then it's your customers.
- 27:01And, I don't think that's the right person to do quality assurance.
- 27:05So I think that focusing on, maybe a column of tests, it should be a column, not a pyramid.
- 27:16Do, do the tests where they make sense.
- 27:18You've got to have full behavior coverage, end to end wise to make sure that your system works the way you promised it's going to work.
- 27:28And, and also like with, especially with, continuous integration, if you're relying solely on automated tests, those have to be promises that you're trying to keep to the customer.
- 27:40And then, I don't really know what integration tests are.
- 27:44There's a lot of definitions for it, but it's the middle part.
- 27:47And sometimes it's integration test means integrating with the outside world.
- 27:52So if you're integrating with a database library, it's tests against that.
- 27:56But then also some people think of, integration tests as between two components or between two functions.
- 28:02And then unit tests are the low level while you're designing your code.
- 28:06I don't know.
- 28:07I think that you just need to use your own.
- 28:10I don't think there's a rule of thumb.
- 28:11I think you got to use your judgment and put tests where it makes sense.
- 28:14I think that, yeah, I really feel that that's, that that's good advice, right?
- 28:19The whole, let's make, make the top part of the pyramid a little fatter and make it more like a column.
- 28:24Yeah.
- 28:24So I think that makes a lot of sense because let's say you have a thousand unit tests.
- 28:29I actually, I'm with you.
- 28:31I don't really know what an integration test is, but say you have a hundred of those and you're at 10 functional tests, right?
- 28:35Do you really need the thousand unit tests or are those 10 functional tests enough?
- 28:42Maybe.
- 28:42Well, a lot of the arguments for the, a lot of the unit tests are to make sure that, you know, somebody else doesn't break your units or something.
- 28:52But I don't know if you, I just think functional testing needs to be done more.
- 28:57So, well, you know what I think the origins of it are.
- 29:00I think it has to do with the TDD side of things like you, it's very difficult to functional TDD.
- 29:08I think it's, I think it works great.
- 29:12well, like, Harry brings it up and it's been brought up by others as kind of a double loop TDD where you, you start, start with the functional test.
- 29:21And then, and then, while you're trying to fix that functional test, that's failing, you write a bunch of unit tests.
- 29:29I think that works, works good.
- 29:31I just, you know, once you have the functional test working, do you need to keep the unit tests?
- 29:38I don't know.
- 29:38It's kind of up to you.
- 29:39I think keep them if, if they're not, I think of a unit test is like scaffolding, right?
- 29:46So if you're, well, you're, if it helps you to build your software to put a bunch of scaffolding around it.
- 29:50Great.
- 29:51But, once it's built, I don't know, some of the scaffolding can come down maybe.
- 29:56Yeah.
- 29:57You're left with_columns or something, right?
- 29:59Interesting.
- 30:01Yeah.
- 30:01I think that's a good way to look at it.
- 30:03I think one of the really big values that unit tests provide in to some degree, the functional
- 30:10tests and integration tests is they get you to think about how your function or object or
- 30:17API is used from the outside sooner.
- 30:20Yeah, definitely.
- 30:21And that, that's why I think focusing on interfaces, if you, if you're really building an interface
- 30:25that you need to have clean, then it needs to be, it needs to be changeable.
- 30:31But, and tested, but like if, if, like, so let's say I'm writing a handful of classes that
- 30:36all work together and I'm, I'm the main developer in this section of code, it's just going to
- 30:42be me, right?
- 30:42so if it, I don't think I'm going to put a unit test around every function because that
- 30:49means every time I want to refactor this system, I've got to change all the unit tests.
- 30:55As long as this, this subsystem works from the outside world.
- 31:00I think that's enough.
- 31:01I think one of the big mistakes that people also make, you know, in addition to being,
- 31:06letting like the perfect be the enemy of the good and just saying, well, we can't do perfect.
- 31:10So we're not starting.
- 31:10I think the other problem is that people write unit test code in a different mental state.
- 31:17Let's just say test code, right?
- 31:19Cause you know, it's, it's up and down the column that you're defining here.
- 31:24Yeah.
- 31:25So I think they write those in a different mental state than the core of their application.
- 31:31Like I've seen plenty of people just go to unit tests and just copy, paste, copy, paste,
- 31:35like 10 lines of code.
- 31:37And like, what are you doing?
- 31:39Like, would you do that in normal code?
- 31:41Of course you wouldn't, right?
- 31:42You'd make that a function or some sort of object or something.
- 31:46Right.
- 31:47But that makes it way more painful to refactor or evolve your code when you've got 20 copies
- 31:55of the thing that you have to maintain.
- 31:56Well, yeah, that's another reason why I think you had to be careful with the whole, like,
- 32:00have a, have as many unit tests as you can write in a day because it's, it's an, it's
- 32:06a code asset, but it's also, it's also a, it's a weight around you.
- 32:10You've got to, you've got to keep it all the time and you've got to change it.
- 32:13It's, it's code maintenance.
- 32:14There's test code maintenance just as there is normal code maintenance.
- 32:17Yeah.
- 32:18So I think you can structure your test code.
- 32:20Most people's test code could probably be refactored to be way more maintainable.
- 32:25And so that's good, but, and people should do that.
- 32:28But like you say, like more is not always better.
- 32:31I think if you think of what are the main use cases that a user is going to do with your application,
- 32:36if you can test those, chances are all those little edge cases that you're testing, if they
- 32:42were to go wrong, your main user stories or whatever don't really work anymore.
- 32:48Right.
- 32:48So do you have to write those little tests?
- 32:50That's, that's an interesting question.
- 32:51Well, I think that if, if a user, I, all the edge cases from a user's perspective, from
- 32:57like an end user, those should be tested.
- 32:59I definitely think you ought to test the edge cases, but the edge cases of
- 33:05every function.
- 33:06I don't, I don't think so.
- 33:08If you've got like, like a, one of the examples I've given before is if I've got a, a username
- 33:14that goes through the system and in some, some function that has to intercept that takes a
- 33:20string then.
- 33:20Right.
- 33:21So do I need to test to make sure that string can handle a thousand characters?
- 33:25maybe not.
- 33:27It's interesting to question these assumptions about, you know, how many tests should you have?
- 33:33How, how should they, should they be in a pyramid where it's, you know, decreasing as you go up
- 33:38or should they be kind of more flat and so on?
- 33:42Well, the, it's, it, and it's, it's sort of theoretical, right?
- 33:46Because it just, it changes with every situation and the tests need to be an asset so that you
- 33:50can, if they need to be such that you can trust that if the tests pass, your code is good and
- 33:57whatever the tests have to be so that you can trust that you can check something in and it's
- 34:02good because the tests pass, that's where you need to be, whatever it takes to get to
- 34:07there.
- 34:08Yeah.
- 34:08And related to that is if you have tests such that it takes 15 minutes to ask the question,
- 34:14do my test pass, people are going to stop running them and they just become stale.
- 34:19All right.
- 34:34This episode is brought to you by SnapCI, the only hosted cloud-based continuous integration
- 34:40and delivery solution that offers multi-stage pipelines as a built-in feature.
- 34:45SnapCI is built to follow best practices like automated builds, testing before integration,
- 34:50and provides high visibility into who's doing what.
- 34:53Just connect Snap to your GitHub repo and it automatically builds the first pipeline for you.
- 34:59It's simple enough for those who are new to continuous integration, yet powerful enough to run
- 35:03dozens of parallel pipelines.
- 35:05More reliable and frequent releases.
- 35:07That's Snap.
- 35:08For a free, no obligation, 30-day trial, just go to snap.ci slash talkpython.
- 35:14Well, that's the other beef I've got with, with the, the, a lot of the unit test stuff
- 35:27with the testing and isolation.
- 35:29So I don't even get that.
- 35:30So if, if I want to, so one of the things is if test, the test suite is slow, you're not
- 35:35going to run it.
- 35:36So we've got it.
- 35:36We want to try to speed up test suites.
- 35:38But one of the ways to do that is to isolate every single function and every single test so
- 35:44that the test doesn't rely on it.
- 35:46This function doesn't rely on anything else.
- 35:49But then if I've got such isolated tests, why am I running the whole suite?
- 35:54Just run the thing, run the tests over the thing that I'm testing.
- 35:58Right.
- 35:58Because if you're not testing the integration, then you're doing like 95% rework that theoretically
- 36:05doesn't affect you, right?
- 36:05Right.
- 36:06If I'm writing code that, is modular and everything, if, like the stock example,
- 36:12um, if I want to check to see if the buy button works, I don't need to test to make sure that
- 36:18that functionality that I changed didn't break the printing function.
- 36:22Yeah.
- 36:23Yeah.
- 36:23The about page shouldn't fail when I change the trading engine, right?
- 36:26Yeah, exactly.
- 36:29So one thing that you talked about on, I think it was show eight, if I recall my,
- 36:34my ordering correctly, of your podcast was the theme was like writing software is like
- 36:42nothing else.
- 36:42And I found that really interesting and it really resonated with me, not necessarily on a testing
- 36:49level, but on a software engineering level, right?
- 36:53Like people say people typically who are not skilled in the art of writing software will
- 36:59come and say, Hey, look, your title is software engineer.
- 37:04We have other types of engineers.
- 37:06They build like bridges.
- 37:07They can tell us within 10% accuracy of not just the cost of the project, but the duration
- 37:17of the project and how many people need to be on it.
- 37:19Why can't you do that with software?
- 37:21And I think your, your sort of a riff on software is like nothing else.
- 37:24It was really, I think it was neat.
- 37:26Well, I appreciate that.
- 37:29I like that as well.
- 37:30The, that notion that it's like engineering or it's like architecture or it's like,
- 37:36you know, whatever it isn't, it's, it's, it's its own thing.
- 37:40It's hard to define what, what it's like.
- 37:43And now as I'm in a management role, I've got to do some of those things.
- 37:46I've got to come up with estimates and I'm, I'm often the evil guy that says, well, how long
- 37:51is this going to take?
- 37:52Are you going to be done next week?
- 37:53and, and I know the answer is nobody knows, but, but you know, you've got to ask
- 37:59those questions anyway.
- 38:00So.
- 38:01Yeah.
- 38:01I read a book by somebody and I totally forgot all the details.
- 38:04So I think it's lost.
- 38:06It was talking about this and it said, you know, people often refer to software engineering
- 38:14and I'd actually personally don't really like the term software engineer much.
- 38:17I call myself a software developer because I think it's, I don't want to put it too near
- 38:21architecture or engineering in people's mind.
- 38:24But it was saying, you know, one of the fundamental differences between like a civil engineer that
- 38:28builds a bridge and somebody that builds a soft piece of rich and interesting software is that
- 38:36you have to build the bridge over and over and over.
- 38:39If I'm going to build a bridge across this river, I'm going to build it here.
- 38:44And then, oh, we need another bridge.
- 38:46It's about like that bridge, but it goes across this river and it's just this much wider.
- 38:51Right.
- 38:52And so you can't, if this was software, you would just like take the bridge and change a
- 38:56setting and move it over.
- 38:57Like you would make a copy of it, but you can't copy bridges.
- 39:00So you rebuild them over and over and over.
- 39:02And in software, if a thing already exists, you just use it and you copy it and you incorporate
- 39:09as a library.
- 39:10If you're writing something often, I mean, I know there's a lot of wasteful reuse and what
- 39:14are a re rewriting, you know, not made here.
- 39:16So we're going to do it ourselves.
- 39:18But generally in software, if you're writing software, it's because it doesn't exist.
- 39:24It hasn't been done before.
- 39:25And that really gave me a different perspective.
- 39:27What do you think about that?
- 39:28Yeah.
- 39:29Well, there's a lot of not admitted here that I run into as well.
- 39:35And it also, there's, it takes a certain kind of person that's willing to dig through libraries
- 39:41and see if it applies to your problem right now.
- 39:43But yeah, the thing that I think software is most like actually is probably writing, like
- 39:53technical writing or just any kind of creative writing.
- 39:56Because like in, in, in literature and lots of forms of writing, we often talk about the
- 40:04first draft is, I mean, we talk about it as a draft.
- 40:06You have a first draft and that's not even usually the first thing.
- 40:11Usually you start with notes and then you go to a first draft and then, you know, you have
- 40:15many drafts before you have something that's ready for somebody else to read.
- 40:19That's probably closer to software because we, in the iterative approach, you, you, except
- 40:24for there's a lot of software engineers or software developers that, that think they're like awesome
- 40:30and that their code is perfect all the time.
- 40:32And that's just ridiculous.
- 40:34You need to let go of stuff and be willing to throw stuff away and redo it.
- 40:38Yeah.
- 40:38Throwing away code that you've worked on is hard to do.
- 40:42It's fun though.
- 40:44You should do it more often.
- 40:46And that's why I like, I like to, I like to put tests around the things that I'm not
- 40:51willing to throw away.
- 40:52And those are the interfaces that I have promises to.
- 40:54So that's, that's really where I like to, the creative freedom of software to be able to,
- 41:00to take an entire chunk of code, even if, you know, even a week before ship date and say,
- 41:06no, this stuff's just rotten.
- 41:08We need to just rewrite it.
- 41:09Instead of trying to figure out what it does, let's just re, re implement it.
- 41:14Certainly I've spent hours trying to figure out what a piece of software does and then
- 41:21more time trying to understand, well, can it be adapted to this situation?
- 41:26And is it sufficiently generalized?
- 41:28And, you know, we're not even talking about like, is it thread safe?
- 41:33And all these other like weird edge cases you might have to care about.
- 41:36Right.
- 41:37By the time you're done with that exercise, it was probably like two hours to write that
- 41:40functionality from scratch, right?
- 41:42Yeah.
- 41:42Possibly, you know, I mean, not always, but possibly.
- 41:45And then other things where I've like, I've spent a week writing something, but, but I think of, I like to try to think of the first time writing a piece of software as learning about what the problem is.
- 41:57And so you don't have to relearn the problem.
- 42:00You've already know it.
- 42:01So if you even like deleted all the files and started over, it would take you a day for the second time.
- 42:07And then the third time, maybe an hour.
- 42:09Just don't be afraid to throw things away.
- 42:11That's interesting because you think I spent a week working on this, but it's understanding the problem, like you say, and like thinking through the trade-offs.
- 42:21And, and a lot of that probably gets better with time as you understand it better, not worse.
- 42:26Now, the place where people really want to throw a code away is other people's code.
- 42:31And that's where I think people should like hold off a little bit.
- 42:34And like the Michael Feathers book that you brought up, around that timeframe, there was a lot of talk about what to do with all this horrible legacy code.
- 42:43And, and I never think of legacy code as a bad word.
- 42:48It was a bad word for a while.
- 42:50I don't know if it still is, but I think of legacy code as the stuff that's paying my salary.
- 42:55So I really like legacy code.
- 42:58so I treat it like that.
- 43:00I treat it as the thing that's giving me money right now.
- 43:03Legacy code that's still being used by definition was something that was super valuable and useful.
- 43:08Right.
- 43:09Or I guess somebody left some old website running, but generally speaking, it's, if it was not useful, it would have been turned off or somehow outdated.
- 43:18Right.
- 43:19Yeah.
- 43:19Well, I mean, in, we're, we're, I'm thinking more along the lines of the, the, my job right now.
- 43:25we've got, I mean, a, a test instrument's got thousands of lines of code and the, it goes back.
- 43:31Like I started on the code base that I'm working on now, maybe five years ago, but, it had 10 years of history before I got there.
- 43:40So this code is, old, even if the people are still around that made the decisions, they, they don't remember why they made certain decisions.
- 43:49So if there's some weird switch case statement, you got to try to find out, well, that's one of the hard parts is trying to find out is this, was this intent, an intentional decision or just a whim of a developer?
- 44:01How many different, types of version control has it gone through?
- 44:04Like, was it CVS in the beginning or something like this?
- 44:07Or is it still on the same one?
- 44:09I'm not, I think it did switch.
- 44:11I'm not sure what it was initially because there were, there are some like, the time where they would put like the version string and the header of the file.
- 44:20Those are still around, but they're not filled out anymore.
- 44:23right now we're, we're actually using clear case, which, I'm not real thrilled about, but it's not terrible.
- 44:31One of the things that you have going on at python testing.net is you have a book that sort of compares the three major frameworks that people might use to, you know, they're, they're called unit testing frameworks.
- 44:44But like you sort of point out, you can choose the level of aggregation or isolation you want to get into to sort of run the spectrum, right?
- 44:52Yeah.
- 44:52Yeah.
- 44:53Thanks for bringing that up.
- 44:54Yeah.
- 44:54What's the story with your book?
- 44:55I was around like 2010.
- 44:58I found myself without a test framework and I looked at those three.
- 45:01I looked at unit test, nose and pie test, and I had trouble.
- 45:06I looked at him like what I mean is I searched on the web and tried to read things about him, but I couldn't tell whether they were going to be useful for my job or not.
- 45:14And I needed something right away.
- 45:15So I wrote my own, but, and while I'm, while I was maintaining my own, test executive, for work, I started researching these and I wanted to,
- 45:28try to try to play with them and create something so that nobody else had to go through what I did.
- 45:34If trying to track down what's, what's true information and what's old and what's new.
- 45:38So I went through like, a simple math problem and, and a little, string conversion problem and, used, those three frameworks, on those, this, on the same problem.
- 45:53So people can see apples to apples, compare the three frameworks and, and then extended just, you know, the basics of getting, getting a test running, through to how fixtures work.
- 46:07And it's really the mechanics of the mechanics and syntax of test writing.
- 46:11And I, I've, I've written other about other things, but the book is, basically a collection of those, mechanics posts so that people can come up to the speed really quickly on, on any of those frameworks and compare them as well.
- 46:28Yeah.
- 46:29That sounds really helpful if you're, you're getting started and you're not really sure what to start with.
- 46:34So do you pick a winner in the book?
- 46:36you know, I didn't in the book, but I think, I think pytest is a clear winner for me because of the fixture mechanism that's built in.
- 46:47Plus it's a superset.
- 46:48pytest really does everything that the others do and more.
- 46:51There's definitely applications that I, and I, when I got into it, I expected to, to pick one and like, not like the others.
- 47:00I'm not there yet.
- 47:01I think all, all three of those are reasonable.
- 47:03the most reasonable is, probably unit test and pytest.
- 47:08Those are the two.
- 47:09Yeah.
- 47:09Unit test is probably the most, what, like straightforward.
- 47:13I, I don't think it's straightforward.
- 47:15I think it's, I think it's the most confusing to start with, because it's, it's this X unit style that came from Java that you have to derive from a, you have to derive from a test case class.
- 47:27And also you can't, I mean, they discourage you from using straight asserts.
- 47:32You should use these assert helper functions.
- 47:34And, you know, I think there's more to memorize.
- 47:38If you, if you're just starting out, pytest is a lot easier.
- 47:41And there, there, I don't, I don't think any, anybody new to this should use nose, because it's not really supported by a very, I don't even know if it is supported anymore.
- 47:53There, there has been a little bit of effort on it, but not much.
- 47:56but there's, I included writing about it because there is, there's quite a few people that still use it.
- 48:02And if, if you're not, if it's not your decision and it's your job to use it, then I want to, I want to have a reference for people to be able to come up to speed quick.
- 48:11I think I'm going to, I would like to write a follow-up book.
- 48:14So the book I have now, it's just a, like I said, it's a $5 collection of, of all of the, of a whole bunch of posts.
- 48:22but I'm, I'm, I'm, I write, I read a lot on a Kindle.
- 48:27So I wanted to make sure that those sorts of posts were available on, for somebody to be able to read on a, a e-reader or something.
- 48:34Yeah, nice.
- 48:35And I'll be sure to put a link to the book and whatnot in the show notes.
- 48:38But I do want to write a follow-up that, instead of just a collection of posts is actually in a, in a kind of a technical book format, and walks through stuff and doesn't repeat things too much.
- 48:50and I don't, I don't know if I'm going to include no's.
- 48:54I, I think that, I think it would be sufficient to just include unit test and pi test in the discussion.
- 48:59Yeah.
- 48:59Okay.
- 49:00So, you know, six years ago, maybe the space looked differently and now you're like, all right, pi test is kind of the clear winner in some ways.
- 49:10And then, well, unit test is a built in, so people are choosing it because it's built in.
- 49:15I mean, it's also, I mean, for a lot of like algorithmic things, like in the things I do that are heavy on fixture use, pi test is a clear winner.
- 49:24If it's, if you've got a whole bunch of tight algorithms and you're in test speed really is a, the overhead of the overhead of pi test isn't very much, but the overhead of unit test is less.
- 49:36So if, if test speed really is a, if you're trying to catch every millisecond out of your test suite, unit tests will be a little faster.
- 49:44Right.
- 49:45Okay.
- 49:46Good to know.
- 49:46I'll probably get a bunch of hate mail from the pi test people, after, after this, but.
- 49:50Oh yeah.
- 49:51I think we've set ourselves up to receive a lot of, feedback on various areas, but.
- 49:57There's a lot of respect between the people that are developing unit tests and the people that are developing, developing pi tests because they're, they're, they're, it's, there's two ways to solve the same problem.
- 50:06And, they're learning from each other.
- 50:09And, and I think having both around is a very good thing.
- 50:12Yeah.
- 50:13Yeah, absolutely.
- 50:14All right.
- 50:15A few more things I want to talk to you before, before I let you go.
- 50:18Tell us a little bit about your podcast.
- 50:20It, it was kind of a follow onto the book, right?
- 50:23You wrote the book and you've got the website that's, that's doing a lot of good.
- 50:27And you're like, you know, let's, let's make this more, more of a weekly, semi weekly sort of conversation with the world.
- 50:33Right.
- 50:33Right.
- 50:34So the intent was actually to start off weekly and get more than a weekly, like maybe a couple a week, but, it's, I'm really trying to do one a week, but it's, I'm really trying to do one a week.
- 50:43But it's often once a month.
- 50:46The, I want to cover more topics that I can, then I can write blog posts about.
- 50:52And so that's the real, the real reason why I'm doing the podcast is to try to cover more topics.
- 50:57And also, things that I think somebody wouldn't necessarily read about.
- 51:02Like, I did an episode on the waterfall model that I think, you know, it'd probably be an interesting thing to listen to.
- 51:09But you know, pump somebody's probably not going to go read about the history of the waterfall model.
- 51:15So I've noticed that a lot of my, my audience is coming from developers and from testers.
- 51:21And I know that from my own experience as a developer that there might, there's huge gaps in my education where it comes to testing.
- 51:30So a developer usually gets a test.
- 51:31the introduction to testing is to talk about test driven development.
- 51:36And the, writing a test part, we, we get a statement that says first write a failing test, but no information on how to do that or what the test should look like.
- 51:47And, and then, on the other end, you've got testers that come, you know, maybe come from a different kind of background and they don't have a lot of the skills and education that developers had, but they're expected to write automated tests.
- 52:00Now I really want to, on both sides, I want to fill the education gaps in both testers and developers to, to fill all those gaps in.
- 52:09And I know that people are busy.
- 52:11They've already got a ton of stuff to do.
- 52:12So I thought an audio format would be a good way to do that.
- 52:15So people can, you know, get a little bit on their way to work or whatever.
- 52:18Yeah.
- 52:19And it's definitely a different type of interaction than a blog or, or a book, right?
- 52:25Even than it, even different than an audio book.
- 52:28You know, you can just fire up your podcasts while you're driving, biking, walking, doing the dishes, whatever.
- 52:34I really liked that format.
- 52:35So obviously I guess I'm spending a lot of time on it, right?
- 52:38Yeah.
- 52:39And I also, I was finding that I wasn't writing as much as I wanted to.
- 52:43And I thought maybe I could, and I have a less time now as I go into a manager role.
- 52:49And I thought maybe it'd be easier to do a podcast than it would be to write.
- 52:53But I've found out that it actually takes more time than writing.
- 52:57It's a lot of work, but it's, it's also a lot of fun, right?
- 52:59To hear back from everybody.
- 53:00So I just love it.
- 53:01And, one of the things I was worried about that my, so I'm, since I'm not a web developer,
- 53:07I thought that a lot of the audience is from web development community, but the, I thought
- 53:12maybe that would be a hindrance.
- 53:14But when I was talking to Harry, I think there's a lot of similarities to how, how web systems
- 53:19go together and, and complex embedded systems.
- 53:22So I think, I think it all works out.
- 53:24Yeah, I would say so.
- 53:26And I think the diversity of viewpoints, it's super helpful.
- 53:29Like not everybody's writing straight up web apps.
- 53:31So plus I've heard, heard from a lot of people, that I would have, would never have heard
- 53:36from otherwise.
- 53:37Yeah.
- 53:38Yeah.
- 53:38That's, that's really cool.
- 53:39So I'm really glad to see it going well for you.
- 53:41That's awesome.
- 53:42I know we spoke just a little bit before you guys started.
- 53:44So that's cool.
- 53:45Good to, good to see it going.
- 53:46And speaking of that, we are both from Portland and something awesome is happening in Portland
- 53:52in June, right?
- 53:53Yeah.
- 53:54PyCon is here.
- 53:55Yay.
- 53:55Yay.
- 53:56PyCon comes to our hometown.
- 53:58I happen to be living in Germany for a year, so I'm flying like 12 hours to get there, but
- 54:02nonetheless, I'm still going to go.
- 54:04It's going to be awesome.
- 54:05Are you going?
- 54:06Yeah, definitely.
- 54:08and I put, actually I've, I've submitted, four proposals, three talks and one
- 54:15tutorial.
- 54:15I don't know if I'll get any, but we'll see.
- 54:18Oh, very nice.
- 54:19That's awesome.
- 54:19So hopefully, hopefully they do get accepted.
- 54:21That'd be great.
- 54:22Yeah.
- 54:23So if people are going, I'm sure a lot of listeners are going to go, feel free to reach
- 54:27out to me and I'm sure Brian, you'd be interested in meeting people that want to chat as well.
- 54:31So.
- 54:32Yeah.
- 54:32What, one of the things we talked about is giving away some copies of my book.
- 54:36Yeah.
- 54:36So if you go to talk python.fm and at the top, it says friends, the show, long as you
- 54:42are subscribed on that list, all it takes is an email address.
- 54:45We will, I will, I suppose only one of us will do this randomly choose.
- 54:50What do you say?
- 54:50Five copies.
- 54:52Yeah.
- 54:52Let's give away five.
- 54:53Awesome.
- 54:53So on the week that this show comes out, I will randomly choose five listeners from the
- 54:59friends of the show and we will be shipping you eBooks of Brian's testing Python testing
- 55:05book.
- 55:06Yeah.
- 55:06Unfortunately, it's got a really long title that I don't even remember.
- 55:09We'll ship you the book about testing with a really long title.
- 55:15No, no, it's good.
- 55:15We'll definitely send you an eBook copy.
- 55:18So sign up and you'll be in the running.
- 55:20Thanks for doing that, Brian.
- 55:21That's awesome.
- 55:21All right.
- 55:23Parting thoughts.
- 55:24I always ask my guests, well, unless we run out of time.
- 55:28If you're going to write some Python code, what editor do you use?
- 55:30I use Sublime, but I use it for everything, not just Python code.
- 55:35Sublime is good.
- 55:36Very nice.
- 55:36Very nice.
- 55:37And PyPI packages.
- 55:38What one's your favorite or people maybe don't know about they should?
- 55:41Well, this is probably nobody's going to care about this, but my favorite is PyVisa because
- 55:46I couldn't do my job without PyVisa.
- 55:49Nice, nice.
- 55:49Yeah.
- 55:50So PyVisa for talking to the machines.
- 55:52That's cool.
- 55:53And then maybe I'll throw in pytest as well, right?
- 55:56Because that's not built in.
- 55:57Oh, right.
- 55:58Yeah.
- 55:58I guess I should have brought that up.
- 56:00Perhaps.
- 56:01No, no.
- 56:02It's all good.
- 56:02They all go together.
- 56:03One of the things, because it's not a package, but I'd like to do a shout out to the Anaconda
- 56:09team or whoever does that because that's the distribution that I encourage people at work to use.
- 56:16They're doing really amazing stuff.
- 56:17Yeah.
- 56:18That's Travis Oliphant.
- 56:19And the Continuum guys, they were on show 34 and they definitely make Python in general
- 56:25more accessible, especially on Windows.
- 56:26So very cool.
- 56:27Yeah.
- 56:28It's actually that show that got me to download the Anaconda package and try it out.
- 56:32Oh, nice.
- 56:33Very cool.
- 56:34So final call to action before we say goodbye.
- 56:36Subscribe to your podcast.
- 56:38How do they do it?
- 56:38Oh, yeah.
- 56:40On the pythontesting.net slash podcast, there's a bunch of information there.
- 56:48And I've also got a, I send people information.
- 56:51I've got a little email newsletter that goes out whenever I post anything new.
- 56:56You can reach me on Twitter @brianokken or the podcast is at test podcast.
- 57:02Awesome.
- 57:03Awesome.
- 57:03And all that's going in the show notes.
- 57:04Brian, this has been really fun and it's interesting to get different opinions on testing.
- 57:10So thanks so much for sharing yours.
- 57:11Oh, yeah.
- 57:12Thanks a lot for having me on.
- 57:13You bet.
- 57:14Talk to you later.
- 57:16This has been another episode of Talk Python To Me.
- 57:18Today's guest was Brian Okken.
- 57:20And this episode has been sponsored by Hired and SnapCI.
- 57:22Thank you guys for supporting the show.
- 57:24Hired wants to help you find your next big thing.
- 57:27Visit Hired.com slash Talk Python To Me to get five or more offers with salary and equity presented right up front.
- 57:33And a special listener signing bonus of $2,000.
- 57:35SnapCI is modern, continuous integration and delivery.
- 57:39Build, test, and deploy your code directly from GitHub.
- 57:42All in your browser with debugging, Docker, and parallelism included.
- 57:46Try them for free at snap.ci slash Talk Python.
- 57:49You can find the links from today's show at talkpython.fm/episodes slash show slash 45.
- 57:55And be sure to subscribe.
- 57:57Open your favorite podcatcher and search for Python.
- 58:00We should be right at the top.
- 58:01You can also find the iTunes and direct RSS feeds in the footer of the website.
- 58:05Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
- 58:10You can hear the entire song on talkpython.fm.
- 58:13And don't forget to check out the new podcast t-shirt at talkpython.fm/shirt
- 58:18and share your love for Python with the whole world.
- 58:21This is your host, Michael Kennedy.
- 58:23Thanks for listening.
- 58:24Smix, take us out of here.
- 58:30Haven't been sleeping.
- 58:31Haven't been sleeping.
- 58:32I've been using lots of rest.
- 58:33I'll pass the mic back to who rocked it best.
- 58:36I'm first developers.
- 58:38I'm first developers.
- 58:40I'm first developers.
- 58:41I'm first developers.
- 58:44I'm first developers.
- 58:45I'm first developers.
- 58:47First of all, first of all, first of all, first of all.