Good testing is essential to reduce bugs and produce quality software. Oracle SQL Developer offers the PL/SQL unit testing feature which lets developers and analysts effectively write and share test cases and suites to test their PL/SQL code.
At the core of developing a high quality, bug free application lies our skills and knowledge to test our applications thoroughly and effectively. In this course, Oracle PL/SQL Unit Testing with Oracle SQL Developer, you'll learn how to test your PL/SQL code using the Oracle SQL Developer Unit Testing Framework. It is a robust and feature rich framework which allows you to easily create test cases for your PL/SQL program units, organize them in test suites, reuse your work with libraries and share your tests in a team development environment. First, you'll discover that it allows you to analyze your code coverage and view previous runs and results with several built-in reports. Next, you'll explore how it lets you synchronize your tests when the name or definition of the underlying program units change. Finally, you'll learn how it gives you the ability to automate your tests using the SQL Developer command line interface, which is extremely useful in implementing your continuous testing strategy. When you're finished with this course, you'll have a foundational understanding of Oracle SQL Developer PL/SQL Unit Testing feature, which will help you immensely when implementing extensive test cases for your PL/SQL program units and achieving test automation.
Course Overview Hello everyone, my name is Pankaj Jain, and I'm very excited to welcome you to my course, Oracle PL/SQL Unit Testing with Oracle SQL Developer. The importance of testing cannot be overemphasized. Improper testing leads not only to a lot of bugs and production outages, but can also harm a company's reputation seriously. Oracle SQL Developer is a very popular, free, graphical user interface widely used by developers and DBAs around the world. This IDE is packed with tons of cool features, and one very important feature it offers is its Oracle PL/SQL testing framework. It is a robust and feature rich framework, which allows us to easily create test cases for our PL/SQL program units, organize them into suites, reuse our work with libraries, and share our tests in the team development environment, it allows us to analyze our code coverage, as well as gives us the ability to automate our tests using the SQL developer command-line interface, which is extremely useful in implementing our continuous testing strategy. In this course, we will take an in-depth look at this feature. You may be an Oracle database programmer, or an analyst, I'm very confident you will gain some useful knowledge from this course, which will significantly boost your testing skills and testing effectiveness. Some basic Oracle database and programming experience is required. Some of the major topics that we will cover include: understanding the unit testing workflow and components, creating test cases and test suites, dynamically generating test cases, test driven development approach, code coverage report, and running tests from the command-line interface. By the end of this course, you will know the basics of Oracle PL/SQL unit testing, and be productive in your testing efforts and test automation. I hope you will join me on this journey to learn about this useful testing framework with the Oracle PL/SQL Unit Testing with Oracle SQL Developer course, at Pluralsight.
Understanding the Unit Test Workflow Oracle SQL Developer has a very defined unit testing workflow with startup and teardown actions, process validations, etc. , as well as the ability for us to organize our test implementations in unit tests and test suites. Hello, my name is Pankaj Jain, and welcome to this module on Understanding the Unit Testing Workflow. In this module, we will start off by talking about the unit testing components, and how they are organized. Then, we will talk about the unit testing workflow, the various pieces required to define the workflow and their sequence. We will then specifically talk about some of the pieces, like the startup actions, the possible validations we can define, and the various teardown actions available to us. Alright, let's get started.
Installing and Configuring Test Repository The test repository holds the framework together. It has the objects needed for the framework, as well as allows us for creating and shading the tests. Hello, my name is Pankaj Jain, and welcome to this module on Installing and Configuring Test Repository. In this module, we will start off by talking about some of the key points for the unit testing repository. We will then talk about shared vs. unshared repositories, and how shared repositories can help in a team development environment. We will then bring the concepts together with a demo, where we will install and configure the test repository, and see how to make it shared. Alright, let's get started.
Creating Unit Tests It is now time to jump into action. Create unit tests and see how powerful a unit testing feature of Oracle SQL Developer is. Hello, my name in Pankaj Jain, and welcome to this module on Creating Unit Tests. In this module, we will start by creating unit tests in which we will see the workflow, how to setup and use startup actions, validations, and teardown actions. We will start simple with each unit test having just one implementation. Then, we will see how we can create the unit test with multiple implementations. We will then adopt a test-driven development approach to write the test case for the requirements first, and then write the code to make the test pass. This ensures that we have good code coverage, and coverage of requirements. Lookup categories allow you to define lookup values, which can then be used to supply input parameter values for our tests. This not only ensures that we have appropriate input parameters to test edge cases, normal executions, etc. , but also relieves the test writers to think up input parameter values. This should be an exciting module, so let's get started.
Dynamically Generating Test Implementations Having dynamic tests where, instead of hardcoding input parameters, if you can have them be driven by external lookups, or table data, it can lead to a lot more flexibility and more reusability. Hello, my name is Pankaj Jain, and welcome to this module on Dynamically Generating Test Implementations. In this module, we will explore how to let Oracle SQL Developer generate test implementations automatically, based on input values we have specified in a certain lookup category. This makes SQL Developer do the heavy lifting of creating implementations, insert of files, manually creating them. Since the input parameters differ for each implementation, if you have to use them inside the validations, we typically would hardcode those values, but then we cannot use the same validation across several implementations. We will end up creating copies of the same validation, with the only difference being the input parameter values used inside. We will see how we can refer to input parameters using special syntax, without having to hard code their values. This would increase the reusability of the validation significantly. Next, we will see how to make the input parameters even more dynamic, and take them to the next level by specifying them using dynamic value query. This enables us to specify the data using a SQL query, which lends us to a lot of flexibility in how we can specify input value. Alright, let's get started.
Organizing & Synchronizing Tests The importance of organizing information, cannot be overemphasized. Think of the amount of time it would take you to find a book in the library if they were not organized alphabetically, or in sections. Or, how long would a shopping trip would be if the items are not logically organized in aisles. Oracle SQL Developer provides you the mechanism to organize your unit tests logically so that they can be discovered faster and used effectively. Also, it proves you the mechanism to synchronize the unit tests and the name or definition of the underlying operations change. Hello, my name is Pankaj Jain, and welcome to this module on Organizing and Synchronizing Tests. In this module, we will take a look at the test suites, which is a way to logically organize your unit tests. Next, we will see how we can synchronize our unit tests when the name of the program unit they are based on changes, or the number of parameters to the program units are changed. Finally, we will see how we can move our tests from one SQL Developer install to another by exporting them in XML files, and importing them from the other. These files can also be version controlled. Alright, let's get started.
Running Test from Command Line & Generating Code Coverage Reports Oracle SQL Developer allows us to run our unit tests through command-line, which can enable us to implement continuous testing. Further, with code coverage reports, it lets us see how much of our source code is covered with our tests. Hello, my name is Pankaj Jain, and welcome to this module on running tests from command-line, and generating code coverage reports. In this module, we will be broadly covering two topics. First, is code coverage. Code coverage is the degree or extent to which the source code is tested by our tests. The higher the code coverage, the fewer the chance of bugs and unexpected errors. We will see the various out of the box, code coverage reports Oracle SQL developer provides us, and also see how we can customize these reports if we want to by working with the underlying queries. Secondly, we will talk about running unit tests from SQL Developer command-line interface. This would allow us to automate these tests. Alright, let us get started and jump right into a demo to see the code coverage reports.