3 arrows

Get a Free AWS Exam retake using promo code DOUBLESHOT

closeClose

Mastering Test Driven Development Using JUnit

  • Tuition USD $2,295 GSA  $2,171.79
  • Reviews star_rate star_rate star_rate star_rate star_half 4819 Ratings
  • Course Code TT3500
  • Duration 5 days
  • Available Formats Classroom, Virtual

A complete understanding of TDD concepts, processes, and practices requires some in-depth hands-on experience. During this class, students spend significant time working on a course project. The project exercises are specifically oriented towards using TDD to implement a complex and multi-faceted web application that uses a database in its final form. During the course project, the students:

  • Test basic Java functionality
  • Test web-functionality implemented in JEE
  • Use mocks for needed resources
  • Replace mocks and test database operations
  • Optionally, integrate the layers of the application using Spring and testing as they progress

Skills Gained

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. Working within in a dynamic, learning environment, guided by our expert TDD team, attendees will::

  • 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 test development.
  • 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.
  • Compile and execute programs using JUnit, jWebUnit, and DBUnit using the IDE of your choice.
  • 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.

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.

  • Experienced Java programmers

Prerequisites

Attendees should be familiar with Java and object-oriented technologies. Real world programming experience is a must.

Course Details

The following JUnit-based testing frameworks are examined:

  • JUnit 4.x
  • jWebUnit
  • EasyMock
  • DBUnit

Session: Introducing Test-Driven Development (TDD)

Lesson: Test-Driven Development

  • Overview of Test-driven Development
  • Test, code, refactor, repeat
  • The ROI of TDD
  • - Rationale for Test-driven Development
  • - The Process of TDD
  • - Advantages to TDD
  • - Side-effects of TDD
  • - Observations About Tests
  • Rationale
  • Advantages
  • Tools

Session: JUnit

Lesson: JUnit Overview

  • What is Unit Testing?
  • Purpose of Unit Testing
  • Successful Unit Testing
  • Good Unit Tests
  • Test Stages
  • Unit Test Stage
  • Integration Test Stage
  • Unit Testing Vs Integration Testing
  • Functional Testing
  • Non-Functional Testing

Lesson: Jumpstart: JUnit 4.x

  • Understanding Unit Testing Frameworks
  • JUnit Overview
  • JUnit Design Goals
  • JUnit Features
  • Reasons to Use JUnit
  • How JUnit Works
  • Class to be Tested
  • Test Case using JUnit
  • Exploring JUnit
  • Writing the TestCase
  • Test Result Verification (Assertions)
  • Assert
  • Launching Tests
  • Failures vs. Errors
  • Introducing Class Message
  • Creating Class MessageTest
  • The First Test Implementation Steps
  • The Initial Test Code
  • Testing the Constructor
  • Running a Test in an IDE
  • Running a Test From the Command Line
  • Seeing Results of a Test: JUnit View
  • Using the Results of a Test
  • Seeing Results of a Successful Test
  • Test Suites
  • Creating a Test Suite
  • Composing Tests Using Suite
  • JUnit Test Fixture
  • Managing Resources with Fixtures
  • Share Similar Objects
  • Share Expensive Setups
  • JUnit Method Lifecycle
  • JUnit: Resources

Lesson: @Test Annotation

  • Test Execution Cycle
  • Checking for Exceptions
  • Limitation of Expected Parameter
  • Testing for an Expected Exception
  • Testing Using a Timeout
  • Using Timeouts
  • Test Annotation: Resources

Lesson: Hamcrest

  • About Hamcrest
  • junit.assert.Assert.assertThat(...)
  • The Hamcrest Matcher Framework
  • Using assertThat
  • Hamcrest Matchers - Logical
  • Hamcrest Matchers - Object
  • Hamcrest Matchers - Number
  • Hamcrest Matchers - Collections
  • Additional Hamcrest Matchers
  • Hamcrest: Resources

Lesson: Parameterized Tests

  • Parameterize a Test Case
  • Injecting the Parameters
  • Setting the Parameters
  • Write the Test Method
  • Writing a Parameterized Test
  • Test Execution Cycle
  • Observations
  • Parameterized Tests: Resources

Lesson: Theories

  • Writing Theory Enabled Tests
  • Defining DataPoints
  • Defining Theories
  • Test Execution Cycle
  • Observations
  • Theories: Resources

Lesson: JUnit Best Practices

  • So What is a "Good" Test?
  • Good: Readable Equates to Maintainable
  • Good: Proper Organization and Structure
  • Good: Test the Right Thing
  • Good: Run in Solitude
  • Practices to Reduce and Manage Dependences
  • Good: Reliability
  • Importance of Quality of Assertions
  • Bad Smell: Primitive Assertions
  • Bad Smell: Broad Assertion
  • Bad Smell: Hidden Beef
  • Bad Smell: Split Personality
  • Bad Smell: Split Logic
  • Managing Data
  • Bad Smell: Parameterized Mess
  • Coding Practices
  • Legacy Code
  • Preparing Unit Test Environment
  • Stubs -> Mocks
  • White-Box Unit Testing
  • Black-Box Unit Testing
  • Keys to Success
  • Boundary Between Unit and Integration Testing
  • Integration Testing
  • Purpose of Integration Testing
  • Who Does Integration Testing
  • The Lowest Bar for Unit Testing
  • Automated Testing
  • Automation and Coverage
  • Working With Coverage Analysis

