Book Image

Test-Driven Java Development, Second Edition - Second Edition

By : Viktor Farcic, Alex Garcia
Book Image

Test-Driven Java Development, Second Edition - Second Edition

By: Viktor Farcic, Alex Garcia

Overview of this book

Test-driven development (TDD) is a development approach that relies on a test-first procedure that emphasizes writing a test before writing the necessary code, and then refactoring the code to optimize it.The value of performing TDD with Java, one of the longest established programming languages, is to improve the productivity of programmers and the maintainability and performance of code, and develop a deeper understanding of the language and how to employ it effectively. Starting with the basics of TDD and understanding why its adoption is beneficial, this book will take you from the first steps of TDD with Java until you are confident enough to embrace the practice in your day-to-day routine.You'll be guided through setting up tools, frameworks, and the environment you need, and we will dive right into hands-on exercises with the goal of mastering one practice, tool, or framework at a time. You'll learn about the Red-Green-Refactor procedure, how to write unit tests, and how to use them as executable documentation.With this book, you'll also discover how to design simple and easily maintainable code, work with mocks, utilize behavior-driven development, refactor old legacy code, and release a half-finished feature to production with feature toggles.You will finish this book with a deep understanding of the test-driven development methodology and the confidence to apply it to application programming with Java.
Table of Contents (18 chapters)
Title Page
Packt Upsell
Contributors
Preface
9
Refactoring Legacy Code – Making It Young Again
Index

Contributors

About the authors

Alex Garcia is a Software Engineer at Schibsted. He started coding in C++ but later moved to Java. He is also interested in Groovy, Scala, and JavaScript. He is always eager to learn new things and that is why he has also worked as a System Administrator and Full Stack Engineer. He is a big fan of agile practices. He is always interested in learning new languages, paradigms, and frameworks. When the computer is turned off, he likes to walk around sunny Barcelona and play sports.

I enjoyed writing this book and I would like to thank those people who made this possible. Thanks to the technical reviewers and staff at Packt Publishing for their valuable contributions. Thanks Viktor for sharing this experience with me. And finally, special thanks to my parents, my brother, and my girlfriend for being there whenever I need them.

 

 

 

Viktor Farcic is a Senior Consultant at CloudBees, a member of the Docker Captains group, and an author. His big passions are DevOps; microservices; continuous integration, delivery, and deployment; and test-driven development.

He often speaks at community gatherings and conferences. He published The DevOps Toolkit series and the Test-Driven Java Development book. His random thoughts and tutorials can be found at his blog, Technology Conversations.

I would like to thank a lot of people who have supported me during the writing of this book. The people at Everis and Defe (companies I worked with earlier) provided all the support and encouragement I needed. The technical reviewers, Alvaro Garcia, Esko Luontola, Jeff Deskins, and Muhammad Ali, did a great job by constantly challenging my views, my assumptions, and the quality of the code featured throughout the examples. Alvaro provided even more help by writing the Legacy Code chapter. His experience and expertise in the subject were an invaluable help. The Packt Publishing team was very forthcoming, professional, and always available to provide guidance and support. Finally, I'd like to give a special thanks to my daughter, Sara, and wife, Eva. With weekdays at my job and nights and weekends dedicated to this book, they had to endure months without the support and love they deserve. This book is dedicated to my girls.

About the reviewer

Jeff Deskins has been building web applications in the cloud since 2008 and enjoys using new technologies to do what was previously impossible. He is continuously learning best practices for creating high-performance applications.

Prior to his internet development career, Jeff worked for 13 years as a television news photographer. He continues to provide internet solutions for different television stations.

I would like to thank my wife for her support and patience through the many hours of me sitting behind my laptop learning new technologies. Love you the most!

 

 

 

 

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.