1 of 21

Full-stack

Test-driven

Development

marko.bjelac@softwaresauna.com

2 of 21

Why TDD?

Implement

Write tests

Redesign (refactor)

Fix bugs

Test-drive

Testless

TAD

TDD

Firestorm

Time ($$$)

3 of 21

Why TDD?

… or just google: GEEPAW

4 of 21

The Cycle

5 of 21

The Cycle

Red

Test

SUT

6 of 21

The Cycle

Red

Test

Green

SUT

7 of 21

The Cycle

Red

Test

Green

SUT

8 of 21

The Cycle

Red

Test

Green

SUT

Refactor

9 of 21

ATDD

10 of 21

ATDD

Red

Spec

11 of 21

ATDD

Red

Spec

12 of 21

ATDD

Red

Spec

13 of 21

ATDD

Red

Spec

14 of 21

ATDD

Red

Spec

Green

15 of 21

ATDD

Red

Spec

Green

16 of 21

ATDD

Red

Spec

Green

Refactor

17 of 21

Specification

Interactor

Logic

Adapter

Externality

Adapter

public API

Test-driven Architecture

Microtest

User

system boundary

mocking

18 of 21

Specification

Interactor

Logic

Adapter

Interactor nesting & re-use

Interactor

Interactor

Interactor

Logic

Adapter

Logic

Logic

Specification

Interactor

Logic

Interactor

Logic

Adapter

Microtest

Microtest

Microtest

Microtest

Microtest

Microtest

19 of 21

test setup

test setup

system boundary

public API

user

external dependency

external dependency

specification

microtest

interactor

logic

adapter

test double

implementation

usage

API

microtest scope

specification scope

20 of 21

test setup

test setup

system boundary

public API

user

external dependency

external dependency

specification

microtest

interactor

logic

adapter

test double

implementation

usage

API

microtest scope

specification scope

deployable #2

deployable #1

Contract

21 of 21

test setup

test setup

system boundary

public API

user

external dependency

external dependency

specification

microtest

interactor

logic

adapter

test double

implementation

usage

API

microtest scope

specification scope

deployable #2

deployable #1

Front-end (JS)

Back-end (Java)

Full-stack!

MySQL

React