TLA+
Whenever we read about TLA+, it's referred as formal verification method. I always misunderstood it as a way to test software.
It uses mathematical methods to verify something. We use mathematical symbols and terms to describe the properties of the system.
TLA+ tests only requirements. We define the system's expected behavior using its DSL.
Describing the system
Main mental model is to keep in mind that we use TLA to describe the state machine of the application. Meaning, we define valid states and transitions between states.
- state - Not defined in the TLA+ code. We only write all possible variables and define a start node which has the initial values for these variables.
- action - This is defined in the TLA+ code. Here write for every action, what must the current state which is the origin node and what must the next state which is the destination node.

Once we've the expected behavior defined, the model checker tests the described model by generating all possible states and transitions of the system. Keep in mind that the actual code is never tested at all.
It can happen that the code itself is correct but system requirements is described wrongly. This will be flagged as defect which is actually not.
Symbols
The symbols used in TLA+ have different meanings compared to other programming languages.
- == means assignment.
- = means comparison. Returns TRUE or FALSE.
TLA+ uses boolean everywhere. We see that in any code written in TLA+. It's used to define valid actions, valid states, etc