Session: Testing Tools

Lesson: Web Testing: jWebUnit/HttpUnit

  • Presentation testing
  • Integration testing
  • jWebUnit
  • jWebUnit/HttpUnit

Lesson: Mocking of Components

  • Why We use Test Dummies
  • Isolation
  • Improving Speed and Reliability
  • Handling Special Conditions and Hidden Data
  • Types of Test Dummies
  • Stubs
  • Mock Objects
  • Working with Mock Objects
  • Challenges of Testing User Interfaces
  • Using Mocks with the User Interface
  • Mock Object Strategies

Lesson: Mock Objects and EasyMock

  • EasyMock Description and Features
  • EasyMock Object Lifecycle
  • Types of Mock Objects (in EasyMock)
  • Create Phase: Creating EasyMock Mock Objects
  • Create Phase: Creating Mock Objects Directly
  • Create Phase: Creating Mocks Using a Control
  • Expect Phase: Recording Methods Returning Void
  • Expect Phase: Record Methods Returning Value
  • Expect Phase: Record Throwing Exception
  • Expect Phase: Call Repetition
  • Expect Phase: Matchers
  • Replay Phase: Preparing Mock Objects
  • Verify Phase: Checking that Expectations are Met
  • Mocking Complex Objects
  • Testing with Dependencies
  • Decoupling Dependent Classes
  • Testing with Mocks
  • EasyMock HOWTO

Session: Advanced Topics

Lesson: State-based vs. Interaction-based Testing

  • State-based vs. Interaction-based Testing
  • State-based Testing
  • Interaction-based Testing
  • Pros and Cons of Each
  • Scenarios and Examples

Lesson: Improving Code Quality Through Refactoring

  • Refactoring Overview
  • Sample of Refactorings
  • Refactoring and Testing
  • Suggested Refactoring
  • The Impact of Refactoring
  • Refactoring to Design Patterns
  • Sample Refactorings
  • Best Practices
  • Refactoring
  • Naming conventions
  • Organizing test suites

Lesson: Database Testing

  • Database Testing: DBUnit
  • Issues related to database testing
  • Persistence mechanisms
  • DBUnit

Appendix: Adding Testing to the Build Process

  • JUnit and Ant
  • The Ant JUnit Tag
  • Example Ant Build File
  • 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.

What does vendor-authorized training mean?

As a vendor-authorized training partner, we offer a curriculum that our partners have vetted. We use the same course materials and facilitate the same labs as our vendor-delivered training. These courses are considered the gold standard and, as such, are priced accordingly.

Is the training too basic, or will you go deep into technology?

It depends on your requirements, your role in your company, and your depth of knowledge. The good news about many of our learning paths, you can start from the fundamentals to highly specialized training.

How up-to-date are your courses and support materials?

We continuously work with our vendors to evaluate and refresh course material to reflect the latest training courses and best practices.

Are your instructors seasoned trainers who have deep knowledge of the training topic?

ExitCertified instructors have an average of 27 years of practical IT experience. They have also served as consultants for an average of 15 years. To stay up to date, instructors will at least spend 25 percent of their time learning new emerging technologies and courses.

Do you provide hands-on training and exercises in an actual lab environment?

Lab access is dependent on the vendor and the type of training you sign up for. However, many of our top vendors will provide lab access to students to test and practice. The course description will specify lab access.

Will you customize the training for our company’s specific needs and goals?

We will work with you to identify training needs and areas of growth.  We offer a variety of training methods, such as private group training, on-site of your choice, and virtually. We provide courses and certifications that are aligned with your business goals.

How do I get started with certification?

Getting started on a certification pathway depends on your goals and the vendor you choose to get certified in. Many vendors offer entry-level IT certification to advanced IT certification that can boost your career. To get access to certification vouchers and discounts, please contact Edu_customerexperience@techdata.com

Will I get access to content after I complete a course?

You will get access to the PDF of course books and guides, but access to the recording and slides will depend on the vendor and type of training you receive.

This course gave me a clearer understanding of the AWS cloud architecture.

I was very satisfied about how the course was organized. Sean Did a very good work

Very clean, great cafeteria and well sorted, very kind staff. The bathrooms have to be expanded as they might get crowded sometimes

Labs and the study materials provided for Architecting on AWS course are very easy to understand and explains all the topics required to pass the Associate certification.

Instructor, Training material & span of the training is neatly planned.

1 options available

undo
  • Dec 13, 2021 Dec 15, 2021 (3 days)
    Location
    Virtual
    Language
    English
    Time
    10:00 AM 6:00 PM EDT
    Enroll
    Enroll
Contact Us 1-800-803-3948
Contact Us
FAQ Get immediate answers to our most frequently asked qestions. View FAQs arrow_forward