YoVDO

Writing and Refactoring Testable PHP

Offered By: LinkedIn Learning

Tags

PHP Courses Unit Testing Courses Object-oriented programming Courses Code Quality Courses Software Design Courses Test-Driven Development Courses Automated testing Courses GitHub Codespaces Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Discover how to leverage test-driven development (TDD) in new PHP projects and refactor code in existing projects.

Syllabus

Introduction
  • Test-driven development and refactoring in PHP
  • Concepts and technologies you should know
  • Using GitHub Codespaces with this course
1. What Are You Doing Here?
  • Automated testing
  • Define types of testing
  • What is refactoring?
  • When to refactor
2. TDD a New Project
  • Configure a project for tests
  • Write an acceptance test
  • Write a failing unit test, make the test pass, refactor
  • Write testable code
3. What to Refactor in Existing (Legacy) Projects
  • Large chunks of logic
  • Incorrect OOP logic
  • Change lots of files for one feature
  • Unnecessary code
  • Strong coupling
  • Using mocks
  • Files that are modified often
  • Identifying the best place to start
4. Examples of Test-Driven Refactoring
  • Add one passing test
  • Identify a brittle function and add tests
  • Extract functionality (using TDD)
  • Simplify conditionals
  • Simplify function signatures
5. OOP Examples of Test-Driven Refactoring
  • Identify objects from related functions
  • Replace arrays with objects
  • Add value objects (easy to test)
  • Add null objects
  • Replace conditionals with interfaced classes
6. Moving Fast by Moving Slower
  • Make steady progress
  • Prevent regressions
  • Cleaner code
  • Decoupled code
  • Become a better developer
7. TDD and Refactoring in the Real World
  • On a spaghetti-code project
  • With a looming deadline
  • With a team that doesn't understand TDD and refactoring
  • With a PM that doesn’t understand TDD and refactoring
Conclusion
  • Next steps

Taught by

Gary Kovar

Related Courses

A Practical Introduction to Test-Driven Development
LearnQuest via Coursera
Puppet Professional Certification - PPT206
A Cloud Guru
Advanced Programming in Kotlin
Meta via Coursera
البرمجة المتقدمة في Kotlin
Meta via Coursera
Programación avanzada en Kotlin
Meta via Coursera