Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Test-Driven Development with Java
  • Table Of Contents Toc
Test-Driven Development with Java

Test-Driven Development with Java

By : Alan Mellor
4.8 (5)
close
close
Test-Driven Development with Java

Test-Driven Development with Java

4.8 (5)
By: Alan Mellor

Overview of this book

Test-driven development enables developers to craft well-designed code and prevent defects. It’s a simple yet powerful tool that helps you focus on your code design, while automatically checking that your code works correctly. Mastering TDD will enable you to effectively utilize design patterns and become a proficient software architect. The book begins by explaining the basics of good code and bad code, bursting common myths, and why Test-driven development is crucial. You’ll then gradually move toward building a sample application using TDD, where you’ll apply the two key rhythms -- red, green, refactor and arrange, act, assert. Next, you’ll learn how to bring external systems such as databases under control by using dependency inversion and test doubles. As you advance, you’ll delve into advanced design techniques such as SOLID patterns, refactoring, and hexagonal architecture. You’ll also balance your use of fast, repeatable unit tests against integration tests using the test pyramid as a guide. The concluding chapters will show you how to implement TDD in real-world use cases and scenarios and develop a modern REST microservice backed by a Postgres database in Java 17. By the end of this book, you’ll be thinking differently about how you design code for simplicity and how correctness can be baked in as you go.
Table of Contents (21 chapters)
close
close
1
Part 1: How We Got to TDD
5
Part 2: TDD Techniques
15
Part 3: Real-World TDD

Preface

Modern software is driven by users wanting new features, with no defects, released rapidly – a very challenging task. Solo developers have given way to development teams working together on a single software product. Features are added in short iterative cycles, then released to production frequently – sometimes daily.

Achieving this requires excellence in development. We must ensure that our software is always ready to be deployed and free of defects when it is released into production. It must be easy for our developer colleagues to work with. Code must be easy for anyone to understand and change. When the team makes those changes, we must have confidence that our new features work properly and that we have not broken any existing features.

This book brings together proven techniques that help make this a reality.

Test-driven development (TDD), the SOLID principles, and hexagonal architecture enable developers to engineer code that is known to work and known to be easy to work with. Development focuses on the fundamentals of software engineering. These practices are the technical foundation behind a code base that is easy and safe to change and always ready to be deployed.

This book will enable you to write well-engineered, well-tested code. You will have confidence that your code works as you think it should. You will have the safety of an ever-growing suite of fast-running tests, keeping a watchful eye over the whole code base as the team makes changes. You will learn how to organize your code to avoid difficulties caused by external systems such as payment services or database engines. You will reduce your dependence on slower forms of testing.

You will be writing higher quality code, suitable for a Continuous Delivery approach.

Modern software requires a modern development approach. By the end of this book, you will have mastered the techniques to apply one.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Test-Driven Development with Java
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon