Andrew Dacenko <asd@fb.com>

Front End Engineer @Facebook

August 6, 2018

TEST DRIVEN DEVELOPMENT

GOAL

ARCHITECTURE

DEVELOPMENT

TDD STEPS

Navigation List

Test First

Assert First

Fail First

NAVIGATION

  • ​Create view

  • Validate form inputs

  • Show errors

  • Redirect on submit

Write NAVIGATION MAP for your current/next task at project

TEST FIRST

import add from './add';

it('should add numbers', () => {
    
});

ASSERT FIRST

import add from './add';

it('should add numbers correctly', () => {
  expect(add(0, 2)).toBe(2);
});

FAIL FIRST

PROCESS

PROS

  • Requirements are met

  • Correctness

  • Improved code

  • Code as documentation

  • Safe refactoring

  • Coverage

  • No dead code

TDD ARTIFACTS

Pomodoro

Pair Programming

Continuous Integration

POMODORO

PAIR PROGRAMMING

CI

FIX IT LATER

At each step in time, the following transitions occur:

  • Any live cell with < 2 live neighbours dies, as if caused by under-population.
  • Any live cell with 2 or 3 live neighbours lives on to the next generation.
  • Any live cell with > 3 live neighbours dies, as if by over-population.
  • Any dead cell with exactly 3 live neighbours becomes a live cell, as if by reproduction.

 

A.K.A. B3/S23

CONWAY`S GAME OF LIFE

Novice

  • Use ping-pong technique
  • Code without conditional statements

 

Advanced

  • Use immutable approach
  • Implement infinite board
  • Implement hexadecimal board

 

Expert

  • Implement healing board
  • Implement async board

STAGES

Q&A Time

TDD Workshop

By Andrew Dacenko

TDD Workshop

TDD Workshop for Coders of Colour Aug 6th, 2018

  • 653