[MUSIC] One critically important aspect of software development is testing. Now in another video, we're going to to talk a little bit more about testing on your own. But in this video, I'm going to to talk about the testing that we're going to do for you. We are going to be using a machine grader in this class. And this machine grader will actually actually be the thing that gives you a grade. But hopefully, you'll also find it valuable in that it will basically test your code and give you feedback. Now I don't expect you to be using our machine grader as your only form of of testing, but it definitely is sort of a sanity check that you are headed in the right direction. It's going to give you information about what tests you're getting correct, what tests you're getting incorrect, and it is going to do some checking of the style in your code. So you should be running our machine graders as you develop things so you can get this feedback. So let's talk about how they work and how you use them. In this class, we're going to be using a machine greater that we developed called OwlTest in order to evaluate your code. So for each mini project you're going to go to the mini project description page. And under the testing your code section there will always be an OwlTesting link and you have to get to OwlTest through this link. Because this link actually passes perimeters to OwlTest that configures it to properly evaluate this particular mini project. So once I've clicked it, here's the OwlTest page that you can see. A couple of things to note here the first is the background is this sort of pale yellow color. And the second thing to notice is up in the upper left hand corner you should see the word OwlTest there. And this is how you're going to recognize that you're on the OwlTest page. A little bit more about that later. So now what's actually here? Well, we have a text box here where we can input A ColdSkulptor URL. So when you are ready to evaluate your code, you come over here and you paste your CodeSkulptor URL directly into that text box. And we click the Submit to OwlTest button. And it gives us a message, waiting, and then it creates my code. Now, you can see I got a whopping 14 out of 100 here. Pretty good for me. And it tells me why. I lost 80 points, because my merge function failed the test here and I lost 6 points because I have style warnings. Now if we go back up to the description here of the test it tells me that merges worth 80 points, so I lost them all. I got nothing correct here, and style is worth 20 points. So I did get some of my style points. I only lost 6. First, I want to walk through here, there are other tabs. My style warnings are put on particular tabs based on the category they fall into in Pilant. So here's some General Code Warnings. It says I have an Unused variable named "xyz''. And that's not allowed, as per pilant and our style guide. There are some Coding Convention Warnings, where I have an Invalid name for a global. I shouldn't even have global variables, if you read the style guide, and have an invalid name "a". This does not follow our convention, so okay. And you can go and navigate to a page form or what’s side that gives much more information that helps you decide for some of this pilants to errors. A human can see your code here, which you shouldn't have to but you can see your code to see what you actually submitted. Now back to the real important tab here the Unit Test Failures. And one thing I want you to notice here is what basically this is saying is this is what the tester did. It called merge with an input list of 2. You can actually copy that code right there, paste it into CodeSkulpter, and run it. This is the exact test that was run in OwlTest, and you can run it in CodeSkulpter directly. Now I will point out that as the class move on there will be some more complicated tests where the test is not just a single function call. There will be multiple lines of code that go on here. Those lines which will be separated by comas in this listing, so that it doesn't get too lengthy. And so when you paste it in, you will have to replace those commas with line breaks. So that you can actually execute the multiple statements in sequence, but then it says expected 2. What this means is that when I call merge with a list of 2, OwlTest expects the answer or the return value from merge to be a list with a number 2 in it. But it actually received a list with the numbers 2, 2, and 3 in it. So my merge function is returning the list with 2, 2, and 3 in it, when OwlTest says it should have been returning lists with 2 in it. Now, I'll let you figure out who's correct here. But basically the idea is that you look at these tests, and as things go on there will be more than one kind of test in addition to the style tests. And so each one of them will give you some feedback, tell you how many points you've lost. And as you pass more and more tests hopefully you'll get more and more points or rather lose less and less points. And eventually maybe you'll get a perfect score. Now it's really important to understand that OwlTest does not actually submit anything to Coursera. OwlTest is really just for you to get feedback as you develop your code, not for you to get any sort of grade. The way to think of this is that OwlTest is an interface to our machine grading infrastructure that allows you to submit your code, get it graded, and get feedback. When we take that and we just throw it away. It's just for you. When you are happy with what you have, now you have to actually come back to the Coursera site. You have to actually submit the code to Coursera. The way to do that is to find the actual Assignment page here. So if I want to submit 2048 Merge, I find this assignment, the 2048 Merge Assignment. I click on that link, and it takes me to a page that looks like this. You would have to set up your identity to actually submit something. I'm not going to do that. I don't want to verify right now for the purposes of this video. So I'll continue without verification. You obviously would do that. This takes me to a page here where there's a blue button that says, Open Tool. This is going to take us to our machine grading infrastructure once again. This takes us to something that I'm going to call Coursera LTI Test. Now what is that? It's a different interface to exactly the same machine grading infrastructure as OwlTest. But you should notice there are two things about this page that are different. The first is that the background is white. So that's different, that's an indication that you're on the actual submission page instead of the practice OwlTest page. The second is if you look up here in the upper left hand corner, it says Coursera LTITest. So when you're trying to submit a grade to Coursera you should notice these two things. That the upper left says the right thing, Coursera LTITest, and the background is actually white. Otherwise everything is exactly the same as before. And you submit in the same way. You paste your URL just as you would have before, and you Submit it to Coursera LTITest. This is going to do exactly the same thing, submit it to exactly the same machine grader and I should get the same grade in the feedback. Let's see. Yes, I do. I still got my stunning 14 here, and I'm getting the same feedback. The difference now is that once I see this, this has now been submitted to Coursera. So my grade of 14 has been submitted. Now don't worry, it records your best grade. If I've done better than 14 before it's not a big deal, this isn't going to hurt anything. And you can submit here as many times as you want and like I said, it's going to take the best grade. Now, if we go back here you'll notice that it says, Passed 100%. At the time that I'm recording this video, that 100% number wasn't always completely accurate. This does indicate that I did submit it before at some point. If you wanted to accurately see what your grade was though, you go to this Assignment link. And this is going to tell me that for 2048 Merge, I have previously submitted at 100%. Notice it did not downgrade me to 14%, even though I just submitted something with a lower grade. If this number is not what you expect, if there is no number here whatsoever that's a strong indicator that you didn't submit to Coursera LTITest. Instead, you accidentally just submitted to OwlTest. Go back through this process again and make sure that you're clicking the button. And make sure that the page says Corsera test not OwlTest, and that the background is white. And then you should be able to get your grades submitted to Coursera. This video has introduced both OwlTesing and Coursera test which are just two different interfaces to exactly the same machine grader. They will run exactly the same test, but they're doing so for different purposes. So first, let's talk about OwlTest. The idea behind OwlTest is to help give you feedback as you develop your code. So as you develop your code, you should run things through OwlTest. Remember that you have to get to OwlTests to get to the mini project description page, because that passes the parameters to OwlTest which test to actually run. But when you get that feedback, it's really just for you. It gets thrown away, it does really gets recorded anywhere, but you can use it. You can see hey, this is going to be my score if I actually do submit to Coursera. Further you can see some of the tests that you fail. And remember you can actually cut and paste those tests directly into CodeSkulptor and run them yourself. That way you can run them, you can add debugging information, you can sort of see what's going on. And compare to what you should be getting according to OwlTest and think about why you're not getting that. Hopefully, this helps you fix your code and then you can resume it and hope that you get a better grade. So that's OwlTest. Now, once you've got what you're happy with in OwlTest, you need to go over to Coursera Test. Coursera Test is what actually submits things to Coursera and you have to go through the mini project page to get there. If you're on Coursera Test and you submit, you should get the same grade you would have gotten from OwlTest. But the big difference now is that it's going to post that grade to Coursera. Now I want to caution you though, this posting is not instantaneous. What I will tell you is that if you get a grade and feedback back from Coursera Test and you actually are in Coursera Test, that grade is eventually going to be posted to Coursera. However, this is a large class, there's lots of things going on. There are many sources of delay between the machine grader and Coursera getting the grade posted. So it could take several hours for that grade to actually post once you get that feedback. But if you do get the feedback it is going to post and you're going to get the timestamp that you got the feedback on Coursera Test not the time it was your finally post the Coursera. We hope that you find these machine graders useful and helpful. And that they make things a little bit easier as you develop your code.