# 1.3 Analysing, running and observing

> The engine does three different jobs with a program: analysing it without running it, running it, and letting you observe what happens inside.

Web page: https://pseudolearn.app/en/spec/vision/analizar-ejecutar

> **In one sentence**
>
> The engine does three different jobs with a program: analysing it without running it, running it, and letting you observe what happens inside.

## 1.3.1 How it works

**Analysing** means reading the program without running it. The editor does it every time you type: it colours the words, points out errors and offers help. Analysing never changes anything or writes to the output.

**Running** means really going through the instructions. The result is the output, the way the program ended and, if something failed, the runtime diagnostic.

**Observing** means running while leaving a trail. The engine records every important event (entering a statement, taking a decision, writing something) and keeps the state of memory. With that trail the editor draws the run step by step.

**Figure 1.3-1: Analysing, running and observing**

A program with three arrows leaving it towards Analyse, Run and Observe. Below each one, what it produces: diagnostics, colours and help; output, termination and failures; trace, memory and timeline. A green line joins Run and Observe because both go through the instructions.

Three jobs with the same program. Each produces something different; only running and observing go through the instructions.

This program analyses without errors, runs and leaves a trace with one decision:

### Program: Even or odd?

```pseudolearn
Algorithm Paridad
  Define numero As Integer <- 14;
  If numero Mod 2 = 0 Then
    Write numero, " es par";
  Else
    Write numero, " es impar";
  EndIf
EndAlgorithm
```

**Output**

```text
14 es par
```

*The program finishes normally.*

> **Under the hood**
>
> This is the trace the engine produced when observing `Paridad`. Each line is an event with the program line where it happened:
>
> **Trace**
>
> | Line | Event |
> | --- | --- |
> | 2 | enters statement |
> | 3 | enters statement |
> | 3 | decision · true branch |
> | 4 | enters statement |
> | 4 | writes · 14 es par |

**In short**
- Analysing: reading without running; produces colours, errors and help.
- Running: going through the instructions; produces output and termination.
- Observing: running while leaving a trace and memory states.

**See also**
- [1.2 The journey of a program: from text to execution](https://pseudolearn.app/en/spec/vision/viaje.md)
- [13.5 Observing execution](https://pseudolearn.app/en/spec/motor/observacion.md)
