> For the complete documentation index, see [llms.txt](https://braydie.gitbook.io/how-to-be-a-programmer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://braydie.gitbook.io/how-to-be-a-programmer/es/1-beginner/team-skills/08-how-to-unit-test.md).

# ¿Cómo realizar pruebas unitarias?

Las pruebas unitarias, que consisten en probar una funcionalidad individual codificada por el equipo que la escribió, son parte del proceso de codificación, no algo diferente. Parte del diseño del código es diseñar cómo se probará. Deberías escribir un plan de pruebas, incluso si es solo una oración. A veces, la prueba será simple: '¿Se ve bien el botón?' A veces será compleja: '¿Este algoritmo de coincidencia devolvió coincidencias precisas?'

Utiliza la verificación de afirmaciones y los controladores de prueba siempre que sea posible. Esto no solo detecta errores temprano, sino que también es muy útil más adelante y te permite eliminar misterios sobre los que de lo contrario tendrías que preocuparte.

Los desarrolladores de Extreme Programming escriben extensamente sobre cómo realizar pruebas unitarias de manera efectiva; no puedo hacer más que recomendar sus escritos.

Siguiente [Tomarse descansos cuando te sientes bloqueado](/how-to-be-a-programmer/es/1-beginner/team-skills/09-take-breaks-when-stumped.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://braydie.gitbook.io/how-to-be-a-programmer/es/1-beginner/team-skills/08-how-to-unit-test.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
