Test-driven Development in Java
Instruction Language: English
Duration: 2 days
The main objective for this course is to provide you with all the necessary information to write unit and integration tests in Java.
Who benefits? Java Developers. Students should have a good understanding of the Java Platform Standard and Enterprise Edition.
This comprehensive course leads you through the necessary skills and tools to follow Test-Driven Development in Java. The following aspects are covered:
- Test-Driven Development
- Continues integration
- Code coverage
- Unit testing
- JUnit 4.x (all aspects!)
- Mocking (using EasyMock)
- Integration test using DBUnit
- Best practices, pitfalls etc.
- Spring TestContext framework (including integration testing)
- Optional: web boundary testing using HttpUnit
Course Content (Trivera course catalogue)
Session 1: Introduction Test-Driven Development
Lesson: Test-Driven Development
- Appreciate the benefits of test-driven development
- Understand the concept of "Write test before code"
- Understand different types of tests
- Understand the value of tests
- Explain the value of continuous integration
Lesson: Continuous Integration and Unit Testing
- Understand the scope of unit testing
- Understand what needs to be tested
- List basic Unit Testing best-practices
- Discuss how Unit testing can also fulfill regression testing
- Introduce the xUnit family of products
- Understand how unit testing can help in resolving bugs that slip through
- Continuous Integration
- Introduce Continuous Integration (CI)
- Properties of CI
- CI's position in the IT Service Management
- CI vs. (McConnell's) Smoke Test
- Use tools such as CruiseControl in conjunction with Dashboard
Session 2: Java Unit testing techniques
Lesson: JUnit 4
- Define the components of JUnit
- Understand the concept of a TestCase
- Describe the assertion process
- Define TestCases
- Understand Fixtures
- Understand Test Suites
- List different TestRunners
- Ant and JUnit
- Pitfalls in Unit Testing
- Discuss Test Coverage
Lesson: Mock Objects and DBUnit
- Understand the concept of Mock objects
- List candidate object for mocking
- Explain benefits of Mock Objects
- Understand the difference between Stubs and Mock Objects
- Understand the difference between Dummy Implementations and Mock Objects
- Understand where to use Mock objects
- Understand what Mock frameworks can do for you
- Give an overview of and example Mock framework (EasyMock)
- Discuss different strategies in testing database applications
- Introduce DbUnit
Session 3: Web Application Testing Techniques
Lesson: Introduction to HttpUnit
- Understand how HttpUnit automates the HTML parsing process
- Understand the relation between JUnit and HttpUnit
- Brief introduction to in-container testing and Cactus