73 lines
2.8 KiB
TeX
73 lines
2.8 KiB
TeX
\chapter{Estrategia de pruebas}
|
|
\label{ch:estrategia}
|
|
|
|
\section{Pir\'amide}
|
|
Cada capa responde a una pregunta distinta: correctitud de dominio,
|
|
integraci\'on entre servicios, cierre del flujo de negocio, resistencia a carga
|
|
y degradaci\'on ante fallos.
|
|
|
|
\begin{table}[h]
|
|
\centering
|
|
\begin{tabular}{@{}llp{4.2cm}l@{}}
|
|
\toprule
|
|
\textbf{Capa} & \textbf{Qu\'e valida} & \textbf{D\'onde} & \textbf{Frecuencia} \\
|
|
\midrule
|
|
Unitaria & Dominio, parsers, auth, store & Local + CI & Cada PR \\
|
|
Integraci\'on & HTTP + PG/Redis/MinIO & Compose test & PR / nightly \\
|
|
Contrato & OpenAPI / rutas gateway & CI & Cada PR \\
|
|
E2E & Flujos de negocio & Staging & Nightly / release \\
|
|
Estr\'es & L\'imites y degradaci\'on & Staging aislado & Pre-release \\
|
|
Chaos & Ca\'idas de dependencias & Staging & Mensual \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\caption{Pir\'amide de pruebas IPSExtractor.}
|
|
\end{table}
|
|
|
|
\section{Convenci\'on de identificadores}
|
|
\begin{itemize}
|
|
\item \texttt{UT-<SERVICIO>-<NN>} --- unitarias (riesgo de regresi\'on de dominio)
|
|
\item \texttt{IT-<SERVICIO>-<NN>} --- integraci\'on (contratos HTTP + infra)
|
|
\item \texttt{E2E-<NN>} --- end-to-end de negocio
|
|
\item \texttt{ST-<AREA>-<NN>} --- estr\'es / carga (capacidad y SLO)
|
|
\item \texttt{CH-<NN>} --- chaos / resiliencia
|
|
\end{itemize}
|
|
|
|
\section{C\'omo leer un caso del cat\'alogo}
|
|
Para cada ID: \textbf{caso} (qu\'e se hace) + \textbf{criterio} (c\'omo pasa) +
|
|
\textbf{riesgo cubierto} (por qu\'e importa). Los resultados medidos viven en el
|
|
\emph{Informe de Pruebas}; el modelo de volumen en \emph{Capacidad 100k}.
|
|
|
|
\section{Entornos}
|
|
\begin{description}
|
|
\item[local] Mocks de LLM, Imaging y MinIO (moto/LocalStack).
|
|
\item[ci] Unitarios + smoke Compose (\texttt{/health/live}).
|
|
\item[staging] Stack completo + MinIO staging + LLM con cuota; Imaging solo con VPN de prueba.
|
|
\item[stress] Igual que staging, sin usuarios reales; datos sint\'eticos.
|
|
\end{description}
|
|
|
|
\section{Mocks vs sistemas reales}
|
|
\begin{table}[h]
|
|
\centering
|
|
\begin{tabular}{@{}lcccc@{}}
|
|
\toprule
|
|
\textbf{Dependencia} & \textbf{Unit/CI} & \textbf{Integr.} & \textbf{Estr\'es} & \textbf{E2E} \\
|
|
\midrule
|
|
PostgreSQL & SQLite/TC & Real & Real & Real \\
|
|
Redis & Mock/TC & Real & Real & Real \\
|
|
MinIO & moto/LS & LocalStack & Staging & Staging \\
|
|
LLM & Fake HTTP & Fake & Fake+1 real & Real \\
|
|
Imaging & Mock & Mock & N/A & Real \\
|
|
Chrome & Mock & Mock & N/A & Real \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\caption{TC = Testcontainers; LS = LocalStack.}
|
|
\end{table}
|
|
|
|
\section{Principios}
|
|
\begin{enumerate}
|
|
\item Un caso = un objetivo verificable (assert expl\'icito).
|
|
\item Datos de prueba versionados (fixtures), no datos de producci\'on.
|
|
\item Interpretar p95 altos junto con \texttt{free -h} / \texttt{docker stats} en shared8g.
|
|
\item Documentar entorno en cada informe de ejecuci\'on.
|
|
\end{enumerate}
|