Book Image

Test-Driven Development with PHP 8

By : Rainier Sarabia
Book Image

Test-Driven Development with PHP 8

By: Rainier Sarabia

Overview of this book

PHP web developers end up building complex enterprise projects without prior experience in test-driven and behavior-driven development which results in software that’s complex and difficult to maintain. This step-by-step guide helps you manage the complexities of large-scale web applications. It takes you through the processes of working on a project, starting from understanding business requirements and translating them into actual maintainable software, to automated deployments. You’ll learn how to break down business requirements into workable and actionable lists using Jira. Using those organized lists of business requirements, you’ll understand how to implement behavior-driven development (BDD) and test-driven development (TDD) to start writing maintainable PHP code. You’ll explore how to use the automated tests to help you stop introducing regressions to an application each time you release code by using continuous integration. By the end of this book, you’ll have learned how to start a PHP project, break down the requirements, build test scenarios and automated tests, and write more testable and maintainable PHP code. By learning these processes, you’ll be able to develop more maintainable, and reliable enterprise PHP applications.
Table of Contents (17 chapters)
Part 1 – Technical Background and Setup
Part 2 – Implementing Test-Driven Development in a PHP Project
Part 3 – Deployment Automation and Monitoring

What is BDD?

BDD is a way or a process to develop software where the intended behavior of a solution is first defined by the business and then translated into automated test scenarios, before starting the actual development of the solution code.

This development process promotes collaboration among the different departments or teams in a software company. It might sound ridiculous, but in my experience, understanding exactly “what” needs to be built and what is the actual goal of the project is what I always see as the most elusive part when starting a project.

There are times when the business or a client doesn’t even know what it wants, or maybe the business or client does not know how to express or relay those goals effectively. Now, imagine being a software developer for a company—your job is to develop solutions to problems to achieve a goal. What if that goal is not defined clearly? Or, what if the goal was defined by the business but not relayed...