<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: alexrai</title>
    <description>The latest articles on DEV Community by alexrai (@alexai).</description>
    <link>https://dev.to/alexai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3577277%2Fa183f93b-7709-4c13-8bca-a83a60e5b54b.png</url>
      <title>DEV Community: alexrai</title>
      <link>https://dev.to/alexai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexai"/>
    <language>en</language>
    <item>
      <title>Mockeamos la API de un proveedor para salvar el CI, y el mock nos mintió</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Mon, 16 Nov 2026 05:54:34 +0000</pubDate>
      <link>https://dev.to/alexai/mockeamos-la-api-de-un-proveedor-para-salvar-el-ci-y-el-mock-nos-mintio-f3k</link>
      <guid>https://dev.to/alexai/mockeamos-la-api-de-un-proveedor-para-salvar-el-ci-y-el-mock-nos-mintio-f3k</guid>
      <description>&lt;p&gt;Era martes. La ejecución de GitHub Actions llevaba unos 40 minutos cuando la suite de integración murió con el mismo error por tercera vez esa mañana:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FetchError: request to https://sandbox.&amp;lt;proveedor&amp;gt;.com/v1/rates failed
  status: 429 Too Many Requests
  retry-after: 3600
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nuestro proveedor de tarifas de envío limita su sandbox a 1.000 llamadas al día por clave. Éramos cuatro desarrolladores, una clave compartida y una suite que hacía unas 180 llamadas por ejecución. Con seis pushes y un par de reintentos, la cuota se acababa antes de comer.&lt;/p&gt;

&lt;p&gt;Esa semana perdimos casi dos días de sprint con un pipeline en rojo que nadie podía arreglar, porque en realidad no había nada roto. Al mes siguiente descubrimos que el proveedor también cobra el exceso de llamadas al sandbox. Unos 340 dólares por el privilegio de fallar nuestros propios tests.&lt;/p&gt;

&lt;p&gt;Así que montamos un mock server. Arregló el pipeline. Y cinco semanas después dejó pasar un bug real hasta producción. Las dos mitades de la historia merecen contarse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lo que necesitábamos de verdad
&lt;/h2&gt;

&lt;p&gt;No quería una librería de mocks repartida por los archivos de test. Ya lo habíamos hecho en un proyecto anterior con &lt;code&gt;nock&lt;/code&gt; y cada test acabó con su propia versión, ligeramente distinta, de lo que devolvía el proveedor. Cambiar un endpoint significaba tocar 30 archivos.&lt;/p&gt;

&lt;p&gt;Quería algo aburrido: un servidor HTTP local con las mismas rutas que el proveedor, que devuelva JSON grabado y que se active con una sola variable de entorno. El código de la aplicación no debería enterarse.&lt;/p&gt;

&lt;p&gt;Si alguien de tu equipo no tiene claro el concepto, yo pasé por el canal interno &lt;a href="https://keploy.io/blog/community/mock-server" rel="noopener noreferrer"&gt;la guía de Keploy sobre mock servers&lt;/a&gt;. Explica la diferencia entre hacer stubs dentro de un test y levantar un servidor aparte, que era justo la discusión que teníamos cada semana.&lt;/p&gt;

&lt;h2&gt;
  
  
  Son unas 30 líneas
&lt;/h2&gt;

&lt;p&gt;Sin framework. El módulo &lt;code&gt;http&lt;/code&gt; de Node es suficiente.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// mock-server.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'node:http'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'node:fs'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'node:path'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;fixtures&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s1"&gt;'POST /v1/rates'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'rates-ok.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'GET /v1/shipments/shp_123'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'shipment.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`${req.method} ${url.pathname}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fixtures&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;'content-type'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`no fixture for ${key}`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'fixtures'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;'content-type'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;MOCK_PORT&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;4010&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`mock listening on ${server.address().port}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Los fixtures eran respuestas reales que capturé del sandbox con &lt;code&gt;curl&lt;/code&gt;. En CI, el workflow arranca el mock en segundo plano y apunta la aplicación hacia él:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node mock-server.js &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
&lt;span class="nv"&gt;VENDOR_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:4010 npm &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;El 404 con el nombre de la ruta resultó ser la línea más útil del archivo. Cuando alguien añade una llamada nueva y se olvida del fixture, el fallo le dice exactamente qué falta en lugar de quedarse colgado hasta el timeout.&lt;/p&gt;

&lt;p&gt;Esa suite pasó de unos 40 minutos (casi todo reintentos y esperas) a menos de uno. Las llamadas al sandbox desde CI bajaron a cero y el cargo extra desapareció de la factura.&lt;/p&gt;

&lt;p&gt;Durante cinco semanas pensé que habíamos terminado.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dónde me equivoqué
&lt;/h2&gt;

&lt;p&gt;El proveedor cambió su endpoint de tarifas. El campo &lt;code&gt;amount&lt;/code&gt;, un decimal en euros, pasó a ser &lt;code&gt;amount_cents&lt;/code&gt;, un entero. Lo anunciaron en un correo de novedades que llegó a un buzón compartido que nadie lee.&lt;/p&gt;

&lt;p&gt;Nuestros fixtures seguían teniendo &lt;code&gt;amount&lt;/code&gt;. Nuestros tests seguían pasando. Claro que pasaban: estaban probando contra una foto de la API de hacía mes y medio.&lt;/p&gt;

&lt;p&gt;En producción, &lt;code&gt;rate.amount&lt;/code&gt; llegó como &lt;code&gt;undefined&lt;/code&gt;. El checkout mostró el envío como "NaN €" durante unas tres horas de un día laborable, hasta que nos llegó un ticket de soporte.&lt;/p&gt;

&lt;p&gt;Eso fue culpa mía. Traté los fixtures como algo terminado cuando en realidad son una caché, y las cachés caducan. Un mock te dice que tu código maneja bien una respuesta concreta. No te dice nada sobre si esa respuesta sigue existiendo.&lt;/p&gt;

&lt;h2&gt;
  
  
  La comprobación nocturna
&lt;/h2&gt;

&lt;p&gt;La solución no fue tirar el mock. Fue añadir un job pequeño que, una vez cada noche, compara la forma del fixture con lo que devuelve el sandbox en ese momento. Gasta un puñado de llamadas, no 180 por push.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// check-drift.js (Node 18+, usa fetch global)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;fixture&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'./fixtures/rates-ok.json'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'object'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`${prefix}${k}.`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sb"&gt;`${prefix}${k}`&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${process.env.SANDBOX_URL}/v1/rates`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${process.env.SANDBOX_KEY}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s1"&gt;'content-type'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'28001'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'08001'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;weight_g&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;liveKeys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;missing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fixture&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;liveKeys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;missing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'el fixture tiene campos que la API ya no devuelve:'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;missing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'el fixture coincide con la API real'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Es tosco. Solo mira nombres de campos, no tipos, y trata los arrays como hojas. Pero habría detectado el cambio de &lt;code&gt;amount&lt;/code&gt; a la mañana siguiente, y ese era el listón. Corre a las 2 de la madrugada y avisa por Slack si falla.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lo que le diría a un compañero que empieza hoy
&lt;/h2&gt;

&lt;p&gt;Graba los fixtures desde respuestas reales. No los escribas a mano a partir de la documentación. La documentación miente más que los sandboxes.&lt;/p&gt;

&lt;p&gt;Mantén el mock tonto. En cuanto empieza a tener lógica ("si el peso supera 10 kg devuelve este otro fixture") estás manteniendo una segunda versión, peor, de la API del proveedor. Si de verdad necesitas respuestas que dependan del estado o de la petición, eso ya es &lt;a href="https://keploy.io/blog/community/what-is-api-simulation" rel="noopener noreferrer"&gt;simulación de APIs&lt;/a&gt; y conviene tratarlo como un proyecto aparte, no como un &lt;code&gt;if&lt;/code&gt; más dentro del mock.&lt;/p&gt;

&lt;p&gt;Yo no mockearía todo. La base de datos, por ejemplo, la sigo levantando de verdad en un contenedor, porque ahí los mocks esconden justo los fallos que más duelen.&lt;/p&gt;

&lt;p&gt;Y ponle nombre y apellido al correo de novedades del proveedor. Ese correo fue la causa real del incidente, y ninguna herramienta arregla un buzón que nadie abre.&lt;/p&gt;

&lt;p&gt;El mock nos dio velocidad. La comprobación nocturna nos devolvió la confianza que habíamos entregado sin darnos cuenta para conseguirla.&lt;/p&gt;

</description>
      <category>spanish</category>
      <category>testing</category>
      <category>node</category>
      <category>api</category>
    </item>
    <item>
      <title>Our checkout tests were green for six weeks. Checkout was broken for two of them.</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Mon, 09 Nov 2026 11:27:51 +0000</pubDate>
      <link>https://dev.to/alexai/our-checkout-tests-were-green-for-six-weeks-checkout-was-broken-for-two-of-them-23pg</link>
      <guid>https://dev.to/alexai/our-checkout-tests-were-green-for-six-weeks-checkout-was-broken-for-two-of-them-23pg</guid>
      <description>&lt;p&gt;Last spring I spent a Thursday afternoon explaining to our support lead why customers in Ontario couldn't finish a purchase while our CI dashboard showed nothing but green. It wasn't a fun conversation, and it changed how I think about what a test is supposed to prove.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we were actually testing
&lt;/h2&gt;

&lt;p&gt;Our checkout service had decent coverage. Around 80% line coverage, a few hundred unit tests, and a pipeline that ran in under four minutes. The tax calculation module alone had 40 tests. Every one of them passed.&lt;/p&gt;

&lt;p&gt;The problem was that those tests checked functions, not behavior. &lt;code&gt;calculateTax()&lt;/code&gt; returned the right number for every province we fed it. What nobody had checked was whether the checkout endpoint ever called &lt;code&gt;calculateTax()&lt;/code&gt; with the province the customer actually selected. After a refactor of the address form, the frontend started sending the province as a two-letter code in a field called &lt;code&gt;region&lt;/code&gt; instead of &lt;code&gt;province&lt;/code&gt;. The backend quietly fell back to a default, the default had no tax rule for Ontario, and order validation rejected the total.&lt;/p&gt;

&lt;p&gt;Every unit test was correct. The feature was not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The question I started asking
&lt;/h2&gt;

&lt;p&gt;After that week I started asking one question before writing any test: if this passes, what does a user get to do?&lt;/p&gt;

