~/talk

Principles of Unit Testing

Talkat MidCamp 2019 · 2019-03-21..03-24· [testing]
links:none on file
slides:none on file

Defines a unit test as verifying a unit against a specification and walks through concrete PHPUnit examples using PHPUnit and Prophecy, demonstrating the five test doubles (dummy, fake, stub, spy, mock), when to use each, and how a spy makes Arrange‑Act‑Assert clearer than a mock. Uses Drupal code (BatchStorage load, maintenance mode subscriber) to show refactoring into single‑responsibility units, suggests PhpMetrics to find high cyclomatic complexity targets, and names Coveralls/CircleCI for coverage and automation.

AI-written summary · about

  1. 0:00Introduction
  2. 4:49Agenda
  3. 6:27Definition
  4. 11:24Levels of Testing
  5. 13:29Test Doubles
  6. 17:17Test Double Types
  7. 28:39Questions
  8. 31:14Example
  9. 36:18Responsibility
  10. 39:49Test smells
  11. 41:26Bridge analogy
  12. 44:59Rule of 3
  13. 48:01Socially Unit Testing
  14. 50:16The Lorax
  15. 51:46An easy example
  16. 52:24PHP metrics
  17. 54:41Symphony
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.