Mastering Test-Driven Development using JUnit (TT3500)
About This Course
Mastering Test Driven Development using JUnit is a five-day, comprehensive hands-on test-driven development / JUnit / TDD training course geared for developers who need to get up and running with essential Test-driven development programming skills using JUnit and various open-source testing frameworks. Throughout the course students learn the best practices for writing great programs in Java, using test-driven development techniques. This comprehensive course also covers essential TDD topics and skills.
Audience Profile
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.
Take Before: Students should have basic development skills and experience in the following topics, or attend these courses as a pre-requisite:
- TT2100 Mastering Java for OO Developers
- TT5100: Mastering JEE Web Application Development
At Course Completion
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.
Course Outline
Session: Introducing Test-Driven Development (TDD)
Lesson: Test-Driven Development
- Test, code, refactor, repeat
- The ROI of TDD
- Rationale
- Advantages
- Tools
Session: JUnit
Lesson: Jumpstart: JUnit 4.x
- JUnit Overview
- How JUnit Works
- Launching Tests
- Test Suites
- JUnit Test Fixture
Lesson: @Test Annotation
- Test Execution Cycle
- Checking for Exceptions
- Using Timeouts
Lesson: Hamcrest
- About Hamcrest
- The Hamcrest Matcher Framework
- Hamcrest Matchers
Lesson: Parameterized Tests
- Injecting the Parameters
- Setting the Parameters
- Test Execution Cycle
- Observations
Lesson: Theories
- Writing Theory Enabled Tests
- Defining DataPoints
- Defining Theories
- Observations
Lesson: JUnit Best Practices
- "Good" Tests
- Bad Smells
- White-Box Unit Testing
- Black-Box Unit Testing
- Automation and Coverage
Session: Testing Tools
Lesson: Web Testing: jWebUnit/HttpUnit
- Presentation testing
- Integration testing
- jWebUnit
- jWebUnit/HttpUnit
Lesson: Mocking of Components
- Why We use Test Dummies
- Mock Objects
- Working with Mock Objects
- Using Mocks with the User Interface
- Mock Object Strategies
Lesson: Mock Objects and EasyMock
- EasyMock Description and Features
- EasyMock Object Lifecycle
- Create/Expect Phase
- Replay/Verify Phase
- Mocking Complex Objects
- EasyMock HOWTO
Lesson: PowerMock
- PowerMock Description and Features
- PowerMock Object Lifecycle
- Mocking a Static Method
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
Lesson: Improving Code Quality Through Refactoring
- Refactoring Overview
- Refactoring and Testing
- Refactoring to Design Patterns
- Naming conventions
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
- Running JUnit Tests From Ant
- Generating a JUnitReport
Sorry! It looks like we haven’t updated our dates for the class you selected yet. There’s a quick way to find out. Contact us at 502.265.3057 or email info@training4it.com
Request a Date