&lt;p&gt;For a unit test the answer is usually "nothing directly." It proves a piece works in isolation. That's useful, but it isn't the thing the customer cares about. A functional test answers a different question: given this input at the edge of the system, does the system produce the output the requirement describes? If you want a longer breakdown of how that differs from other layers, this write-up on &lt;a href="https://keploy.io/blog/community/functional-testing-an-in-depth-overview" rel="noopener noreferrer"&gt;functional testing&lt;/a&gt; covers the main types and where each one fits. The short version that stuck with me is that a functional test doesn't care how the code is organized. It cares whether the behavior matches the spec.&lt;/p&gt;

&lt;p&gt;So for checkout, the functional test isn't "does calculateTax return 13% for ON." It's "when a customer with an Ontario address submits a cart, do they get an order confirmation with the correct total."&lt;/p&gt;

&lt;h2&gt;
  
  
  How we rebuilt the suite
&lt;/h2&gt;

&lt;p&gt;We didn't throw away the unit tests. We added a thin layer above them, and I want to be specific about what it looked like, because "add functional tests" is advice that sounds obvious and gets ignored.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start from the requirement doc, not the code
&lt;/h3&gt;

&lt;p&gt;I pulled up the original ticket for checkout and listed every sentence with the word "should" in it. There were 23. Things like "the customer should see shipping options based on their postal code" and "a cart with a discontinued item should fail with a clear message." Each of those became a test case. Some needed three or four variations (different provinces, empty cart, expired coupon). We ended up with about 60 cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hit the API, not the functions
&lt;/h3&gt;

&lt;p&gt;Our checkout is a set of REST endpoints, so most of the new tests sent real HTTP requests to a running instance of the service with a seeded database. This is where &lt;a href="https://keploy.io/blog/community/api-functional-testing" rel="noopener noreferrer"&gt;API functional testing&lt;/a&gt; earns its keep. You're validating the contract the frontend actually depends on: field names, status codes, error shapes, and the business result. The &lt;code&gt;region&lt;/code&gt; vs &lt;code&gt;province&lt;/code&gt; bug would have failed on the very first run because the response total would have been wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  Assert on outcomes a person would notice
&lt;/h3&gt;

&lt;p&gt;I made a rule that every functional test had to assert on at least one thing a person would see. Order total. Error message text. Whether an email job got queued. Asserting only on a 200 status code isn't a functional test, it's a ping.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it cost us
&lt;/h2&gt;

&lt;p&gt;More than I expected at first. The functional suite took about 9 minutes to run, which more than doubled our pipeline time. We had flaky failures for the first two weeks because our seed data had timestamps that drifted. We fixed that by freezing time in the test environment.&lt;/p&gt;

&lt;p&gt;Maintenance was the bigger cost. Writing request payloads and expected responses by hand for 60 cases is tedious, and every time the API changed someone had to update a pile of JSON. We tried a few approaches: hand-written pytest suites using &lt;code&gt;requests&lt;/code&gt;, Pact for the contract between frontend and backend, and a record-and-replay tool (Keploy) that captures real traffic and turns it into test cases. I'm not going to tell you one of them is right, because it depended on the endpoint. Pact was great for the frontend contract. Recorded traffic was great for the gnarly endpoints with big nested payloads that nobody wanted to write by hand. Plain pytest stayed best for edge cases we had to construct on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed afterward
&lt;/h2&gt;

&lt;p&gt;In the eight months since, the functional suite has caught 11 bugs before they shipped. I counted. Seven of them had the same shape as the Ontario bug: every unit passed and the wiring between them was wrong. Two were config issues that only showed up when the service read real environment variables. Two were me.&lt;/p&gt;

&lt;p&gt;It also changed code review. When someone opens a PR now, the reviewer asks "which functional case covers this?" If the answer is none, either we add one or we write down why it doesn't need one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell my past self
&lt;/h2&gt;

&lt;p&gt;Coverage percentage told me how much code ran during tests. It never told me whether a customer could buy something. Those are different numbers, and I spent a long time treating them as the same one.&lt;/p&gt;

&lt;p&gt;If your suite is mostly unit tests and you've never had an incident like ours, you might just be lucky. Pick your most important user flow, write down what it should do in plain sentences, and turn each sentence into a test that goes through the front door. You'll find out quickly whether your green dashboard means what you think it means.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>qa</category>
      <category>api</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Our mocks were lying to us for four months</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Mon, 02 Nov 2026 05:56:27 +0000</pubDate>
      <link>https://dev.to/alexai/our-mocks-were-lying-to-us-for-four-months-3o76</link>
      <guid>https://dev.to/alexai/our-mocks-were-lying-to-us-for-four-months-3o76</guid>
      <description>&lt;p&gt;I want to talk about a specific kind of green build. The kind where 612 tests pass in 38 seconds, the coverage badge says 87%, and the thing is broken in production.&lt;/p&gt;

&lt;p&gt;We had that build for most of a quarter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;We run a small logistics product. One of our TypeScript services talks to a third-party carrier API to fetch rates, book shipments, and pull tracking updates. When we built that integration, a colleague recorded a bunch of real responses, saved them as JSON fixtures, and wired them into our tests with nock. Fast, deterministic, easy to read. Everyone liked it.&lt;/p&gt;

&lt;p&gt;That was in January.&lt;/p&gt;

&lt;h2&gt;
  
  
  How drift actually happens
&lt;/h2&gt;

&lt;p&gt;Nobody decides to let mocks go stale. It happens in tiny steps.&lt;/p&gt;

&lt;p&gt;The carrier added an optional &lt;code&gt;surcharges&lt;/code&gt; array to rate responses. Our fixtures didn't have it, so our code never learned about it. Nothing broke. Yet.&lt;/p&gt;

&lt;p&gt;Then they started returning &lt;code&gt;estimated_delivery&lt;/code&gt; as a date-only string (&lt;code&gt;2026-03-14&lt;/code&gt;) for some ground services instead of a full timestamp. Our code did &lt;code&gt;new Date(value)&lt;/code&gt; and formatted it in the user's timezone. For anyone west of UTC, the delivery date showed up a day early. That one sat in prod for weeks, because who double checks whether "Thursday" should say "Friday"?&lt;/p&gt;

&lt;p&gt;Then the big one. In April they moved tracking events behind pagination. The first call returned 20 events and a &lt;code&gt;next_cursor&lt;/code&gt;. Our fixture had 6 events and no cursor, because the shipment we'd recorded back in January was a short one. In production, long-haul shipments stopped showing their latest status. Customers saw "In transit, Memphis" for packages that had been delivered two days earlier.&lt;/p&gt;

&lt;p&gt;Every one of our tests passed through all of this. They were testing our code against January's API.&lt;/p&gt;

&lt;h2&gt;
  
  
  The afternoon I diffed everything
&lt;/h2&gt;

&lt;p&gt;After the tracking complaint landed in our support channel ("customer says delivered, app says Memphis, again"), I blocked out an afternoon and did something slightly tedious. I wrote a throwaway script that sent the same requests behind each of our 34 fixtures to the carrier's sandbox, then diffed the real response shape against the saved one. Keys and types only, not values.&lt;/p&gt;

&lt;p&gt;11 of 34 had drifted. Most trivially, a new optional field here and there. Three in ways that changed behavior.&lt;/p&gt;

&lt;p&gt;I pasted the diff output in our team channel with no comment. Someone replied with the skull emoji, which was fair.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where unit tests stop being useful
&lt;/h2&gt;

&lt;p&gt;I don't think the lesson is "mocks bad". Our mocked unit tests were doing their actual job: given input X, does this function produce Y. The problem was that we were treating them as proof that our service worked with the carrier. They can't be that. A mock is a claim about someone else's system, and nobody was checking the claim.&lt;/p&gt;

&lt;p&gt;That's the boring core of the whole &lt;a href="https://keploy.io/blog/community/unit-testing-vs-integration-testing-a-comprehensive-guide" rel="noopener noreferrer"&gt;unit testing vs integration testing&lt;/a&gt; argument, at least as I understand it now. A unit test isolates your code so you can trust its logic. An integration test puts your code next to the real dependency so you can trust the connection. You want both, and the trap is letting the fast, pleasant one stand in for the slow, annoying one.&lt;/p&gt;

&lt;p&gt;We'd let the fast one stand in for everything.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we do now
&lt;/h2&gt;

&lt;p&gt;Nothing dramatic. Three changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  A nightly drift check
&lt;/h3&gt;

&lt;p&gt;That throwaway diff script became a nightly job. It hits the sandbox, compares response shapes to our fixtures, and posts to Slack if anything moved. It doesn't fail the build, because the sandbox is flaky enough that we'd be crying wolf twice a week. But we now see drift within a day instead of within a quarter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Re-recording fixtures instead of hand-editing them
&lt;/h3&gt;

&lt;p&gt;When drift showed up, we used to open the JSON and patch it by hand. That's how the January fixtures had turned into a weird hybrid of real and imagined responses. Now we re-record from the sandbox and commit the new file, so the PR diff shows exactly what changed upstream. Reviewers actually read those diffs, which surprised me.&lt;/p&gt;

&lt;p&gt;Some teams push this further and record production traffic directly, then replay it as tests with dependencies mocked from the same recording. Keploy works roughly that way. We're not there yet, but fixtures that can't drift because they're re-captured from reality is a nice idea.&lt;/p&gt;

&lt;h3&gt;
  
  
  A thin layer of real calls
&lt;/h3&gt;

&lt;p&gt;We added a handful of &lt;a href="https://keploy.io/blog/community/integration-testing-a-comprehensive-guide" rel="noopener noreferrer"&gt;integration tests&lt;/a&gt; that run against the carrier sandbox on every PR that touches the carrier client. Seven of them. They book a shipment, fetch rates for three service levels, and pull tracking for a sandbox shipment with enough events to force pagination. About 40 seconds total, mostly because the sandbox is slow. We gate them on file paths so they don't run on unrelated changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things I got wrong along the way
&lt;/h2&gt;

&lt;p&gt;My first instinct was to replace all the nock mocks with sandbox calls. I got about halfway before the suite went from 38 seconds to just over six minutes and started failing randomly whenever the sandbox hiccuped. A teammate asked, very politely, whether I was trying to get people to stop running tests locally. I reverted most of it.&lt;/p&gt;

&lt;p&gt;The other mistake: I assumed the carrier would loudly announce breaking changes. They did, kind of. Two of the three were on a changelog page I didn't know existed. The pagination change went out by email to an address belonging to someone who left the company last year. Go check where your vendors' notices actually land. I'll wait.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where we ended up
&lt;/h2&gt;

&lt;p&gt;612 unit tests, still mocked, still fast. Seven integration tests against the sandbox. One nightly drift check. Extra CI time on a relevant PR is under a minute.&lt;/p&gt;

