Angular Unit testing. Test driven development (TDD)

Dmytro Golysh

Find Software Bugs Early

Simplifies Integration

Provides Documentation

Frameworks for unit testing in JavaScript

TDD

Add a test

Run test and see how it fails

Fail First

Write the code

Run and check works

Refactor code and repeat

Benefits

  • It makes coding more fun
  • Coverage
  • Simpler design
  • Simple decomposition of complex tasks
  • Code as documentation
  • No extra code
  • More testable code - More readable code
  • Rare debugging
  • More concentrated

Think Different

How start ? 

Good knowledge of test framework

Best Practices 

Pair programming

Driver

Navigator

Knowledge sharing

Navigation Lists

Self time management.

Pomodoro

Tricks:

Ping-pong technique

Change driver after each 25 mins 

If the driver is silent, the navigator should intervene

Silent coding

Bonus:

TDD is good for tasks with many conditions

KISS

Keep It Simple, Stupid

YAGNI

You Ain't Gonna Need It

Do it

Made with Slides.com