[MUSIC] Testing is another important aspect of disciplined programming. A lot of people don't like testing, especially students. And, they would rather just get to down to the business of writing their program. But, testing actually makes things easier, and if you do a good job of testing, your development process will be a lot quicker. Because, you won't continue on with bugs in your program. If you build a little bit of your program, test it, make sure it works, then build some more, test it, make sure it works. You build up a working program, rather than writing lots and lots of code where there are lots and lots of bugs, and then you try to test one big mess all at once. This is a recipe for disaster. It makes the whole process much, much longer, and much, much more painful. Okay, so I want you to start thinking about testing as an integral part of the development process. Okay, as you write code you test it. So, we don't like testing either, right? It's not our favorite task. We really want to get our working program, but we understand that testing is an important part of that, and actually makes the process go faster, as I just said. Okay, so we're trying to provide you with some tools that will help you make it go easier. And, I strongly recommend that even if you feel like you don't need to, that you work through the practice exercises for this first week. Where you look at Solitaire Mancala, because part of Solitaire Mancala is about testing, and we show you some of the ways that you can test, right? And, our POC simple test, you know, principles of computing simple test module, is designed to be a very lightweight, very easy to use way of automating your tasks. Okay, so if you look at this page over, here we're talking about some informal testing. I can just write my test, I can write, you know, here's an input, I can run it, I can look at the output, I can see what happens, okay? But, the POC simple test suite, what it does is it allows us to build a little bit more complicated set of tests, that allows you to automate this process just a little bit, okay? And, when I run it, it runs a whole bunch of tests. It prints out what passes and fails, okay? And, this becomes valuable because it'll be easy, the easier it is to run your tests, the more often you're going to run them. Okay, and the easier it is to add new tests as you develop your code, the more likely it is you'll do it. Okay, so if you look at this simple test suite module, and figure out how it works, and try it out, I think that you'll see that it's probably worth a little bit of your time to do this. So, here's a simple function that I want to test called format, or stopwatch format rather. Okay, and so I've written my function, and now I want to test it, so what do I do? Well, I'm going to create a test suite, and then I'm going to import that test peat, suite and run the test, so what does the test suite looks like, look like? Well, here it is, okay, my test suite is importing POC simple test, and then I create a function that I call run test that takes that function, right, then I'm testing format_function, all right? So I create a test suite. I here call suite equals poc_simpletest.TestSuite, and then I have a whole bunch of calls to run_test, where I call the function, and then I give the expected output, and I give a name to the test, all right? And, ultimate, at the end it reports the results, and I get to see what happens, okay? And this is it, it's that simple. So, let's go over here and let's run it, okay? Ran 13 tests, zero failures. Okay, great, well let's screw up the function. Okay, all right let's change that, and run it again. Okay, now a whole bunch of tests failed. I know exactly which test they are, because of the, the name that I gave each test. It tells me what it computed, what it expected. Okay, so it really isn't that difficult to use this. Hopefully, that will encourage you to do so. Okay, most people don't like testing. [LAUGH] I don't even like testing, all right? But, it is a part of computer science, and it's a part of programming. And, if you do it carefully and consistently, and you do it as you develop your application, it's actually not so bad. Okay, and it helps you in the process. If you test little pieces of code at a time, you will have working code always, and you will build up your application from working code. If you say, oh I really don't like testing stuff, I'm just not going to do it, you end up writing big long applications that just don't work. And, then you're going to run it through Altest or Corsair Test, and you're going to get a really bad grade, and it's going to be very hard to debug your problems, okay? So, trust me, most people don't like testing, I understand if you're one of them, but if you do it, it'll work out well for you. Good luck.