&lt;p&gt;The pagination test would have caught the tracking bug on its first run. The nightly diff would have flagged the date format the morning after it changed. Not perfect. Still a lot better than finding out from a customer whose package is apparently stuck in Memphis forever.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>api</category>
      <category>devops</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A 200 OK Is Not a Working Feature</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Thu, 29 Oct 2026 08:43:34 +0000</pubDate>
      <link>https://dev.to/alexai/a-200-ok-is-not-a-working-feature-53lk</link>
      <guid>https://dev.to/alexai/a-200-ok-is-not-a-working-feature-53lk</guid>
      <description>&lt;p&gt;For a few weeks, a bunch of posts on our company blog were broken and nobody knew.&lt;/p&gt;

&lt;p&gt;Pages loaded fine. Server said 200 every time. But inside them there were blank boxes where images should've been, and internal links that went straight to 404s. Nothing threw an error, so nothing alerted anyone. We only found it during an SEO audit. Not from tests, not from readers. Readers just saw the blank boxes, clicked a dead link, and left.&lt;/p&gt;

&lt;p&gt;Everything "worked". It just didn't do what it was supposed to.&lt;/p&gt;

&lt;p&gt;That bug changed how I look at every "green" check, and the same pattern shows up anywhere a page talks to an API. Picture a "book a demo" form. You fill it in, click submit, get the little success state, and the network tab says 200. But a field got renamed on one side and not the other, so the endpoint politely accepted the request, dropped the data it didn't recognize, and said OK. The lead never reaches sales. No errors, no alerts, and every check that only looks at status codes stays green.&lt;/p&gt;

&lt;p&gt;I'll use that form as the example for the rest of this post, because it's the kind of thing that's easy to test and easy to test badly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I mean by "functional"
&lt;/h2&gt;

&lt;p&gt;I'm not a QA engineer. I work close to the product and the website, the part where real people show up, so I mostly see bugs from the user's side. And from that side the definition is pretty simple: functional testing is checking that the thing actually does what someone needs it to do, not just that it runs without crashing.&lt;/p&gt;

&lt;p&gt;The demo form's job wasn't "accept a POST". Its job was "get this person a call with us". Everything between the click and a sales rep seeing the lead is part of the feature. If any piece of that chain drops the ball, the feature is broken, even if every single piece returns 200.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it lines up against the other test types
&lt;/h2&gt;

&lt;p&gt;Quick version, because you've seen the diagrams:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unit tests&lt;/strong&gt; check one function or component on its own. Fast, cheap, and blind to anything outside their box.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration tests&lt;/strong&gt; check that two or more parts talk to each other. Service to database, frontend to API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Functional tests&lt;/strong&gt; check behavior against a requirement, from the outside. Black box. "When a visitor submits the form, sales gets a lead."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-functional tests&lt;/strong&gt; check how well it runs: speed, load, security, accessibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My take: the line between integration and functional isn't about how many services the test touches. It's about where the assertion comes from. If it comes from the code ("the endpoint returned 200"), it's an integration check. If it comes from the requirement ("a lead exists and the visitor saw a confirmation"), it's functional. Same tooling, different question.&lt;/p&gt;

&lt;p&gt;I'm not going to do the whole family tree of smoke, sanity, regression, UAT and friends, with one-line definitions nobody remembers. If you want the full map of &lt;a href="https://keploy.io/blog/community/functional-testing-an-in-depth-overview" rel="noopener noreferrer"&gt;what functional testing covers&lt;/a&gt;, types and process included, that write-up is a better reference than anything I'd squeeze in here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where these bugs come from (in my experience)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Contracts that drift.&lt;/strong&gt; Frontend and backend agree on a shape, then one side changes. Nothing crashes, because most APIs are polite and ignore fields they don't know. Polite is the problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flows that cross boundaries.&lt;/strong&gt; The form lives on the website, the endpoint lives in the app, and the lead lands somewhere else again. Three owners. Each one tests their piece. Nobody tests the trip.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assets and links that rot.&lt;/strong&gt; This was our blog. Images and pages move, the posts keep pointing at where they used to be, and the page still loads fine the whole time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Done" was never written down.&lt;/strong&gt; If nobody says what success looks like, the default becomes "no error". That's how a 200 quietly turns into the definition of working.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mistake I made for too long
&lt;/h2&gt;

&lt;p&gt;Treating "it loads and returns 200" as "it works".&lt;/p&gt;

&lt;p&gt;A 200 response with a broken form or a missing image is still a broken page. I trusted "no errors" for way too long, mostly because checking status codes is fast and it feels like you're doing something.&lt;/p&gt;

&lt;p&gt;The second one: assuming users would tell us. They don't. Nobody emails to say an image is missing. They leave, and the only trace is a session recording nobody's watching.&lt;/p&gt;

&lt;p&gt;These quiet bugs are expensive in a boring way. Stripe's Developer Coefficient report (2018) found developers spend about 3.8 hours a week fixing bad code, out of an average 41.1-hour week. I'd bet a good chunk of that is bugs that sat live for weeks before anyone noticed, because by then you're fixing the code and cleaning up the data it lost.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a functional test for this looks like
&lt;/h2&gt;

&lt;p&gt;Here's what a functional test for that demo form could look like. Playwright with TypeScript. It checks what a visitor and the sales team care about, not just that a request went through.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@playwright/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;demo request actually reaches the team&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/book-a-demo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// the page loading proves nothing, check what a visitor sees&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;brokenImages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;img&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;evaluateAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imgs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;imgs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="nx"&gt;HTMLImageElement&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;naturalWidth&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;brokenImages&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Work email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sam@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Company&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Acme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;leadCall&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;waitForResponse&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;url&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/leads&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Book a demo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;leadCall&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// a 200 isn't the goal, a saved lead and a visible confirmation are&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;toBeTruthy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nx"&gt;leadId&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeTruthy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/we'll be in touch/i&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeVisible&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The image check is the blog lesson baked in. A &lt;code&gt;naturalWidth&lt;/code&gt; of 0 means the browser couldn't render it. Lazy-loaded images below the fold need a scroll first, otherwise you get a pile of false alarms.&lt;/li&gt;
&lt;li&gt;Asserting on &lt;code&gt;leadId&lt;/code&gt; and not just &lt;code&gt;res.ok()&lt;/code&gt; is the whole point. Swap in whatever your endpoint actually returns.&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;getByLabel&lt;/code&gt; and &lt;code&gt;getByRole&lt;/code&gt; from the &lt;a href="https://playwright.dev/docs/locators" rel="noopener noreferrer"&gt;Playwright locator docs&lt;/a&gt; means the test fails if the form stops being usable by its labels, which is kind of a functional check on its own.&lt;/li&gt;
&lt;li&gt;Run it against staging with a test lead that gets cleaned up afterwards, not production. Nobody in sales wants 300 demo requests from &lt;code&gt;sam@example.com&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we actually run today
&lt;/h2&gt;

&lt;p&gt;On the engineering side, our team auto-generates API tests from real traffic and runs them in CI. Real requests get replayed against new builds, so the API is tested against what users actually send, not what we imagined they'd send. That kind of test is good at catching contract drift like a renamed field, because it's built from what real requests look like.&lt;/p&gt;

&lt;p&gt;On the website and content side, a lot is still manual. I check pages myself after releases. Audit tools run for broken links and missing images. And I watch Microsoft Clarity recordings to see where people get stuck or rage-click.&lt;/p&gt;

&lt;p&gt;The traffic-based tests and the manual checks catch different things, which is kind of the point. One tells me the API still behaves the way real requests expect. The other tells me a human can still get from landing on the page to actually getting what they came for.&lt;/p&gt;

&lt;p&gt;For CI, keep the functional suite small and trusted. Google's testing team wrote back in 2016 that about 1.5% of all their test runs reported a flaky result, and almost 16% of their tests had some level of flakiness (&lt;a href="https://testing.googleblog.com/2016/05/flaky-tests-at-google-and-how-we.html" rel="noopener noreferrer"&gt;Google Testing Blog&lt;/a&gt;). If Google can't avoid it, your 40-test suite won't either. Quarantine flaky tests the same day. A suite that cries wolf just trains everyone to hit "re-run".&lt;/p&gt;

&lt;h2&gt;
  
  
  The opinion people argue with me about
&lt;/h2&gt;

&lt;p&gt;Session recordings of real users catch more functional bugs than half the test cases people write.&lt;/p&gt;

&lt;p&gt;Most test cases test what the developer expects. Fill the field correctly, click once, assert. Real users paste emails with a trailing space, double-click submit, open the form in two tabs, hit back halfway through. The test suite didn't know any of that existed. The recordings did.&lt;/p&gt;

&lt;p&gt;But that doesn't mean skip automation. It means use the recordings to decide what to automate next. Every weird thing a recording shows you is a candidate for a test case. And some things you'll only ever catch by using the product like a real person. Honestly, the "automate everything" crowd just hasn't watched enough recordings.&lt;/p&gt;

&lt;p&gt;(Unrelated, but if you've never watched a recording of a stranger using your own site, do it once. It's humbling.)&lt;/p&gt;

&lt;h2&gt;
  
  
  If you're setting this up from scratch
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Write the requirement as a sentence a user would say. "When I book a demo, sales gets my details and I see a confirmation."&lt;/li&gt;
&lt;li&gt;Test that sentence end to end, black box. Assert on outcomes, not status codes.&lt;/li&gt;
&lt;li&gt;Happy path first, then the ways real people go off script: double submits, weird input, the back button, a slow network.&lt;/li&gt;
&lt;li&gt;Automate the stable flows that touch money or leads. Keep humans on the rest.&lt;/li&gt;
&lt;li&gt;Run it in CI on every merge, and watch a handful of real recordings regularly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you take one thing from this: a 200 tells you the server answered. It doesn't tell you the user got what they came for.&lt;/p&gt;

&lt;p&gt;What's the sneakiest "everything returned 200" bug you've shipped, and what finally caught it?&lt;/p&gt;

</description>
      <category>testing</category>
      <category>qa</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Bugs That Live Between Your Services</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Wed, 28 Oct 2026 13:38:53 +0000</pubDate>
      <link>https://dev.to/alexai/the-bugs-that-live-between-your-services-gnn</link>
      <guid>https://dev.to/alexai/the-bugs-that-live-between-your-services-gnn</guid>
      <description>&lt;p&gt;At 2:14 on a Tuesday afternoon, our signup error rate went from basically zero to 31%. It stayed there for nineteen minutes. Nothing was "down," exactly. Some requests worked, some returned a 500, and the dashboards looked like a barcode.&lt;/p&gt;

