Compile-time vs Runtime

Shaans Training
A free video tutorial from Shaans Training
SDET Project & Job Trainings
4.3 instructor rating • 2 courses • 16,780 students

Learn more from the full course

SDET Training: Selenium WebDriver, Java Project & Code Tests

Complete SDET Training course on Selenium WebDriver with Java Framework, API & Automation Testing, Coding Interview etc

15:42:38 of on-demand video • Updated December 2019

  • Understanding the Realtime Test environments and Agile Implementation
  • Master the Core Java concepts and Datastructures needed to get you hired
  • Functional Testing: UI and API(Web service) Testing using Selenium WebDriver, RestAssured etc
  • Non-functional testing: Cross-browser & Performance testing using SauceLabs, Blazemeter, New Relic APM
  • Integrate Docker + Selenium Grid + Jenkins and run the tests. Jenkins plugins and more
  • Learn Amazon Web Services/ AWS : IAM, EC2 instances, S3 storage, Code deploy that you need as SDET
  • Build and Release Management using Maven and GIT
  • Apply for following roles: SDET / Automation Engineer / Performance Engineer
English [Auto] In this lecture we're going to talk about what is compile time and what is it on time. What are the common compile time and runtime arose compile time when dojo will file is built into the crossfire. But the Java compiler if you're using Eclipse says that ID if you go to the menu here on the top if you put the project there is an option build automatically which is checked by default. So it means that whenever you overcome this Jahl file and whenever you save it and up close file will be generated in the Pycroft. If you go to Finder to look at the directories. This is my workspace as you could see on the left Cuauhtemoc she's my project and there are two folders. One is horse and one has been source has all the dojo files which I'm working in my Eclipse and eclipse doesn't show this bin folder. So basically this has the dock lost by its as it could see the time stamp the time stamp exactly matches meaning that whenever I make any modifications to the file and when it is saved and darkness had to be generated in the background so compain don't burn daughter file is compiled into ductless file. That is a compile time and what is it on time. Time is when actually when the door close file is executed. But the Trivium whenever you run the application. This is huge and really runs right. This is called runtime and there are two types of arrows that do get compile time and runtime errors compile time errors that you see in Eclipse or in real time if you are using Meirion or some of the tool for the build up for the completion duckweed through the comparative arrows runtime errors or something that happens from time when the application is deployed and the time for running the application. You see it on timing errors and front end rows of more cost here because you sit on timers when the client or customer is in fact using the application again compile timers that are left to die. So again syntax and semantics syntax are sort of something easy to notice. And as you could imagine for closing opening press missing or a semicolon is missing or syntax or semantic in reverse order we're going traditional. No I just cue a couple of examples here for the semantic error. If you are using the variable before it is initialized. Or be sure of doing them at their signature without upgrading the references. So these are just couple of examples that make the model real clear. The mean matter. Just type in Maine and control space. Bring me the skeleton for the main motor. And in order to be more we'd like to create a more clause and I would like to name it. Email I would like to have a single McClurg here. I just read it and you're being watched. There is going to be always a gendered and send an e-mail or just to this for the demo. So I'm just going to play in your computer to generate and send in. So you did get me come back to this compliant and in turn turn Java. How dismayed. I'm trying to create a reference variable. You made you and I would like to call the metod generate and send on this May as close as it could see just mosey over here. Eclipse's saying meet the local retailer may not have been initialized. This is what I'm trying to demonstrate. So you cannot access a variable before it is initialized. If you are getting calls over here it is. So just telling me a quick quick splendored I click and it is pointing to mold. So it is initialized [REMOVED] and there is no more harder in red. You could run it. Meaning that discharge files compiled and you are able to let me Demel most error. That is hard to notice compared to this variable initialization issue that someone else is working on this e-mail don't cha. And they get that their signature because they're Montepulciano an argument here. Pre-generated submitted or changed Darton died from Word to boolean identity. They can now change the access modifier from default to private or something that many would Woodward. OK so I changed my signature from zero payment to having one argument. I don't have any errors here. I was working on this file. Change something. Don't see any of it in this file. What does getting a victory is equivalent to a football team. The court is calling this particular matter that is going to get picked up. See here it suits me that this metod with one argument string argument in that IP mode is not applicable with the arguments around pulsing in fact and possibly zero arguments or it's not applicable for this matter in this e-mail object. I either need to pass in an argument here or just call back and undo the letter is gone. So these are kind of hard to Morty's semantic errors. When you get to Mr. signature you need to pay all the expenses as well. Now go forward and look at that. Timers are exceptions like multipoint exception at a so-called bonus exception or out of memory. Let me run this application as is when I run as a job obligation. To me a null pointer exception although semantically this is correct. Like how initialize this variable I can call any returns on an object of null value. Let me initialize it we can e-mail object. And now I no longer see the null pointer exception. These are kind of easy to notice once that I don't want here but in real time is used that Iam expulsed as a method or the parameter here. I don't know really. He is pointing to null or abandoned object. It's hard to notice. And let me demonstrate it and it sort of points exception as you could think of looking at the name. This is true when you're trying to access and I'm tier-II or you family has 10 elements if you're trying to access element Element you're going to get an answer for them all anyway. The main method has the argument here. It's a string of reports which have tried to bring the first element within this box of Sub-Zero I'm going to get up and excludable exception because this area is right now empty for over superpose. Hold on I'm going to fix it. If you go to this icon and click on run configurations or if you go to run and configurations solve the problem that we are trying to run here. And if you go to arguments tab there is a field by name program documents. Want to try posting news is passed to the main matter and passing something here. That is what is printed here. So I fixed it. You need to make sure whatever elements you are accessing as part of the areas that are in fact present of course in run time do x rays from different places you pocket the values from get to me is at from time it's possible that you get it except for. I changed it from zero to one. Again I'm going to get an exception meaning that I have one element but the second element which is deposited by one responder. So with me to work it back. That's an excellent exception. Now let's take a look at all of the money. This is error. It would be something logical. Exceptions or something you can catch and try to recover what is really something you are not supposed to catch because it's hard to recover all of memory or patterns when they look at a memory card the JVM is not sufficient to handle the application. This happens when the application is really big or the JVM allocate memory is very small or whenever there is a memory leak in application memory leaks are very costly. So you need to try to make sure memory leaks are not there and kraków. Let me demonstrate this. Try to create an integer variable size code that can quickly add very dangerous area new in off particle size particular print for size up. This is going to work fine because I just created add in digital array of size 10 and I'm trying to print the link of. Got very good is going to print me. So that is the size up. I tried to reproduce a lot of memory. I am writing infinite loop here because I don't really see why you should be having a condition that it will terminate after certain iterations. But if I keep it true it continuously runs let me increase the size. That's what size equal to size multiplied by 10 in this loop. I'm trying to clear these areas continuously of bigger and bigger size because iteration by iteration you are increasing the size here. Before I run the program I really want to decrease this VM memory with a bare minimum height from some s. This is a virtual machine argument JVM argument dislocates the max memory that we're located to the JVM. Let me put it at a bare minimum of 1 and B so that we could reproduce it fast. The program brand for certain iterations but since we are located in baramin long memory of the sudden iterations Trami lot of memory error because we are trying to continuously clear the objects within the loop. We are not using it but the objects are created fast enough before they can be garbage collector. We call this part of memory because Joe goes on how memory anymore to hold these number of objects. How do you fix this. You need to have a proper condition here to turn it. Look let me comment out the loop here. For instance this program is going to run fine because we're not looping continuously. We are in the program before reaching the max here. These are kind of up and down exceptions but there are more obviously back to the true purpose. I think these are good to talk about and compile comatose. We have seen Lex index on semantic errors and earlier. That's it lot. See the next picture.