3 arrows

Summer-Ready Savings: Up To $500 Off Training 

closeClose

Unit Testing Essentials using JUnit and Mockito

  • Tuition USD $1,995 GSA  $1,809.07
  • Reviews star_rate star_rate star_rate star_rate star_half 4119 Ratings
  • Course Code TT3525
  • Duration 3 days
  • Available Formats Classroom

Students who attend Mastering Unit Testing using JUnit and Mockito will leave the course armed with the skills they require to develop solid Java programs, using sound coding testing techniques and best coding practices. This course quickly introduces developers to the features of JUnit and educates them regarding JUnit’s strengths and weaknesses. JUnit and EasyMock make it possible to write higher-quality Java code. These powerful tools are designed to support robust, predictable and automated testing development in the Java enterprise application arena. This course includes coverage of many of the essential JUnit capabilities, and can be tailored to focus exactly on the areas that you are interested in.

Skills Gained

  • Understand what unit testing is and what it is not intended to cover
  • Understand JUnit.
  • Understand and use the JUnit Test Runner interface.
  • Use JUnit to drive the implementation of Java code.
  • Test applications using native IDE support.
  • Best practices and patterns for unit testing.
  • Understand JUnit’s strengths and weaknesses
  • Understand the role of debugging when done in conjunction with tests.
  • Understand not only the fundamentals of the TDD using Java, but also its importance, uses, strengths and weaknesses.
  • Understand how JUnit affects your perspective on development and increases your focus on a task.
  • Learn good JUnit coding style.
  • Create well structured JUnit programs.
  • Understand how JUnit testing can be used for either state-based or interaction-based testing.
  • How to extend testing with mock objects using EasyMock.
  • Look at refactoring techniques available to make code as reusable/robust as possible.
  • Discuss various testing techniques.
  • The following JUnit-based testing frameworks are examined: JUnit, Mockito, and PowerMock

Who Can Benefit

This is an intermediate-to-advanced level Java course, designed for developers who wish to get up and running on test-driven development immediately. Attendees should be familiar with Java and object-oriented technologies. Real world programming experience is a must.

Course Details

Experiential Learning – Course Structure

Throughout the course students will be led through a series of progressively advanced topics, where each topic consists of lecture, group discussion, comprehensive hands-on lab exercises, and lab review. This workshop is about 50% hands-on lab and 50% lecture. Multiple complete “mini-projects” are laced throughout the course, designed to reinforce fundamental skills and concepts learned in the lessons, all working in the JUnit environment. Because these lessons, labs and projects are presented in a building block fashion, students will gain a solid understanding of not only the core concepts, but also how all the pieces fit together in a complete application.

Session: JUnit

JUnit Overview

  • Purpose of Unit Testing
  • Good Unit Tests
  • Test Stages
  • Unit Testing Vs Integration Testing

Jumpstart: JUnit 4.x

  • JUnit Overview
  • How JUnit Works
  • Launching Tests
  • Test Suites
  • JUnit Test Fixture

@Test Annotation

  • Test Execution Cycle
  • Checking for Exceptions
  • Using Timeouts

Hamcrest

  • About Hamcrest
  • The Hamcrest Matcher Framework
  • Hamcrest Matchers

Parameterized Tests

  • Injecting the Parameters
  • Setting the Parameters
  • Test Execution Cycle
  • Observations

Theories

  • Writing Theory Enabled Tests
  • Defining DataPoints
  • Defining Theories
  • Observations

JUnit Best Practices

  • "Good" Tests
  • Bad Smells
  • White-Box Unit Testing
  • Black-Box Unit Testing
  • Automation and Coverage

Session: Testing Tools and Techniques

Improving Code Quality Through Refactoring

  • Refactoring Overview
  • Refactoring and Testing
  • Refactoring to Design Patterns
  • Naming conventions

Mocking of Components

  • Why We use Test Dummies
  • Mock Objects
  • Working with Mock Objects
  • Using Mocks with the User Interface
  • Mock Object Strategies

Mock Objects and Mockito

  • Mockito Description and Features
  • Stubbing and Argument Matchers
  • Verifying Innvocations
  • Working with Partial Mocks
  • Mockito HOWTO

PowerMock

  • PowerMock Description and Features
  • PowerMock Object Lifecycle
  • Mocking a Static Method

Appendix: Adding Testing to the Build Process

  • JUnit and Ant
  • The Ant JUnit Tag
  • Running JUnit Tests From Ant
  • Generating a JUnitReport

When does class start/end?

Classes begin promptly at 9:00 am, and typically end at 5:00 pm.

Does the course schedule include a Lunchbreak?

Lunch is normally an hour long and begins at noon. Coffee, tea, hot chocolate and juice are available all day in the kitchen. Fruit, muffins and bagels are served each morning. There are numerous restaurants near each of our centers, and some popular ones are indicated on the Area Map in the Student Welcome Handbooks - these can be picked up in the lobby or requested from one of our ExitCertified staff.

How can someone reach me during class?

If someone should need to contact you while you are in class, please have them call the center telephone number and leave a message with the receptionist.

What languages are used to deliver training?

Most courses are conducted in English, unless otherwise specified. Some courses will have the word "FRENCH" marked in red beside the scheduled date(s) indicating the language of instruction.

What does GTR stand for?

GTR stands for Guaranteed to Run; if you see a course with this status, it means this event is confirmed to run. View our GTR page to see our full list of Guaranteed to Run courses.

Does ExitCertified deliver group training?

Yes, we provide training for groups, individuals and private on sites. View our group training page for more information.

Does ExitCertified deliver group training?

Yes, we provide training for groups, individuals, and private on sites. View our group training page for more information.

The instructor really took his time and made sure I was able to understand the concepts.

Thank Tech Data for sponsoring this course you really take care of your partners.

It is very good and very simple instructions. almost to much hand holding.

Good Course. We covered a lot of material in a short amount of time. This course had useful labs that built upon each other.

The tool provided to practice the course teachings is very functional and easy to use.

0 options available

There are currently no scheduled dates for this course. If you are interested in this course, request a course date with the links above. We can also contact you when the course is scheduled in your area.

Contact Us 1-800-803-3948
Contact Us
FAQ Get immediate answers to our most frequently asked qestions. View FAQs arrow_forward