&lt;p&gt;The cause was a migration I had reviewed and approved that morning. It renamed &lt;code&gt;users.phone&lt;/code&gt; to &lt;code&gt;users.phone_number&lt;/code&gt;. The new code read the new column, the tests passed, and the deploy went out as a rolling update. For nineteen minutes, half our pods were still running the old code, still querying a column that no longer existed.&lt;/p&gt;

&lt;p&gt;Every test in that repo was green. Not one of them ran old code against the new schema, because not one of them touched a real database. I remember staring at the CI page during the incident call, scrolling through all those checkmarks, feeling oddly betrayed by a web page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration testing, minus the textbook
&lt;/h2&gt;

&lt;p&gt;Here's my working definition: an integration test checks that your code and something it doesn't fully control still agree with each other. That "something" might be a database, a broker, another team's service or a config file that only exists in production.&lt;/p&gt;

&lt;p&gt;Unit tests check the logic inside a box. Integration tests check the seams between boxes. If you've never had to separate those two ideas in your head, a longer write-up on &lt;a href="https://keploy.io/blog/community/integration-testing-a-comprehensive-guide" rel="noopener noreferrer"&gt;integration testing&lt;/a&gt; walks through the formal types and terminology. I'll keep this one to what I actually run and why.&lt;/p&gt;

&lt;p&gt;The distinction matters because the failure modes are different. A unit test fails when your logic is wrong. An integration test fails when your &lt;em&gt;assumptions&lt;/em&gt; are wrong, and assumptions are what change quietly while nobody is looking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why my green suite lied to me
&lt;/h2&gt;

&lt;p&gt;That signup repo had over 600 unit tests. The repository layer was mocked in every one of them. So the tests didn't verify that &lt;code&gt;phone_number&lt;/code&gt; existed in Postgres. They verified that our code called a function we had told them to expect. That's a closed loop: the code agreed with the mock because the same person wrote both.&lt;/p&gt;

&lt;p&gt;This is my slightly unpopular opinion: &lt;strong&gt;a mock of your own database is usually a liability, not a test.&lt;/strong&gt; It feels productive because the suite is fast and the coverage number climbs. But the mock encodes what you believe the database does, and your beliefs are the exact thing that needs checking.&lt;/p&gt;

&lt;p&gt;It's getting worse, not better. AI assistants are very good at producing unit tests that agree with the code they just wrote. The 2024 DORA report estimated that as AI adoption went up, delivery stability went down by 7.2%. I don't think AI is the villain there. I think more code is shipping with tests that confirm intent instead of testing reality.&lt;/p&gt;

&lt;p&gt;None of this means unit tests are bad. I still write them for parsing, pricing rules and anything with branching logic. I just stopped treating a green unit suite as evidence that a deploy is safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the bugs were hiding
&lt;/h2&gt;

&lt;p&gt;Looking back at the incidents I've been paged for over the years, almost none were logic bugs. They clustered in four places.&lt;/p&gt;

&lt;h3&gt;
  
  
  Database migrations
&lt;/h3&gt;

&lt;p&gt;The Tuesday story is the classic one. Renaming or dropping a column in the same release as the code change breaks any instance still running the previous version. The fix is boring: expand, migrate, contract. Add the new column, deploy code that writes both and reads the new one, backfill, and drop the old column in a later release.&lt;/p&gt;

&lt;p&gt;What surprised me was how cheap it is to test. Run your migrations against a real database in CI, then run the &lt;em&gt;previous&lt;/em&gt; release's integration tests against the migrated schema. If the old code breaks, your migration isn't safe for a rolling deploy. That single check would have saved my Tuesday.&lt;/p&gt;

&lt;h3&gt;
  
  
  API contracts between services
&lt;/h3&gt;

&lt;p&gt;A billing service once added a new refund status, &lt;code&gt;PARTIALLY_REFUNDED&lt;/code&gt;. Perfectly reasonable change. Our order service had a &lt;code&gt;switch&lt;/code&gt; statement with a &lt;code&gt;default&lt;/code&gt; branch that threw an error, written years earlier by someone who assumed the list was final. Partial refunds started crashing order history pages.&lt;/p&gt;

&lt;p&gt;Both services had great test coverage. Neither had a test that exchanged a real payload with the other.&lt;/p&gt;

&lt;h3&gt;
  
  
  Message queues
&lt;/h3&gt;

&lt;p&gt;Queues hide ordering bugs better than anything else I know. We had &lt;code&gt;OrderCreated&lt;/code&gt; and &lt;code&gt;OrderCancelled&lt;/code&gt; events landing on different partitions, so occasionally the cancel was consumed first. The consumer ignored a cancel for an unknown order, then happily created the order a few milliseconds later. Customers got charged for orders they had cancelled.&lt;/p&gt;

&lt;p&gt;You won't find that with a mocked broker, because the mock delivers messages in the order you publish them. A real broker doesn't promise that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Config and environment
&lt;/h3&gt;

&lt;p&gt;Short one. CI ran in UTC. One production image had &lt;code&gt;TZ&lt;/code&gt; set to a local zone by a base image we inherited. A "same day" check on refunds was off by one for a few hours every night. Integration tests that run on the same image you ship catch this. Tests that run on a developer laptop don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I set it up now
&lt;/h2&gt;

&lt;p&gt;My rule is: &lt;strong&gt;if my team owns it or deploys it, it runs for real in the test. If someone else owns it, I stub it at the network boundary.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That means Postgres, Redis and the message broker run in containers during the test run. A partner's payment API or an email provider gets an HTTP-level stub, and I refresh those stubs from real recorded responses every so often so they don't drift into fiction.&lt;/p&gt;

&lt;p&gt;Here's the shape of a test I'd write today. It checks something a mock can't: that a unique, case-insensitive email constraint actually exists in the real schema after migrations run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PostgreSqlContainer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@testcontainers/postgresql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;supertest&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;buildServer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;runMigrations&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/db&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST /signup&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;beforeAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;pg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PostgreSqlContainer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;postgres:16&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;runMigrations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getConnectionUri&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;buildServer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;dbUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;pg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getConnectionUri&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="nx"&gt;_000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;afterAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rejects a duplicate email when only the casing differs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/signup&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dana@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/signup&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Dana@Example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;409&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few things that keep this kind of suite usable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One container per test file, not per test.&lt;/strong&gt; Startup is the expensive part. Each test creates its own rows with unique IDs instead of truncating tables, so tests can run in parallel without stepping on each other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Migrations run from zero on every CI run.&lt;/strong&gt; If a migration only works on a database that already has last month's data, you want to know before production does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration tests run on every pull request.&lt;/strong&gt; Not nightly. A nightly suite becomes a dashboard nobody opens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The CI image matches the production image.&lt;/strong&gt; Same base, same timezone, same locale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For service-to-service contracts, I don't spin up the whole fleet. That path leads to a 40-minute suite and a shared staging environment everyone is afraid to touch. Instead, the consumer keeps a small set of real payloads it depends on, checked into its repo, and the producer's CI replays them against its own API on every change. When billing adds a new refund status, billing's build goes red first, before the order service ever sees the payload. It's not glamorous, but it moves the argument to the pull request instead of the incident channel.&lt;/p&gt;

&lt;p&gt;Then there's flakiness, which kills more integration suites than slowness does. Google's testing team reported back in 2016 that almost 16% of their tests showed some level of flakiness. If Google can't avoid it at their scale, you won't either, so plan for it.&lt;/p&gt;

&lt;p&gt;My policy: a flaky test gets quarantined the same day, with an owner and a date. No silent retries. A retry policy turns a real race condition into a test that "sometimes needs a second run," and that's how the ordering bug above survived for a month on a team I worked with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistakes I've made (so far)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Shipping a schema change and its code in one PR.&lt;/strong&gt; Covered above, but it deserves the top spot because I did it more than once before it stuck.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trusting a hand-written mock of a partner API for over a year.&lt;/strong&gt; The partner had changed their error format twice in that time. Our mock still returned the old shape, and our retry logic never fired in production because it was looking for a field that no longer existed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One giant seed file shared by every test.&lt;/strong&gt; Somebody would tweak a row for their test and three unrelated tests would fail. We spent more time fixing fixtures than writing features. Per-test data, created inside the test, ended that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measuring the wrong thing.&lt;/strong&gt; For a while we celebrated line coverage. It went up every sprint while incidents stayed flat. Once we started tracking "which incidents would an integration test have caught," the answer was most of them, and priorities shifted fast.&lt;/p&gt;

&lt;p&gt;This isn't a new lesson for the industry, either. A NIST study back in 2002 estimated that software bugs cost the US economy about $59.5 billion a year, and that roughly $22 billion of that could be avoided with better testing infrastructure that caught defects earlier. The numbers are old. The pattern isn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one habit worth stealing
&lt;/h2&gt;

&lt;p&gt;If you change one thing this sprint, make it this: before your next schema change ships, run the previous version of your service against the new schema in CI. It takes an afternoon to set up, and it turns the scariest kind of deploy into a boring one.&lt;/p&gt;

&lt;p&gt;I'm curious what's bitten you. What's the worst bug you've shipped that only existed &lt;em&gt;between&lt;/em&gt; two systems, and what test would have caught it? Drop it in the comments. I collect these.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>backend</category>
      <category>microservices</category>
      <category>devops</category>
    </item>
    <item>
      <title>Top automation testing tools worth your time in 2026</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Mon, 19 Oct 2026 06:02:06 +0000</pubDate>
      <link>https://dev.to/alexai/top-automation-testing-tools-worth-your-time-in-2026-1gag</link>
      <guid>https://dev.to/alexai/top-automation-testing-tools-worth-your-time-in-2026-1gag</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fds276dzvidai4cjr22cs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fds276dzvidai4cjr22cs.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;br&gt;
A few years back, choosing a test tool was simple. You picked Selenium, you complained about Selenium, and you got on with your week. That world is gone. Today there are so many options that finding a tool is the easy part. The hard part is picking one that won't quietly eat six months of your team's time.&lt;/p&gt;

&lt;p&gt;I've used most of the tools below on real projects. Some were a joy. A couple made me question my career choices. This list is the honest version of what I learned: what each tool is actually good at, where it struggles, and who should bother with it.&lt;/p&gt;

&lt;p&gt;One thing worth saying up front. Most roundups throw UI, API, mobile and performance tools into one pile and rank them like they compete with each other. They don't. Comparing Cypress to JMeter is like comparing a screwdriver to a ladder. I'll tell you which layer each tool covers so you can skip what doesn't apply. And if your work lives mostly on the backend, this deeper guide to &lt;a href="https://keploy.io/blog/community/api-testing-tools" rel="noopener noreferrer"&gt;automation testing tools&lt;/a&gt; built for APIs is worth a read alongside this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a good automation tool actually does for you
&lt;/h2&gt;

