React Testing

What is a test?

  • a set of problems, questions, etc., for evaluating a person's abilities, skills, or performance

  • the means by which the quality of anything is determined

  • a trial of the quality of something

To test a software means to check if the software is doing what needs to be done

Automated Tests

An automated test is a software that tests your software

Test Types

(What)

Unit tests

Integration tests

end-to-end (aka e2e) tests

Test Types

(How)

Smoke tests

Black-box testing

White-box testing

Monkey testing

Costs

Test Automation Pyramid

Documentation

xUnit architecture

Kent Back created 'SUnit' for SmallTalk. From that first implementation a more generic architecture it's born

Test Runner

Test Case

Test fixtures

Test Suite

Assertions

Test result formatter

F.I.R.S.T.

Fast

Isolated

Repeatable

Self-Validating

Thorough

What to Test?

Low Hanging / Highest Value

Test Driven Development

Test Driven Development

Kent Beck has developed this technique and distilled it in his famous book "Test Driven Development: By Example" in 2003

Create a test case before start writing the code

Write the simplest code possible to pass that test

Iterate

Refactoring after each iteration

When you pick the next test try to write a test that will teach you something new

I really mean the simplest code ever possible...

During the Refactoring phase you can also delete unuseful tests

Why?

Better Design

YAGNI

You Aint Gonna Need It

Costs

ShuHaRi

ShuHaRi roughly translates to "first learn, then detach, and finally transcend."

Shu =  "protect", "obey"

Ha = "detach", "digress"

Ri = "leave", "separate"

Graph By Ruma Dak

Graph By Pawel Brodzinski

React Testing

By Francesco Strazzullo

React Testing

  • 1,614