JUnit

CloudLabs

Projects

Assignment

24x7 Support

Lifetime Access

.

Course Overview

A unit test is a piece of code written by a developer that executes a specific functionality in the code to be tested. The percentage of code which is tested by unit tests is typically called test coverage.Unit tests ensure that code works as intended. They are also very helpful to ensure that the code still works as intended in case you need to modify code for fixing a bug or extending functionality. Having a high test coverage of your code allows you to continue developing features without having to perform lots of manual tests.

At the end of the training, participants will be able to:

  1. Internalize the core concepts of JUnit
  2. Master crucial design principles, retrieve data using Subqueries
  3. Explore JUnit theories, Tags ,Filtering  Vs Label ,Group Test and Handling external resources
  4. Design, organize, and develop JUnit tests with  Mockito architecture  
  5. Execute mock testing with PowerMock
  6. Be able to conduct Data Driven Testing Using Examples Keyword
  7. Improve the quality and effectiveness of your organization’s software and tests
  8. Be equipped to implement unit testing using JUnit

Pre-requisite

A working knowledge of Java technology and testing is recommended.

Duarion

4 days

Course Outline

  1. Proving it works
  2. Starting from scratch
  3. Understanding unit testing frameworks
  4. Setting up JUnit
  5. Testing with JUnit
  1. Exploring core JUnit
  2. Launching tests with test runners
  3. Composing tests with TestSuite
  4. Collecting parameters with TestResult
  5. Observing results with TestListener
  6. Working with TestCase
  7. Stepping through TestCalculator
  1. Introducing the controller component
  2. Let’s test it!
  3. Testing exception-handling
  4. Setting up a project for testing
  1. Why we need unit tests
  2. Kinds of tests
  3. Determining how good tests are
  4. Test-driven development
  1. A day in the life
  2. Running tests from Ant
  3. Running tests from Maven
  4. Running tests from Eclipse
  1. Introducing Stubs
  2. Practicing on an HTTP Connection sample
  3. Stubbing the web server’s resources
  4. Stubbing the connection
  1. Introducing mock objects
  2. Mock tasting’s simple example
  3. Using mock objects as a refactoring technique
  4. Practicing on a HTTP connection sample
  5. Using mocks as Trojan horses
  6. Deciding when to use mock objects
  1. The problem with unit-testing components
  2. Testing components using mock objects
  3. Integration unit tests
  4. Introducing Cactus
  5. Testing components using Cactus
  6. How Cactus works
  1. Presenting the Administration application
  2. Writing servlet tests with Cactus
  3. Testing servlets with mock objects
  4. Writing filter tests with Cactus
  5. When to use Cactus, and when to use mock objects
  1. Revisiting the Administration application
  2. JSP unit testing
  3. Unit-testing a JSP in isolation with Cactus
  4. Unit-testing taglibs with Cactus
  5. Unit-testing taglibs with mock objects
  6. When to use mock objects, and when to use Cactus
  1. Database unit testing
  2. Testing business logic in isolation from the database
  3. Testing persistence code in isolation from the database
  4. Writing database integration unit tests
  5. Running the Cactus test using Ant
  6. Tuning for build performance
  7. Overall database unit-testing strategy
  1. Defining a sample EJB application
  2. Using a fa?ade strategy
  3. Unit testing JNDI code using mock objects
  4. Unit-testing session beans
  5. Using mock objects to test message-driven beans
  6. Using mock objects to test entity beans
  7. Choosing the right mock object strategy
  8. Using integration unit tests
  9. Using JUnit and remote calls
  10. Using Cactus

Reviews