&lt;p&gt;At its core, test automation is about getting a machine to repeat the boring checks so humans can focus on the interesting ones. Clicking through a login flow fifty times a day is not a good use of anyone's brain. A script can do it in seconds, every time code changes, without getting bored or skipping a step on a Friday afternoon.&lt;/p&gt;

&lt;p&gt;But "runs tests" is a low bar. The tools that earn a permanent spot in a team's stack usually do three things well. They make tests easy to write, so people actually write them. They make failures easy to understand, so nobody spends an hour figuring out why a build went red. And they keep flaky tests to a minimum, because nothing kills trust in a test suite faster than random failures.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I put this list together
&lt;/h2&gt;

&lt;p&gt;I didn't rank these by GitHub stars or marketing budgets. I looked at how each tool holds up after the honeymoon period: once the suite has a few hundred tests, once new people join the team, once the app changes shape. Community size, documentation, CI support and the cost of maintenance all mattered more to me than a flashy feature list.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tools worth knowing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Selenium
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; web UI&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.selenium.dev" rel="noopener noreferrer"&gt;Selenium&lt;/a&gt; is the grandparent of browser automation, and it's still everywhere. It supports almost every language you could want (Java, Python, C#, JavaScript, Ruby) and every major browser. If you work at a large company with an older test suite, odds are good it runs on Selenium.&lt;/p&gt;

&lt;p&gt;Its age is both its strength and its weakness. The community is huge and you'll find an answer to nearly any problem. But you'll also write more setup code than with newer tools, and handling waits properly takes discipline. Teams that treat Selenium casually tend to end up with flaky suites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; large teams with mixed language stacks, or anyone maintaining an existing Selenium suite.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Playwright
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; web UI (plus some API testing)&lt;/p&gt;

&lt;p&gt;If I were starting a web project from scratch today, &lt;a href="https://playwright.dev" rel="noopener noreferrer"&gt;Playwright&lt;/a&gt; would be my first pick. Built by Microsoft, it drives Chromium, Firefox and WebKit from a single API, and it waits for elements automatically, which removes a whole category of flaky tests.&lt;/p&gt;

&lt;p&gt;The trace viewer alone is worth the switch. When a test fails in CI, you get a step-by-step replay with screenshots, network calls and console logs. Debugging stops feeling like detective work. It supports JavaScript, TypeScript, Python, Java and .NET.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; new web projects and teams tired of fighting flaky UI tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Cypress
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; web UI (frontend focused)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cypress.io" rel="noopener noreferrer"&gt;Cypress&lt;/a&gt; runs right inside the browser, which gives it a very different feel. You watch your tests run in real time and can click back through each step to see exactly what the page looked like. Frontend developers tend to love it because it fits naturally into how they already work.&lt;/p&gt;

&lt;p&gt;The trade-offs are real, though. It's JavaScript and TypeScript only, and some scenarios, like juggling multiple browser tabs, take workarounds. For a frontend team testing its own app, those limits rarely matter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; JavaScript-heavy frontend teams who want fast feedback while they build.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Appium
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; mobile&lt;/p&gt;

&lt;p&gt;&lt;a href="https://appium.io" rel="noopener noreferrer"&gt;Appium&lt;/a&gt; is the go-to open-source choice for automating native, hybrid and mobile web apps on both Android and iOS. It uses the WebDriver protocol, so anyone with Selenium experience will feel at home quickly.&lt;/p&gt;

&lt;p&gt;Be warned that mobile automation is slower and fussier than web testing by nature. Device setup, emulators and real-device farms all add friction. Appium handles the hard parts as well as anything does, but budget time for setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; teams that need one framework across Android and iOS.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Keploy
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; API and integration&lt;/p&gt;

&lt;p&gt;&lt;a href="https://keploy.io" rel="noopener noreferrer"&gt;Keploy&lt;/a&gt; takes a different approach from the script-first tools on this list. Instead of asking you to hand-write every API test, it records real traffic hitting your application and turns those calls into test cases, along with mocks for the databases and services they depend on. Because it works at the network level using eBPF, you don't need to change your application code to get started.&lt;/p&gt;

&lt;p&gt;The practical benefit is coverage you'd never get around to writing manually. Edge cases that real users trigger end up in your suite automatically. It's open source and fits into CI pipelines without much ceremony.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; backend teams who want solid API and integration coverage without writing every test by hand.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Karate
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; API (with UI and performance add-ons)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://karatelabs.io" rel="noopener noreferrer"&gt;Karate&lt;/a&gt; lets you write API tests in a plain, readable syntax that looks a lot like Gherkin. You don't need to be a strong programmer to write a decent test, which makes it popular with QA teams that include non-developers. It can also handle UI automation and, through its Gatling integration, performance tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; QA-led teams that want readable API tests with minimal code.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Apache JMeter
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; performance and load&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jmeter.apache.org" rel="noopener noreferrer"&gt;JMeter&lt;/a&gt; has been the default load-testing tool for a long time. It's free, mature and supports a wide range of protocols. The GUI makes it approachable for building test plans, though large plans can get unwieldy, and serious load runs should happen from the command line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; teams that need a proven, free load-testing tool with broad protocol support.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. k6
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; performance and load&lt;/p&gt;

&lt;p&gt;&lt;a href="https://k6.io" rel="noopener noreferrer"&gt;k6&lt;/a&gt;, now part of Grafana Labs, is what load testing looks like when developers design it. You write tests in JavaScript, keep them in version control next to your code and run them from the CLI or in CI. It's lightweight and pairs nicely with Grafana dashboards for results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; developer-led teams who want load tests treated like code.&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Robot Framework
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; general purpose (web, API, desktop and more through libraries)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://robotframework.org" rel="noopener noreferrer"&gt;Robot Framework&lt;/a&gt; uses a keyword-driven style, so tests read almost like plain English. It's built on Python and has a large library ecosystem, which lets one framework cover web, API and even desktop testing. Acceptance testing and RPA teams lean on it heavily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; teams that want one readable framework across many kinds of testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  10. Katalon Studio
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer:&lt;/strong&gt; web, mobile, API and desktop&lt;/p&gt;

&lt;p&gt;&lt;a href="https://katalon.com/katalon-studio" rel="noopener noreferrer"&gt;Katalon&lt;/a&gt; wraps Selenium and Appium in a low-code interface with record-and-playback, built-in reporting and test management. It's a sensible choice when a team has more manual testers than automation engineers and needs to get moving quickly. The free tier covers a lot, but bigger teams will usually end up on a paid plan.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; teams moving from manual to automated testing who want a gentle ramp.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to pick the right one for your team
&lt;/h2&gt;

&lt;p&gt;There's no single best tool, only the best fit for your situation. Before you commit, run through a few honest questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are you actually testing?&lt;/strong&gt; Start with the layer. Web UI, mobile, API and load testing each have their own strong players, and most mature teams end up using two or three tools rather than one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What language does your team write?&lt;/strong&gt; A tool that matches your main codebase gets adopted. A tool that forces everyone to learn something new usually gets abandoned after the first sprint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who writes the tests?&lt;/strong&gt; If developers own testing, code-first tools like Playwright or k6 fit well. If a dedicated QA team handles it, readable options like Karate, Robot Framework or Katalon lower the barrier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much maintenance can you afford?&lt;/strong&gt; This is the question people skip. Writing tests is the cheap part. Keeping them green while the product changes every week is where the real cost hides. Favor tools that reduce flakiness and make updates painless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does it fit your pipeline?&lt;/strong&gt; Every tool here can run in CI, but some take far less effort than others. Try a small proof of concept in your actual pipeline before rolling anything out widely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistakes I see teams make over and over
&lt;/h2&gt;

&lt;p&gt;The first one is automating everything. Not every test deserves a script. Exploratory testing, one-off checks and features that change daily are often better handled by a person. Automate the stable, repetitive, high-value paths first.&lt;/p&gt;

&lt;p&gt;The second is leaning too hard on UI tests. They're slow and brittle compared to API and unit tests. A healthy suite has lots of fast tests at the lower layers and a smaller set of UI tests covering the flows that matter most to users.&lt;/p&gt;

&lt;p&gt;The third is ignoring flaky tests. A test that fails randomly teaches your team to ignore red builds. Once that habit sets in, real bugs slip through. Fix flaky tests quickly or delete them.&lt;/p&gt;

&lt;p&gt;The last is picking a tool because it's trending. A popular tool your team can't use well is worse than a boring one they already know. Choose for your context, not for the conference talk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Which automation testing tool is best for beginners?
&lt;/h3&gt;

&lt;p&gt;For web testing, Playwright and Cypress are the friendliest starting points thanks to clear docs and good debugging. If you'd rather avoid code at first, Katalon's record-and-playback features make the first steps easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is Selenium still worth learning in 2026?
&lt;/h3&gt;

&lt;p&gt;Yes. Plenty of companies still run large Selenium suites, and the concepts carry over to newer tools. That said, if you're starting a fresh project, Playwright is usually the smoother choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can one tool cover all my testing needs?
&lt;/h3&gt;

&lt;p&gt;Rarely. Most teams pair a UI tool with an API tool and a load-testing tool. Trying to force one framework to do everything usually leads to awkward workarounds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are open-source tools good enough for serious projects?
&lt;/h3&gt;

&lt;p&gt;Absolutely. Selenium, Playwright, Appium, Keploy, k6 and JMeter are all open source and run in production pipelines at companies of every size. Paid tools mostly add convenience, support and reporting on top.&lt;/p&gt;

&lt;h3&gt;
  
  
  How long does it take to set up test automation?
&lt;/h3&gt;

&lt;p&gt;A basic suite for a few key flows can be running in a week or two. Building reliable coverage across a whole product takes months, and keeping it healthy is ongoing work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;The best tool is the one your team will actually use and keep using. Start small. Pick one layer, automate a handful of critical flows, and see how the tool feels after a month of real work. You'll learn more from that than from any comparison chart, this one included.&lt;/p&gt;

&lt;p&gt;Once the first suite is stable and trusted, expand from there. Good automation isn't built in a weekend. It grows steadily, one reliable test at a time.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>Behaviour driven development for testers: your role in BDD</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Thu, 08 Oct 2026 04:31:15 +0000</pubDate>
      <link>https://dev.to/alexai/behaviour-driven-development-for-testers-your-role-in-bdd-3ihi</link>
      <guid>https://dev.to/alexai/behaviour-driven-development-for-testers-your-role-in-bdd-3ihi</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe93t20xkcp0mmzvzli7n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe93t20xkcp0mmzvzli7n.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some testers worry that BDD automates them out of a job. In reality, BDD gives testers a bigger role, not a smaller one. Testers move from checking finished work to shaping it before it is built.&lt;/p&gt;

