Test-Driven Development- Rationale for TDD
- The process of TDD
- Advantages to TDD
- Side-effects of TDD
- Tools to support TDD
Unit Testing Fundamentals- Purpose of Unit Testing
- Good Unit Tests
- Test Stages
- Unit Testing Vs Integration Testing
- Understanding Unit Testing
- Frameworks
Jumpstart: JUnit 5.x- Understand and work with the features of JUnit
- Write unit tests using @Test annotation
- Test Result Verification (Assertions)
- Manage fixtures using @BeforeEach, @AfterEach, @BeforeAll and @AfterAll annotations
- Maven setup using Surefire plugin
Annotations- Use @DisplayName to specify a custom name for the test
- Check for exceptions thrown by test
- Use @Disabled to prevent a test class or method from running
- Use timeouts to fail test that take longer than required
- Test Execution Order
Hamcrest- Learn the notation of assertThat
- Know the objective of Hamcrest library
- Use Hamcrest's logical and object matchers
- Use Hamcrest's number and collection matchers
Parameterized Tests- The @ParameterizedTest annotation
- A parameterized test to test code under several conditions
- Define different sources for test
- data (@ValueSource, @CsvSource, @CsvFileSource, @EnumSource, @MethodSource, @ArgumentSource)
Advanced Features- JUnit 4 vs JUnit 5
- Nested Unit Tests
- Repeated Tests
- JUnit Extensions
- ExecutionConditions
- Lambda Support
- Grouped Assertions
JUnit Best Practices- 'Good' Tests
- Bad Smell
- White-Box Unit Testing
- Black-Box Unit Testing
- Automation and Coverage
Mocking of Components- Why We use Test Dummies
- Working with Mock Objects
- Using Mocks with the User Interface
- Mock Object Strategies
Mock Objects and Mockito- Mockito Description and Features
- Mockito Object Lifecycle
- JUnit 5 and Mockito Dependency Injection
- Stubs Using ArgumentMatchers
- Verifying Behavior in Mockito
- Partial Mock Objects
- The Spy annotation
PowerMock- PowerMock Description and Features
- Using PowerMockito
- @PrepareForTest
- Mocking a final class or final method
- Mocking a Static Method
State-based vs. Interaction-based Testing- State-based Testing
- Interaction-based Testing
- Mock Objects Support Each Approach
- Three Areas to Check in a Test
Improving Code Quality Through Refactoring- Refactoring Overview
- Refactoring and Testing
- Refactoring to Design Patterns
Database Testing: DbUnit- Setting up DbUnit
- Defining a Dataset File in XML, CSV or Excel
- Writing a DbUnit Test Class
- Assert the results
- Use the FailureHandler and ValueComparer
- Using Date and Time in test sets
- Export a data set
, Session: Introducing Test-driven Development
Lesson: Test-Driven Development
Rationale for TDD
The process of TDD
Advantages to TDD
Side-effects of TDD
Tools to support TDD
Tutorial: Setup IntelliJ for Using Maven OR Using Eclipse Tutorial
Session: Unit Testing using JUnit
Lesson: Unit Testing Fundamentals
Purpose of Unit Testing
Good Unit Tests
Test Stages
Unit Testing Vs Integration Testing
Understanding Unit Testing Frameworks
Lesson: Jumpstart: JUnit 5.x
Understand and work with the features of JUnit
Write unit tests using @Test annotation
Test Result Verification (Assertions)
Manage fixtures using @BeforeEach, @BeforeAll and @AfterAll annotations
Maven setup using Surefire plugin
Lab: Demo JUnit
Lab: Build JUnit Case Study
Lab: Jumpstart JUnit
Lesson: Annotations
Use @DisplayName to specify a custom name for the test
Check for exceptions thrown by test
Use @Disabled to prevent a test class or method from running
Use timeouts to fail test that take longer than required
Test Execution Order
Lab: Working with @Test Annotation
Lesson: Hamcrest
Learn the notation of assertThat
Know the objective of Hamcrest library
Use Hamcrest's logical and object matchers
Use Hamcrest's number and collection matchers
Lab: Working with Hamcrest
Lesson: Parameterized Tests
The @ParameterizedTest annotation
A parameterized test to test code under several conditions
Define different sources for test data (@ValueSource, @ArgumentSource)
Lab: Working with Parameterized Tests
Lesson: Advanced Features
JUnit 4 vs JUnit 5
Nested Unit Tests
Repeated Tests
JUnit Extensions
ExecutionConditions
Lambda Support
Grouped Assertions
Lab: Working with Advanced Features
Lesson: JUnit Best Practices
"Good" Tests
Bad Smell
White-Box Unit Testing
Black-Box Unit Testing
Automation and Coverage
Session: Mocking
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 Mockito
Mockito Description and Features
Mockito Object Lifecycle
JUnit 5 and Mockito Dependency Injection
Stubs Using ArgumentMatchers
Verifying Behavior in Mockito
Partial Mock Objects
The Spy annotation
Lab: Mock Object and Mockito
Lesson: PowerMock
PowerMock Description and Features
Using PowerMockito
@PrepareForTest
Mocking a final class or final method
Mocking a Static Method
Session: Advanced Topics
Lesson: State-based vs. Interaction-based Testing
State-based Testing
Interaction-based Testing
Mock Objects Support Each Approach
Three Areas to Check in a Test
Lab: Interaction-based Testing
Lesson: Improving Code Quality Through Refactoring
Refactoring Overview
Refactoring and Testing
Refactoring to Design Patterns
Lab: Refactoring
Lab: Best Practices - Refactoring Tests
Lesson: Database Testing: DbUnit
Setting up DbUnit
Defining a Dataset File in XML, CSV or Excel
Writing a DbUnit Test Class
Assert the results
Use the FailureHandler and ValueComparer
Using Date and Time in test sets
Export a data set
Lab: Introduction to DbUnit
Lab: DbUnit Assertions
Lab (OPTIONAL): Selenium and DbUnit