 Thank you Okay, I just want to make a correction the original title was unit testing in 10 minutes full stop and a catch a bullet So that kind of changes the topic, but it's the same who here has never heard anything about unit testing Raise your hands Okay Unit testing or simply testing means testing your software. Okay Who here has never heard the acronym? TDD Okay TDD means test driven development But it's actually what you do every day, which is time driven development because you have got small time so time is driving the way you develop and I just wanted to make this pitch to clarify some terms that you might hear when you are referring to unit testing or Testing simply and I want to do that I'm a backend developer So I spend most of my days working with PHP in the back end of WordPress and I can be boring as hell about this I can go on for like five hours. I want to that and instead I will use a metaphor So say you've got a web agency and your web agency has had a lot of funny proposals Small websites big websites and then you receive one very interesting proposals, which is you have to build a catapult Okay, because you you know you are a web agency. So that's the place to go when you want to catapult and So why would you want to build a catapult because you have to throw a rock on the walls of a walled city, okay? So you try to think it out. How would you build a catapult? So you try to decompose the problem of building a catapult, which is essentially made of wood Probably it's got a spoon which is key which is holding it like a rock Probably spherical That rock has some way to be thrown at a distance some distance To a city wall, okay So I will try to use that metaphor of the catapult to explain you some terms like so let's start with unit Testing, okay, so right now. I'm talking about what unit testing means to someone that actually does test dream and development unit testing means testing a small single independent isolated unit of code in coding terms that might be a class or Two or three functions together, okay, so in our metaphor for example the unit is a wheel Okay, you have you know the catapult has got to be moved around because you can't build a catapult then say someone Okay, you can throw the rock from the web agency. You have to actually carry the catapult over to the place So that catapult that wheel is gonna be your unit. So how would you define a wheel? Well, a wheel has to roll that's easy Probably the catapult is he's going to have four wheels You're gonna make up. Okay. How much could a catapult weigh? So let's say a ton So you've got four wheels a catapult which is going to weigh a ton So each wheel has to be able to withstand a weight of quarter of a ton, right? So you're slowly defining the requirements of the wheel and you're taking the wheel into consideration So once you've got a list of requirements, which is for example Okay, we could make it with wood But you know what it should probably be some way with standing fire because Probably the people on the wall is not going to be very happy with us throwing rocks and is going to you know fire something back Accidentally that firing back could contain fire. So you don't want your catapult to catch on fire So you come up with a list of requirements and what you do is that you write those requirements in a test and Begin with something begin with something which is totally Hutterly failing the test like you start with a log Does the log roll? Yes Does it send fire? No Does it can it withstand a quarter of a ton weight? No, okay So you iterate over your log you work it you take another log you cut it out you shape it you reinforce it with iron and Slowly applying those stats tests over and over to that wheel you get to the point where you've got a wheel Which is yes, can we stand the weight? Yes, it doesn't catch on fire. Just looking at it. And yes, it rolls Okay So you get to the point where you have a wheel and you do the same so you test single finnit units One by one. So you will have a unit test for the rock Which has got to be spherical because that's easier to load and rolls better when you throw it and and so on and so on for This launching spoon. Okay So the next step is that actually the wheel is not going to work alone as to work in concert without other components, okay, probably a frame And harm a spoon the rock some ropes, okay That's integration testing. So when you hear the word integration testing think of the catapult It's not quite been built yet, but at least you know that the the wheel has to work with Wheel harm as to be attached to a frame So you come out with new requirements like okay, the wheel has got to stay under the frame of the catapult Has got to work in concert with another wheel, which is going to be at the other end of the wheel train Has got to roll at the same speed. So they've got to have the same resistance and some and that's integration testing Okay, so unit testing just the wheel integration testing the wheel and the very next pieces The catapult is is supposed to work with Then you go on another level because you know, it's okay wheels will strain the frame But we are actually building a functioning catapult. So the catapult then you go to into functional testing functional testing is You kind of assemble a prototype of the catapult Make some isolated tests. So for example, you come up with a You have a speed you know that the harm has got to swing at a certain speed to actually be able to throw the rock because you made some calculation based on distance the weight of the rock the material the walls you're hitting and so on and You come up with some criteria Yes, you build a prototype of the catapult and you try that out and you make finnit means measurements So, okay, the speed is fine It's easy to pull so we can pull the catapult around and move it around and That's called a functional testing. Okay, so you need just the wheel integration is the wheel and probably the wheel train Functional testing is the whole thing together probably not completed together not completely working The other step the last one is called acceptance testing acceptance testing is what you usually think about as unit testing So when someone usually talks about unit testing is actually speaking about acceptance testing, which is as a user When I get myself a catapult, I should be able to load it with a rock and throw it That's very easy to understand That's simulating the end user behavior because the end user which is actually the catapult crew is Actually going to do exactly that. Okay as a catapult user when I load it and throw the rock The rock has to travel 400 meters. Why? Because the arches on the wall will throw at 300 so, you know, some safety measures So that's that that's what you get. Okay, so you come out with new requirements Acceptance requirement and you finally crew the catapult and that crew is going to be in our case WordPress case is going to be for example the web server. Okay, and it's going to simulate the user and so on so I Hope this example, which is I know extremely stupid kind of clarifies The the noise and the confusion that often comes with the concept of testing unit testing integration testing functional testing acceptance testing just know what you What you're talking about just know what you want to do Just know that each one of these steps is going to be in one Field for example unit testing and integration testing So just the wheel the wheel and the wheel train is probably going to be in the field of developers acceptance testing is probably being in the field of QA people because they could use a very plain English syntax to say things like as a catapult crew I want to be able to load the catapult Functional testing could be both in the hands of QA people or tech savvy people and developers. Okay, so That that was it. I hope that helped you make some Have a better idea of what means what in a unit testing acceptance testing functional testing and so on. Thank you