&lt;p&gt;This article explains what testers do at each stage of BDD. For the full process and tooling, see this reference on &lt;a href="https://keploy.io/docs/concepts/reference/glossary/behaviour-driven-development/" rel="noopener noreferrer"&gt;behaviour driven development bdd for testers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The tester in discovery&amp;nbsp;In a Three Amigos session, the product owner brings business value and the developer brings implementation. The tester brings risk. Your job is to ask the questions nobody else asks:&lt;/p&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;What happens if the input is empty?&lt;/p&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;What if the user does this twice?&lt;/p&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;What if the downstream service is slow or down?&lt;/p&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;What are the limits, and what happens just past them?&lt;/p&gt;

&lt;p&gt;Every answer becomes another example, and often another scenario.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tester in formulation
&lt;/h2&gt;

&lt;p&gt;Testers are often the best people to turn examples into Gherkin. You already think in preconditions, actions and expected results, which maps directly onto Given, When and Then.&lt;/p&gt;

&lt;p&gt;Scenario: Withdrawal exactly at daily limit succeeds&lt;/p&gt;

&lt;p&gt;&amp;nbsp; Given the daily withdrawal limit is 1000&lt;/p&gt;

&lt;p&gt;&amp;nbsp; And the customer has withdrawn 0 today&lt;/p&gt;

&lt;p&gt;&amp;nbsp; When the customer withdraws 1000&lt;/p&gt;

&lt;p&gt;&amp;nbsp; Then the withdrawal should succeed&lt;/p&gt;

&lt;p&gt;Boundary scenarios like this one are exactly where testers add value.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tester in automation
&lt;/h2&gt;

&lt;p&gt;Depending on the team, testers may write step definitions themselves or pair with developers. Either way, testers keep the suite healthy by spotting duplicated steps, flaky scenarios and slow tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing beyond the scenarios
&lt;/h2&gt;

&lt;p&gt;BDD scenarios cover agreed behavior. They do not replace exploratory testing, performance testing or security testing. Testers still own those, and they often uncover new examples that feed the next discovery session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Skills that help testers in BDD
&lt;/h2&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;&lt;strong&gt;Domain knowledge:&lt;/strong&gt; understanding the business rules you are testing.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;&lt;strong&gt;Clear writing:&lt;/strong&gt; scenarios are read by non-technical people.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;&lt;strong&gt;Basic coding:&lt;/strong&gt; enough to read and write step definitions.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--[if !supportLists]--&amp;gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--[endif]--&amp;gt;&lt;strong&gt;Facilitation:&lt;/strong&gt; keeping discovery sessions focused and short.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Do testers need to code in BDD?
&lt;/h3&gt;

&lt;p&gt;Basic coding helps, especially for step definitions, but the most valuable tester skills in BDD are questioning and clear writing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does BDD replace manual testing?
&lt;/h3&gt;

&lt;p&gt;No. Exploratory testing remains essential for finding issues nobody predicted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;In BDD, testers move upstream and influence quality before code exists. To reduce time spent writing regression tests by hand, generate them from real API traffic. &lt;a href="https://keploy.io/api-testing" rel="noopener noreferrer"&gt;Explore Keploy API testing&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>bdd</category>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>What is behaviour driven development? A plain-language guide for software teams</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Thu, 24 Sep 2026 05:14:26 +0000</pubDate>
      <link>https://dev.to/alexai/what-is-behaviour-driven-development-a-plain-language-guide-for-software-teams-4h3</link>
      <guid>https://dev.to/alexai/what-is-behaviour-driven-development-a-plain-language-guide-for-software-teams-4h3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fixcau9rruj0uvho7cfvf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fixcau9rruj0uvho7cfvf.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;br&gt;
Every software team has lived through this moment. A feature ships, the code works exactly as written, all the tests pass, and the product manager says, "That is not what we asked for." Nobody made a coding mistake. The mistake happened much earlier, when three people read the same requirement and imagined three different features.&lt;/p&gt;

&lt;p&gt;That gap between what the business wants and what the code does is the problem behaviour driven development was created to solve. If you have been asking what is behaviour driven development, the short answer is this: it is a way of building software where the team agrees on how the system should behave, writes that behaviour down as concrete examples in plain language, and then uses those examples as automated tests.&lt;/p&gt;

&lt;p&gt;This guide walks through the idea from the ground up, with examples, so you can decide whether it fits your team.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is behaviour driven development?
&lt;/h2&gt;

&lt;p&gt;Behaviour driven development (BDD) is an Agile practice that brings developers, testers, and business stakeholders together to describe software behaviour before it is built. Instead of starting from a technical specification, the team starts from real examples of how a user will interact with the feature.&lt;/p&gt;

&lt;p&gt;Those examples are written in a structured but readable format, usually called Gherkin, and they serve three purposes at once:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A shared requirement&lt;/strong&gt; that everyone on the team can read and agree on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Acceptance criteria&lt;/strong&gt; that define when a user story is actually done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An automated test&lt;/strong&gt; that checks the finished code behaves as described.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a deeper reference on the fundamentals, techniques, and tooling, Keploy maintains a detailed &lt;a href="https://keploy.io/docs/concepts/reference/glossary/behaviour-driven-development/" rel="noopener noreferrer"&gt;behaviour driven development glossary guide&lt;/a&gt; that covers the full concept in one place.&lt;/p&gt;
&lt;h2&gt;
  
  
  Where BDD came from
&lt;/h2&gt;

&lt;p&gt;BDD grew out of an older practice. Dan North introduced the term in the mid-2000s while coaching teams on &lt;a href="https://keploy.io/docs/concepts/reference/glossary/test-driven-development/" rel="noopener noreferrer"&gt;test driven development&lt;/a&gt;. He noticed that developers struggled with questions like "What should I test first?" and "What do I call this test?" The word "test" itself was part of the problem, because it pushed people to think about verification rather than intent.&lt;/p&gt;

&lt;p&gt;North suggested shifting the language from tests to behaviour. Instead of writing a test called &lt;code&gt;testLoginValid&lt;/code&gt;, you describe a behaviour: "a user with valid credentials should reach the dashboard." That small change in wording turned out to have a big effect. Once tests were written as sentences about behaviour, non-developers could read them, question them, and help write them.&lt;/p&gt;
&lt;h2&gt;
  
  
  How behaviour driven development works in practice
&lt;/h2&gt;

&lt;p&gt;BDD follows a simple loop that repeats for every feature.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: Start with a user story
&lt;/h3&gt;

&lt;p&gt;A user story captures who wants something, what they want, and why:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a registered customer, I want to reset my password so that I can regain access to my account.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Step 2: Discuss concrete examples
&lt;/h3&gt;

&lt;p&gt;The team then asks, "What does this look like in real situations?" A developer, a tester, and a product person (often called the "three amigos") talk through the happy path and the edge cases. What happens if the email is not registered? What if the reset link has expired?&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3: Write scenarios in Given-When-Then format
&lt;/h3&gt;

&lt;p&gt;Each example becomes a scenario:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gherkin"&gt;&lt;code&gt;&lt;span class="kd"&gt;Feature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; Password reset

  &lt;span class="kn"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; Registered user requests a reset link
    &lt;span class="nf"&gt;Given &lt;/span&gt;a customer is registered with &lt;span class="s"&gt;"asha@example.com"&lt;/span&gt;
    &lt;span class="nf"&gt;When &lt;/span&gt;she requests a password reset for &lt;span class="s"&gt;"asha@example.com"&lt;/span&gt;
    &lt;span class="nf"&gt;Then &lt;/span&gt;she should receive a reset email within 2 minutes

  &lt;span class="kn"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; Reset link has expired
    &lt;span class="nf"&gt;Given &lt;/span&gt;a customer has a reset link issued 25 hours ago
    &lt;span class="nf"&gt;When &lt;/span&gt;she opens the reset link
    &lt;span class="nf"&gt;Then &lt;/span&gt;she should see the message &lt;span class="s"&gt;"This link has expired"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Given&lt;/strong&gt; sets up the starting context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When&lt;/strong&gt; describes the action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Then&lt;/strong&gt; states the expected outcome.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Automate and build
&lt;/h3&gt;

&lt;p&gt;Developers connect each line of the scenario to code (called step definitions) using a tool like Cucumber, Behave, or SpecFlow. The scenarios fail at first, because the feature does not exist yet. Developers then write the code until the scenarios pass.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Keep scenarios as living documentation
&lt;/h3&gt;

&lt;p&gt;Once the feature ships, the scenarios stay in the codebase. They run in the CI pipeline on every change, and they double as up-to-date documentation of how the system behaves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why teams adopt BDD
&lt;/h2&gt;

&lt;p&gt;The main benefit of BDD is not the tooling. It is the conversation it forces before any code is written. Teams that adopt it usually report:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fewer misunderstood requirements&lt;/strong&gt;, because ambiguity is caught while discussing examples, not after release.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better test coverage of real user journeys&lt;/strong&gt;, since scenarios are written from the user's point of view.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation that stays accurate&lt;/strong&gt;, because it fails loudly in CI the moment it goes out of date.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easier onboarding&lt;/strong&gt;, since new team members can read feature files to learn what the system does.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  BDD vs TDD at a glance
&lt;/h2&gt;

&lt;p&gt;People often confuse the two, so here is a quick comparison.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Test driven development&lt;/th&gt;
&lt;th&gt;Behaviour driven development&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Main focus&lt;/td&gt;
&lt;td&gt;Code correctness&lt;/td&gt;
&lt;td&gt;System behaviour from the user's view&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Who writes tests&lt;/td&gt;
&lt;td&gt;Developers&lt;/td&gt;
&lt;td&gt;Developers, testers, and business stakeholders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Test language&lt;/td&gt;
&lt;td&gt;Programming language&lt;/td&gt;
&lt;td&gt;Plain language (Gherkin)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical level&lt;/td&gt;
&lt;td&gt;Unit tests&lt;/td&gt;
&lt;td&gt;Acceptance and integration tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Common tools&lt;/td&gt;
&lt;td&gt;JUnit, pytest, NUnit&lt;/td&gt;
&lt;td&gt;Cucumber, Behave, SpecFlow&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The two are not rivals. Many teams use TDD to build individual functions and BDD to confirm that the whole feature does what the business expects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common misconceptions about BDD
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"BDD is just writing tests in Gherkin."&lt;/strong&gt; Gherkin is a format, not the practice. A team that writes Gherkin alone at a desk, without talking to anyone, is doing test automation with extra steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"BDD replaces unit tests."&lt;/strong&gt; It does not. BDD scenarios sit at a higher level. You still need unit and integration tests underneath them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Every test should be a BDD scenario."&lt;/strong&gt; Scenarios work best for behaviour the business cares about. Low-level technical checks are usually clearer as regular unit tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  When BDD is a good fit
&lt;/h2&gt;

