Log In
Join
for free
Back To Course Home
Test-Driven Development in Java
0% completed
Getting Started
Introduction and Prerequisites
Building the Case for TDD
Introduction: Building the Case for TDD
Writing Code Badly
Recognizing Bad Code
Decreasing Team Performance
Diminishing Business Outcomes
Summary and Quiz: Building the Case for TDD
Using TDD to Create Good Code
Introduction: Using TDD to Create Good Code
Designing Good Quality Code
Revealing Design Flaws
Preventing Logic Flaws
Avoiding Future Defects and Documenting Codes
Summary and Quiz: Using TDD to Create Good Code
Dispelling Common Myths about TDD
Introduction: Dispelling Common Myths About TDD
Writing Tests Slows Me Down
Tests Cannot Prevent Every Bug
How Do You Know the Tests Are Right?
TDD Guarantees Good Code
Our Code Is Too Complex to Test
We Don’t Know What to Test Until We Write the Code
Summary and Quiz: Dispelling Common Myths About TDD
Building an Application Using TDD
Introduction: Building an Application Using TDD
Introducing the Wordz Application
Exploring Agile Methods
Summary and Quiz: Building an Application Using TDD
Writing Our First Test
Introduction: Writing Our First Test
Starting TDD: Arrange-Act-Assert
Defining a Good Test
Catching Common Errors and Asserting Exceptions
Preserving Encapsulation
Finding Design Flaws with Unit Testing
Beginning Wordz
Exercise: Extending Wordz
Solution: Extending Wordz
Summary and Quiz: Writing Our First Test
Challenge: Basic String Manipulation
Solution: Basic String Manipulation
Following the Rhythms of TDD
Introduction: Following the Rhythms of TDD
Following the Red-Green-Refactor Cycle
Writing Our Next Tests for Wordz
Advancing the Design With Two-letter Combinations
Summary and Quiz: Following the Rhythms of TDD
Exercise: Email Address Validator
Solution Email Address Validator
Challenge: FizzBuzz
Solution: FizzBuzz
Driving Design—TDD and SOLID
Introduction: Driving Design—TDD and SOLID
Test Design with SOLID Principles
Simplifying Maintenance with SRP
Implementing DIP for Enhanced Flexibility
Understanding LSP in OOP
Implementing OCP in OOP
Effective Interface with ISP
Summary and Quiz: Driving Design—TDD and SOLID
Exercise: Transforming Shape Area Calculation
Solution: Transforming Shape Area Calculation
Challenge: Pig Latin
Solution: Pig Latin
Test Doubles—Stubs and Mocks
Introduction: Test Doubles—Stubs and Mocks
Testing Challenges in Collaborative Software Development
Mastering Test Challenges with Test Doubles and SOLID Principles
Using Stubs for Controlled Testing
Exploring Mock Objects in Testing
Understanding When Test Doubles Are Appropriate
Automating Test Doubles with Mockito
Mockito for Efficient Test Double Creation
Testing Exception Handling with Mockito
Testing an Error Condition in Wordz
Summary and Quiz: Test Doubles—Stubs and Mocks
Challenge: Grade System—Stubs and Mocks
Solution: Grade System—Stubs and Mocks
Hexagonal Architecture—Decoupling External Systems
Introduction: Hexagonal Architecture—Decoupling External Systems
Challenges of External Systems
Enhancing Testability and Maintainability Through SOLID Principle
Abstracting External Systems in Hexagonal Architecture
Crafting the Domain Model
Efficient Testing with FIRST Unit Tests in Hexagonal Architecture
Abstracting the Database Using Hexagonal Architecture
Summary and Quiz: Hexagonal Architecture—Decoupling External System
Challenge: Hexagonal Architecture for CRUD Operations
Solution: Hexagonal Architecture for CRUD Operations
FIRST Tests and the Test Pyramid
Introduction: FIRST Tests and the Test Pyramid
Test Pyramid: A Structured Approach to Effective Testing
Integration Tests in Test Pyramid
Understanding End-to-End and User Acceptance Tests
CI/CD Pipelines for Optimizing Software Development Workflow
CI/CD Pipelines and Test Environments in Production
Integration Testing in Wordz
Summary and Quiz: FIRST Tests and the Test Pyramid
Exploring TDD with Quality Assurance
Introduction: Exploring TDD with Quality Assurance
Exploring TDD’s Role in Software Quality Assurance
Manual Exploratory Testing—Discovering the Unexpected
Balancing Automation and Human Review
Crafting User-Centric Interfaces by UI and UX Testing
Development Through Secure Operations and Balanced Practices
Summary and Quiz: Exploring TDD with Quality Assurance
Test First, Test Later, Test Never
Introduction: Test First, Test Later, Test Never
Adding Tests First
Risks Associated with Delayed Testing in TDD
Consequences of Avoiding Test Automation
Inside-Out vs. Outside-In Testing in TDD
Mastering Test Strategies with Hexagonal Architecture
Summary and Quiz: Test First, Test Later, Test Never
Driving the Domain Layer
Introduction: Driving the Domain Layer
Initiating a New Wordz Game Instance
Tracking the Progress of the Wordz Game
Triangulating Word Selection in Wordz Using Mock Setup
Asserting Word Selection and Refactoring Using Mock Setup
Designing the Gameplay Interface for Wordz
Triangulating Game Progress Tracking by Refactoring
Handling Guesses, Attempts, and Game Over Conditions
Wordz Design Evaluation and Optimization
Summary and Quiz: Driving the Domain Layer
Challenge: PigLatin Game Domain Layer
Solution: PigLatin Game Domain Layer
Driving the Database Layer
Introduction: Driving the Database Layer
Database Integration Test with DBRider
Production Code for Database Integration Test
Building WordRepository and GameRepository Adapters
Summary and Quiz: Driving the Database Layer
Driving the Web Layer
Introduction: Driving the Web Layer
Configuring and Testing HTTP Endpoints
Building HTTP Server for Wordz Application
Streamlining Game Initialization in Wordz
Managing Game Start Errors in Wordz
Handling Multiple Guesses in the Wordz Gameplay
Integrating Core Components of Wordz Application
Navigating Wordz Game with Microservice Architecture
Summary and Quiz: Driving the Web Layer
Wrap Up
Takeaways and Future Directions
Appendix
Technical Requirements
Summary and Quiz: Writing Our First Test
Test your knowledge of writing test codes.
Chapter’s
...
Get hands-on with 1400+ tech skills courses.
Start Free Trial