In this video, I want to talk more about the development process and the problems that we generally encounter when we speak to development teams. First of all, problems that we see in a lot of development shops are to do with the following areas.
So first of all, understanding the objects in a schema, so that developers know the environment in which they're working. --maintaining code, testing code, functional testing code, finding performance bottlenecks, how to optimize SQL statements efficiently, and finally, performance testing for production. So, it's making sure that the application is ready to go live, in terms of how it scales, where there are more users and more data. And then finally, I'll take a look at the various Toad additions that the are for developers and where to go to find more information.
So let's move into Toad. And what I want to start off with first of all is, we see a lot of problems sometimes with developers not understanding the environment they're in. Or they'll go and make changes to certain objects or code without really understanding the potential impact that might have on other objects in the schema. And So, in Toad, there's a couple of features which are designed to alleviate that problem, both of which you can get from the Schema Browser window.
If I right-click a table, if I want to have a look and see how this table relates to other tables, then I can use the ER diagram to do that. Now, the ER diagram, which I've already opened down here, shows me the table I selected, which is the customer's table. Plus any other tables which are joined to it through foreign keys. If I need to add other tables to this diagram, which are connected through foreign keys, then I can use the object palette, which is a slide out window, which I get to from the View menu. View object palette. And I can drag and drop other objects into there as necessary.
Once I've got the diagram in here, I can very quickly, get information about an object by selecting it and pushing the F4 function key. So I can very quickly see, what is the makeup of this table, what data does it have in it and so forth, all within the diagram, get information about the foreign keys, including the script.
And if I want to build a query from this table, then I can select this button, which will push all those tables out to the CareerBuilder and let me construct a SQL statement based on columns from all those tables. If I want to generate data for all of the tables to make sure that data is referential, then I can use the Generate Data button. And the data will be generated in all of those tables. And that data will be referential.
The other window I can use, if it's code relationships I'm concerned about, if I go to a PLSQL stored procedure list and select a stored procedure and right-click it, I can open the code roadmap. And the code roadmap is similar to the ER diagram, but in this case, it's looking for code relationships. And you can see here, I selected this function. In this function, you can see makes calls to two other functions, this one and this one, which in turn have references to tables or other functions, as this one does.
So you can begin to see the whole interdependency tree, in a way which will tell the developer, if I'm going to make a change to this function, I need to be careful. If I need to make a change to this table, I also need to be careful, because of these interdependencies. And it just helps minimize the number of errors that we often see as a result of people not really understanding the environment as well as they should do.
OK, so the other thing that you can do as well with the Toad Development Suite is start creating test cases for all of your code. So, if I want to create a test case for our new function I've just created, I can select that function. I can go up to the external tools button. And I can launch Code Tester. And I can begin to create a test case. Code Tester is a functional testing tool. It's going to enable me to create a test case or test cases for all of my code, simply by defining the input values I want to use, and for those input values, what the expected outcome will be.
I set my test cases. I actually have test cases already defined for this function. And if I actually edit one of these test cases, you can see that it's divided up into inputs and outcomes. So in here I've entered two input values for this function. And then these are literal values. I could, of course, use an expression, 1SQL or I could use a range of multiple values to test it.
I've also got a Quick Build tab, in which I can use preconstructed values or tests. So I can test for various things for example, an Oracle error message. And I can go to the outcomes. And I can say, well, for those input parameters, what am I expecting to happen. What is the output value or values or behavior and define that? So that's the only two things you need is, the input values, expected outcomes, and then, the test code itself. The test harness is generated automatically.
So, the way that it works is that I can then, having got a test case built and stored in the [? code ?] test repository, is I can right-click my program in Toad and simply run the test. And it will give me an indication inside of Toad as to where I had a failure. And where I had