&lt;p&gt;BDD tends to pay off when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requirements are complex or frequently misunderstood.&lt;/li&gt;
&lt;li&gt;Business stakeholders are willing to take part in example discussions.&lt;/li&gt;
&lt;li&gt;The product has many user-facing rules, such as pricing, permissions, or workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It may be less useful for small internal tools, pure infrastructure work, or teams where no one outside engineering is available to collaborate.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is behaviour driven development in simple terms?
&lt;/h3&gt;

&lt;p&gt;It is a way of building software where the team first agrees on examples of how a feature should behave, writes those examples in plain language, and then turns them into automated tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is behaviour driven development only for testers?
&lt;/h3&gt;

&lt;p&gt;No. BDD is a whole-team practice. Testers, developers, and business stakeholders all contribute to the scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  What language is used to write BDD scenarios?
&lt;/h3&gt;

&lt;p&gt;Most teams use Gherkin, which relies on keywords like Given, When, Then, And, and But.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need a special tool to practise BDD?
&lt;/h3&gt;

&lt;p&gt;You can hold BDD conversations without any tool, but automating scenarios requires a framework such as Cucumber, Behave, SpecFlow, or JBehave.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So, what is behaviour driven development? It is less about a testing framework and more about a habit: talk about behaviour first, capture it as examples, and let those examples guide the code. When a team gets that habit right, the "that is not what we asked for" moment becomes rare, and the test suite becomes something the whole team can actually read.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Getting started with Bruno: git-native API testing in 10 minutes</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Thu, 17 Sep 2026 12:00:07 +0000</pubDate>
      <link>https://dev.to/alexai/getting-started-with-bruno-git-native-api-testing-in-10-minutes-49oj</link>
      <guid>https://dev.to/alexai/getting-started-with-bruno-git-native-api-testing-in-10-minutes-49oj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2hul0w6vkudq91g62aqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2hul0w6vkudq91g62aqr.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;Bruno is an open source API client that stores your collections as plain text files instead of in a cloud workspace. If you have ever wanted your API requests to live in Git next to your code, this is the tool for the job. This guide walks through everything from install to running your first collection in CI, and it should take about ten minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Bruno instead of a cloud client
&lt;/h2&gt;

&lt;p&gt;Most API clients keep your work in a hosted account. Bruno takes the opposite approach and stores everything on your filesystem. Each request is a .bru file, environments are simple files, and the whole collection is just a folder. That means you can commit it, diff it, review it in a pull request, and keep it in the same repository as the code it tests. Bruno is also offline only, so nothing syncs to a server you do not control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: install and create a collection
&lt;/h2&gt;

&lt;p&gt;Download Bruno for Mac, Windows, or Linux from the official site. On first launch, create a new collection. Bruno generates a folder containing a bruno.json manifest and a sample request saved as a .bru file. Open that folder in your editor and you will see the request in readable plain text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: understand the .bru format
&lt;/h2&gt;

&lt;p&gt;A basic request looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get {
  url: {{baseUrl}}/users/1
}

headers {
  Accept: application/json
}

