 Welcome to lecture 21 where we now discuss server side testing and debugging for servers for endpoints and We will essentially cover endpoint testing only in this lecture. So this is All about what we can test in one of our server applications where we have different endpoints What kind of assertions to write and how to set up the entire thing This are essentially the same learning outcomes as the previous lecture. So it's all about testing debugging of different server side techniques The literature references here are exclusively Websites for the different libraries or tutorials how to use them. So it's just practical advice. It's nothing that is exam relevant in any case So so far we have done unit testing and we have test functions But if we now have a back-end application like you wrote in assignment 3 for example, it's not enough to test functions because the Main part of your code are essentially request handlers. So the different get and post methods So if we look at some example code, this is from lecture 14 where we wrote a very basic express application and you see that These two get requests we have here are no functions. So these are kind of Calls to other functions and the question is how do we test that? So it's not enough to do unit testing here because we basically don't have functions in here that we have declared ourselves So for example, what we would like to know is if I do a post request to some URL What is coming back is the response correct or not? What are we expecting? This is something I would like to test and that's what we would call an endpoint test So we test an endpoint in the back-end. Additionally, we might also want to test What's going on in the database because whether or not our response is correct depends on what was in the database before Similarly, if for example do a delete request It depends a lot what comes back which response is correct depending on the database state So these are kind of larger integration tests usually because they don't just cover one part of our code, but they cover The entire back-end system including the database for example The delete request of course should return 200 if the node with the provided ID existed It should return 404 if it doesn't and it might return 403 if it requires some kind of authentication So the question is what do we need? We need to have some kind of library some kind of tool to make requests We need to have some kind of tool that receives the responses and checks them and makes the testing assertions and We might need something that checks what's going on in the database and We will in this lecture and in this course only cover or mainly cover the first two So how to make requests and assert that the responses are correct in a testing framework? We could do this with a regular library So for example, we could use axios as we have done before just make requests and try to write some kind of Script some kind of test together, but there are actually dedicated test libraries So we have used Chai before and Chai happens to have a module that's called Chai HTTP. That's specifically for making HTTP requests and Testing the responses. So this is what we'll look into and I'll cover that In the next part of this lecture. So axios can make requests can receive responses Chai can do the same, but there are some kind of Simplified ways of testing what is coming back. So we'll go into this now in part two