Dojo : TDD Against the Time with React and Redux
This project is maintained by Bogala
Langton’s ant is a two-dimensional universal Turing machine with a very simple set of rules but complex emergent behavior. It was invented by Chris Langton in 1986 and runs on a square lattice of black and white cells. The universality of Langton’s ant was proven in 2000. The idea has been generalized in several different ways, such as turmites which add more colors and more states.
Squares on a plane are colored variously either black or white. We arbitrarily identify one square as the “ant”. The ant can travel in any of the four cardinal directions at each step it takes. The “ant” moves according to the rules below:
Langton’s ant can also be described as a cellular automaton, where the grid is colored black or white and the “ant” square has one of eight different colors assigned to encode the combination of black/white state and the current direction of motion of the ant.
Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: Requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows software to be added that is not proven to meet requirements. 5 Steps to reproduce every cycle:
For more informations, see Wikipedia
In this type of sessions, we add one key constraint on the TDD cycle : Before each test, we launch a five minutes timer.
The five minute time constraint sounds fiendish doesn’t it? How can you possibly get anything done in five minutes? Well, you can, if you tackle something small enough. This exercise is designed to force you to think in small increments of functionality.
Behaviour-Driven Development (BDD) is a set of practices that aim to reduce some common wasteful activities in software development:
BDD aims to narrow the communication gaps between team members, foster better understanding of the customer and promote continuous communication with real world examples.
Example Mapping is a simple method to make this conversation short and very productive.
Concrete examples are a great way to help us explore and understand the problem domain. They are a great basis for our acceptance tests.
When discussing examples, other things might come up in the conversation that deserve to be captured too:
We can capture these different types of information on index cards, and arrange them in a map:
We keep going until the group is satisfied that the scope of the story is clear, or we run out of time.
All your code must be covered by unit tests. Our technology permit this : React, TypeScript, Jest and Enzyme.
In this case, we’ll use Typescript to verify coherence between objects. We’ll avoid maximum any
(implicit or not).
It is a six parts dojo, each part need previous (or previous solution) to be played :
Now we can begin the dojo with the first step : Create React App