assert {
  res.status: eq 200
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything is human readable. The url references a variable, the headers block sets request headers, and the assert block checks the response. Because this is plain text, you can edit it in VS Code, Vim, or anything else, and it diffs cleanly in a pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: set up environments and variables
&lt;/h2&gt;

&lt;p&gt;Bruno stores environments as files you can commit alongside your requests. Define a base URL per environment and reference it with {{baseUrl}} so the same request works locally, in staging, and in production. For secrets, pull values from a dotenv file so tokens never get hard coded into a shared collection. Keep real secrets in a .env file that stays out of version control, and reference them so your committed files stay clean.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: write tests
&lt;/h2&gt;

&lt;p&gt;Bruno supports assertions directly, and JavaScript for anything more involved. A post response test might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test("status is 200", function() {
  expect(res.getStatus()).to.equal(200);
});

test("returns a user id", function() {
  expect(res.getBody().id).to.be.a("number");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pre request scripts let you set up data or compute a signature before the call goes out, and post response scripts let you validate results or chain values into the next request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: run the whole collection in CI
&lt;/h2&gt;

&lt;p&gt;This is where the git-native model pays off. Install the CLI and run your collection headlessly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @usebruno/cli
bru run --env Staging --reporter-json results.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CLI supports JSON, JUnit, and HTML reporters, so it plugs into whatever your pipeline expects. There are official Docker images published on every release, which means you can run collections in CI without installing Node on the runner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -v $(pwd):/bruno usebruno/cli run --env Staging
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Drop that into GitHub Actions, GitLab CI, or Jenkins, and the same requests you test by hand now gate every merge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: import what you already have
&lt;/h2&gt;

&lt;p&gt;If you are coming from Postman or Insomnia, you do not have to start over. Bruno can import existing collections, and you can watch how they map to the .bru format. It is a good way to learn the structure while keeping your existing work intact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go next
&lt;/h2&gt;

&lt;p&gt;That is the core loop: create a collection, write requests and tests as files, commit them, and run them in CI. Bruno supports REST, GraphQL, and gRPC, it is MIT licensed, and it never syncs your data to a cloud. For a deeper look at structuring larger collections and wiring up a full pipeline, this guide on &lt;a href="https://keploy.io/blog/community/bruno-api-testing" rel="noopener noreferrer"&gt;testing APIs with Bruno&lt;/a&gt; goes further.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is Bruno free?
&lt;/h3&gt;

&lt;p&gt;The core client and CLI are free and open source under the MIT license. Paid Pro and Ultimate tiers add in-app Git integration, OpenAPI sync, and enterprise features, but you can do everything in this guide on the free client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Bruno work offline?
&lt;/h3&gt;

&lt;p&gt;Yes. Bruno is offline only by design, with no account and no cloud sync. Your data stays on your machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use Bruno with any version control system?
&lt;/h3&gt;

&lt;p&gt;Yes. Because collections are plain files, you can use Git or any other version control system to collaborate over them.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I structure a large collection?
&lt;/h3&gt;

&lt;p&gt;Group related requests into folders inside the collection, keep one environment file per stage, and store shared setup in pre request scripts at the folder or collection level. Since everything is plain text, you can reorganize by moving files, and the changes show up cleanly in version control.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Best tool for generating regression tests from OpenAPI, Postman collections, or cURL</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Thu, 10 Sep 2026 17:24:41 +0000</pubDate>
      <link>https://dev.to/alexai/best-tool-for-generating-regression-tests-from-openapi-postman-collections-or-curl-57c</link>
      <guid>https://dev.to/alexai/best-tool-for-generating-regression-tests-from-openapi-postman-collections-or-curl-57c</guid>
      <description>&lt;p&gt;Most API test automation guides start the same way: "write a test for your &lt;code&gt;/login&lt;/code&gt; endpoint." Then a test for &lt;code&gt;/users&lt;/code&gt;. Then &lt;code&gt;/orders&lt;/code&gt;. By endpoint 40 you are maintaining more test code than product code, and half of it breaks every time a schema changes.&lt;/p&gt;

&lt;p&gt;I wanted the opposite: point a tool at what I already have — an OpenAPI spec, a Postman collection I'd been using for months, or even a single cURL command — and get a runnable regression suite out the other side. Here's the workflow that actually worked, using &lt;a href="https://keploy.io/docs/running-keploy/api-test-generator/" rel="noopener noreferrer"&gt;Keploy's API test generator&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: your inputs already describe your API
&lt;/h2&gt;

&lt;p&gt;You almost never start from nothing. You have one of these lying around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an &lt;strong&gt;OpenAPI / Swagger spec&lt;/strong&gt; that documents every route&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;Postman collection&lt;/strong&gt; your team built while developing&lt;/li&gt;
&lt;li&gt;a pile of &lt;strong&gt;cURL commands&lt;/strong&gt; in a README or a Slack thread&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keploy's test generator takes any of those as input, calls the endpoints, and produces validated tests with assertions based on the &lt;em&gt;actual&lt;/em&gt; responses — not assertions you guessed and typed by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 1 — from an OpenAPI spec
&lt;/h2&gt;

&lt;p&gt;If you have a spec, this is the fastest path. Point the generator at it, and it walks the documented routes, hits them, and records the real responses as the expected baseline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# feed the schema, let Keploy generate the suite&lt;/span&gt;
keploy gen &lt;span class="nt"&gt;--source&lt;/span&gt; openapi ./openapi.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What you get back isn't just "status 200" checks. It validates response body structure, field types, and headers — the things that actually break downstream consumers when someone renames a key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 2 — from a Postman collection
&lt;/h2&gt;

&lt;p&gt;If your team already lives in Postman, you don't throw that work away. Export the collection and hand it over:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;keploy gen &lt;span class="nt"&gt;--source&lt;/span&gt; postman ./MyAPI.postman_collection.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every request in the collection becomes a test case with response-based assertions. This is the path I'd recommend if you're &lt;strong&gt;migrating off manual Postman testing&lt;/strong&gt; — you keep the requests you already wrote and get automated regression on top of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 3 — from a single cURL command
&lt;/h2&gt;

&lt;p&gt;Sometimes you just have one endpoint and one cURL line. That's enough to start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;keploy gen &lt;span class="nt"&gt;--source&lt;/span&gt; curl &lt;span class="s2"&gt;"curl -X POST https://api.example.com/url &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  -H 'content-type: application/json' &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  -d '{&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;url&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;https://github.com&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;}'"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keploy runs it, captures the response, and turns it into a test. Non-deterministic fields like timestamps and random IDs get normalized automatically, so the test doesn't fail on the next run just because a &lt;code&gt;created_at&lt;/code&gt; changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that matters: replay in CI
&lt;/h2&gt;

&lt;p&gt;Generating tests is half the value. The other half is running them on every change. Because the assertions came from real responses, a regression shows up the moment a response drifts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/api-tests.yml (simplified)&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Keploy regression suite&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;keploy test -c "npm start"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wire that into a pull-request check and the build fails when an endpoint starts returning something different. You find the break in the PR, not in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this fits (and where it doesn't)
&lt;/h2&gt;

&lt;p&gt;This approach shines when you want regression coverage fast and you already have a spec, a collection, or live endpoints. If what you actually need is a manual request client for exploring a brand-new third-party API, a tool like Bruno or Postman is the better fit — different job.&lt;/p&gt;

&lt;p&gt;For me the win was simple: I stopped hand-writing regression tests. The suite came from inputs I already had, and it reflects how the API actually behaves instead of how I imagined it did.&lt;/p&gt;

&lt;p&gt;If you want to try it, the &lt;a href="https://keploy.io/docs/running-keploy/api-test-generator/" rel="noopener noreferrer"&gt;test generator docs are here&lt;/a&gt; and it's open source (Apache 2.0). For how this stacks up against the other options, this &lt;a href="https://keploy.io/blog/community/api-testing-tools" rel="noopener noreferrer"&gt;API testing tools comparison&lt;/a&gt; breaks the category down. Curious what other people are using to get regression coverage without the hand-authoring tax — drop it in the comments.&lt;/p&gt;

</description>
      <category>api</category>
      <category>testing</category>
      <category>playwright</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Trouble With Testing Against Live Third-Party APIs</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Tue, 01 Sep 2026 07:07:27 +0000</pubDate>
      <link>https://dev.to/alexai/-the-trouble-with-testing-against-live-third-party-apis-14oj</link>
      <guid>https://dev.to/alexai/-the-trouble-with-testing-against-live-third-party-apis-14oj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7fg3mwbnq0hwae9wkbu9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7fg3mwbnq0hwae9wkbu9.webp" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Almost every application leans on someone else's API. Payments, maps, email delivery, weather, shipping rates, the list keeps growing. These integrations are where a lot of the real value lives, and they are also where testing quietly falls apart. Pointing your test suite at a live third-party API feels like the most realistic thing you can do, but it introduces a set of problems that make your tests slower, flakier, and occasionally expensive. I want to lay out why, and what to do instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  You do not control the thing you are testing against
&lt;/h2&gt;

&lt;p&gt;The core issue is ownership. When your tests call a real external service, the reliability of your test run is now tied to someone else's uptime, latency, and schedule. Their API has a slow morning and your build goes red for reasons that have nothing to do with your code. They deploy a change and your tests break without you touching a line. You are inheriting all the variability of a system you cannot see into or fix.&lt;/p&gt;

&lt;p&gt;A test suite is supposed to tell you about your code. The moment it depends on a live external service, it starts telling you about their code too, and you cannot tell the two signals apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rate limits turn your suite against you
&lt;/h2&gt;

&lt;p&gt;Most third-party APIs cap how often you can call them. That is fine in production, where calls are spread out. It is a problem in testing, where a full suite might fire hundreds of requests in a burst. Run your tests a few times in quick succession and you hit the limit, and now your suite fails not because anything is wrong but because you tested too eagerly.&lt;/p&gt;

&lt;p&gt;Teams end up adding delays, skipping tests, or running the integration suite only occasionally to avoid tripping limits. Every one of those workarounds weakens the safety net exactly where it should be strongest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some calls cost real money
&lt;/h2&gt;

&lt;p&gt;Plenty of APIs charge per call, or offer a limited free sandbox beyond which the meter starts running. When your tests hit those endpoints, your testing has a line item. The more thoroughly you test, the more it costs, which creates a perverse incentive to test less. Nobody should be discouraged from running their tests because each run shows up on an invoice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Live data will not hold still
&lt;/h2&gt;

&lt;p&gt;Even when the external API is fast, free, and up, there is a subtler problem. Its data changes. A currency endpoint returns a different rate every hour. A shipping API quotes different prices as carriers update. You cannot write a stable assertion against a value that refuses to stay the same, so either your tests are vague to the point of uselessness or they break every time the upstream data shifts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simulate the dependency instead
&lt;/h2&gt;

&lt;p&gt;The answer to all four problems is the same. Stop calling the real third-party service in most of your tests and replace it with a controlled stand-in. This is where &lt;a href="https://keploy.io/blog/community/what-is-api-mocking" rel="noopener noreferrer"&gt;api mocking tools&lt;/a&gt; do their most valuable work. You capture how the real API responds once, then let a mock replay those responses on demand. Your tests get a dependency that is always up, never rate limited, completely free to call, and perfectly consistent from one run to the next.&lt;/p&gt;

&lt;p&gt;With the external service mocked, you can finally test the things that actually matter about an integration. What does your code do with a valid response, a malformed one, an error, a timeout. You can force each of those deliberately, which is something a live API will never let you do on command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep a thin thread to reality
&lt;/h2&gt;

&lt;p&gt;Mocking the third-party service everywhere would leave one gap. Mocks encode how the API behaved when you captured them, and external providers change their APIs without asking. So you keep a small, deliberate set of tests that hit the real service on a schedule, purely to confirm that your mocks still match reality. Those run occasionally and in isolation, well within any rate limit, while the bulk of your suite runs fast and offline against the mocks.&lt;/p&gt;

&lt;p&gt;This split gives you both things at once. The speed, stability, and zero cost of mocked tests for everyday work, and a periodic reality check that catches the day the provider changes something under you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Realistic does not mean live
&lt;/h2&gt;

&lt;p&gt;The instinct to test against the real API comes from a good place, the desire for realism. But realism in testing is about exercising the right behavior under controlled conditions, not about reaching across the internet on every run. Capture how the dependency behaves, simulate it faithfully, and verify the capture now and then. You end up with tests that are more thorough than live calls ever allowed, and a suite you can actually trust to run on every commit.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Why Staging Environments Become the Bottleneck as Teams Scale</title>
      <dc:creator>alexrai</dc:creator>
      <pubDate>Tue, 25 Aug 2026 05:18:33 +0000</pubDate>
      <link>https://dev.to/alexai/why-staging-environments-become-the-bottleneck-as-teams-scale-2oc7</link>
      <guid>https://dev.to/alexai/why-staging-environments-become-the-bottleneck-as-teams-scale-2oc7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqedlrfkoinuehof2elij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqedlrfkoinuehof2elij.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every engineering team I have worked with hits the same wall around the same point in their growth. The product finds traction, the headcount doubles, the service count triples, and suddenly the shared staging environment that used to be a quiet corner of the infrastructure turns into the single most contested resource in the company. People start scheduling their deploys around each other. Test runs fail for reasons that have nothing to do with the code under test. Nobody trusts the results anymore.&lt;/p&gt;

&lt;p&gt;I want to walk through why this happens, because the failure mode is predictable, and once you can name it you can design around it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dependency chain nobody planned for
&lt;/h2&gt;

&lt;p&gt;When you have three services, a shared staging environment feels efficient. Everyone deploys to the same place, integration is real, and the whole system is exercised end to end. The trouble is that this model does not degrade gracefully. Each new service you add is a new potential point of failure in every other team's test run.&lt;/p&gt;

&lt;p&gt;By the time you are running twenty or thirty services, a test that touches four of them is implicitly depending on all four being healthy, correctly seeded, and deployed at a compatible version at the exact moment the test runs. That is a lot of conditions to hold true at once. When any one of them slips, the test fails, and the engineer who wrote it spends an afternoon proving that their code was never the problem.&lt;/p&gt;

&lt;p&gt;This is the hidden tax of shared environments. It does not show up on any dashboard, but it quietly erodes the thing that makes tests useful in the first place, which is trust in the signal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flakiness is a strategy problem, not a code problem
&lt;/h2&gt;

&lt;p&gt;The instinct when tests get flaky is to treat each failure individually. Add a retry here, a longer timeout there, a sleep to wait for the downstream service to warm up. These patches accumulate until the suite is slow, unreliable, and impossible to reason about.&lt;/p&gt;

&lt;p&gt;The more durable fix is to step back and treat this as a question of how the organization tests, not how one test is written. A serious &lt;a href="https://keploy.io/blog/community/software-testing-strategies" rel="noopener noreferrer"&gt;enterprise software testing strategy&lt;/a&gt; starts from the premise that a test should fail only when the behavior it targets is actually broken. Everything else, the network conditions, the state of unrelated services, the timing, is noise that the strategy is responsible for removing.&lt;/p&gt;

&lt;p&gt;Framed that way, the shared staging bottleneck is not an infrastructure problem to throw more environments at. It is a signal that your tests are coupled to dependencies they should not care about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Isolating the service under test
&lt;/h2&gt;

&lt;p&gt;The practical move is to stop depending on live downstream services during most of your testing, and instead simulate their responses. When a test for the checkout service needs the inventory service to answer, it does not need the real inventory service. It needs a predictable answer that matches what the real one would return.&lt;/p&gt;

&lt;p&gt;This is where &lt;a href="https://keploy.io/blog/community/what-is-api-mocking" rel="noopener noreferrer"&gt;api mocking tools&lt;/a&gt; earn their place in the workflow. By standing in for the real dependencies, they let a test exercise exactly one service at a time with fully controlled inputs. The inventory service can be slow, broken, or mid-deploy, and the checkout test does not care, because it is talking to a mock that behaves consistently every single run.&lt;/p&gt;

&lt;h3&gt;
  
  
  What you get back
&lt;/h3&gt;

&lt;p&gt;Two things change immediately once you isolate the service under test. First, the failures you do see become meaningful again. A red build means the code is wrong, not that someone else was deploying at the wrong time. Second, the tests get dramatically faster, because they no longer wait on a chain of real network calls that can each stall.&lt;/p&gt;

&lt;p&gt;There is a third benefit that takes longer to appreciate. When each service can be tested in isolation, teams stop coordinating their releases around a shared bottleneck. The checkout team can ship on their own schedule because their confidence no longer depends on the state of the inventory environment. Autonomy at the team level is downstream of isolation at the test level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where shared environments still belong
&lt;/h2&gt;

&lt;p&gt;None of this means you delete staging. Integration testing against real services still matters, because mocks encode assumptions about how a dependency behaves, and those assumptions drift. You want a smaller, more deliberate set of end to end tests that run against the real system to catch the contract mismatches that isolated tests cannot see.&lt;/p&gt;

&lt;p&gt;The shift is one of proportion. The bulk of your suite runs fast and isolated, giving each team a tight feedback loop they control. A thin layer of integration tests runs against shared infrastructure to verify that the pieces still fit together. When staging breaks, it inconveniences that thin layer instead of blocking every engineer in the company.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started without a rewrite
&lt;/h2&gt;

&lt;p&gt;You do not need to re-architect anything to begin. Pick the one service whose tests fail most often for reasons unrelated to its own code. That is almost always the service with the most downstream dependencies. Isolate its tests from those dependencies, measure how much the flakiness drops, and let the result make the case for the next service.&lt;/p&gt;

&lt;p&gt;The teams that scale their testing well are rarely the ones with the biggest infrastructure budget. They are the ones who noticed early that a test's job is to tell you about one thing, and who built their process to protect that clarity as the system grew. The staging bottleneck is a symptom. Isolation is the cure, and you can start curing it one service at a time.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
