<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Erik Fernandes Amaral on Medium]]></title>
        <description><![CDATA[Stories by Erik Fernandes Amaral on Medium]]></description>
        <link>https://medium.com/@erik.amaral?source=rss-1b71fd253fd4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hvv3-A8Hj5hZEQwVcBJFTw@2x.jpeg</url>
            <title>Stories by Erik Fernandes Amaral on Medium</title>
            <link>https://medium.com/@erik.amaral?source=rss-1b71fd253fd4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:23:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erik.amaral/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI, RAG, and the architecture behind an enterprise software quality platform: how we thought about…]]></title>
            <link>https://medium.com/@erik.amaral/ai-rag-and-the-architecture-behind-an-enterprise-software-quality-platform-how-we-thought-about-d70adf4dc713?source=rss-1b71fd253fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d70adf4dc713</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[enterprise-software]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Erik Fernandes Amaral]]></dc:creator>
            <pubDate>Mon, 04 May 2026 13:15:54 GMT</pubDate>
            <atom:updated>2026-05-04T18:56:16.596Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o7uf4Bz-YxLyitii5Yiv5w.png" /></figure><h3>AI, RAG, and the architecture behind an enterprise software quality platform: how we thought about ScaleQuality</h3><p>Last week, in a WhatsApp conversation, a developer friend sent me what looked like a simple message:</p><p><strong>“Do you have a RAG base for ScaleQuality?</strong></p><p><a href="https://scalequality.io/"><em>scalequality.io</em></a></p><p>It looks like a curious technical question. It isn’t.</p><p>Behind that question lies one of the most critical discussions every enterprise AI startup will face in the coming years. And since I ended up answering off the top of my head, in the middle of the conversation, I realized it’s worth stopping and structuring the thinking in writing.</p><p>This piece is build in public. It’s how we thought about ScaleQuality’s AI architecture, why we made the decisions we made, and what “responsible AI” actually means when your customer is a company about to trust you with sensitive code, engineering metrics, and financial data.</p><h3>First, the basics: what RAG is (and what it ISN’T)</h3><p>There’s a common confusion, even among people who have worked in tech for a long time: people treat RAG as if it were an “evolution of the LLM.” It isn’t.</p><p><strong>LLM</strong> is the AI model itself. ChatGPT, Claude, Gemini, Llama. It has frozen knowledge from what it was trained on, and answers “from memory.”</p><p><strong>RAG (Retrieval-Augmented Generation)</strong> is an architecture. It doesn’t replace the LLM, it complements it. The flow is:</p><ol><li>You have a knowledge base (documents, data, context)</li><li>When someone asks a question, the system searches for the relevant chunks in that base</li><li>It injects those chunks into the prompt sent to the LLM</li><li>The LLM responds grounded in those chunks, not just on what it “remembers” from training</li></ol><p>The analogy I use often: <strong>a pure LLM is a consultant talking from memory. An LLM with RAG is a consultant who, before answering, consults your company’s documentation and reference papers.</strong></p><p>Why does this matter? Because pure LLMs hallucinate, don’t have updated or private data, and can’t cite sources. RAG solves all three problems at once.</p><h3>When I was asked the question, several others came along in my head</h3><p>When my friend asked whether ScaleQuality has RAG, maybe he was just curious about architecture. But as I was answering, I thought about two additional questions that usually come bundled with the first one, even when the person doesn’t formulate them explicitly:</p><p><strong>1. Are this platform’s AI answers grounded, or are they LLM guessing?</strong></p><p><strong>2. Are my data going to be used to train your model?</strong></p><p>The first question is about <strong>technical quality</strong>. The second is about <strong>security and governance</strong>. They’re glued together, but they have different answers.</p><p>He may not have been thinking about any of that. But I decided to answer considering this complete context, because I think these questions deserve clarity whenever someone looks at AI applied to enterprise scenarios. And it was that complete answer, plus the realization that this kind of discussion needs to be more open in the market, that brought me here writing this.</p><h3>How ScaleQuality’s AI works in practice</h3><p>ScaleQuality combines three layers:</p><h3>1. Multi-Source Intelligence Engine (proprietary)</h3><p>This is the heart. It’s not an LLM. It’s a pipeline that collects and cross-references signals from multiple sources within the client’s tenant:</p><ul><li>Code signals (PRs, merge cycle, CI pass rate, rework index)</li><li>Management signals (epic and story health, delivery flow)</li><li>Quality signals (coverage, mutation testing, contracts)</li><li>Security and operations signals (vulnerabilities, observability)</li></ul><p>What this engine does is <strong>translate all of that into quality maturity and financial impact</strong>. Quality Gates, scorecards, projected ROI, exposed risk. This is the proprietary differentiator, and it’s what takes time to build. Anyone can plug in an LLM API. Building the multi-source model that cross-references these signals and generates defensible financial projection is where the moat lives.</p><h3>2. RAG over two isolated knowledge bases</h3><p>This is where RAG enters, and it’s where the answer to “how do you use AI” lives:</p><p><strong>Client data base:</strong> repo data, CI/CD, board, scorecards, observability. They live inside their tenant. They never cross the boundary into another client. When someone asks a question through the AI Advisor, the system retrieves context <strong>only from that client’s data</strong>, and uses it to contextualize the answer.</p><p><strong>Public research base:</strong> market studies and references like CISQ Cost of Poor Software Quality, DORA State of DevOps, McKinsey Developer Velocity, Stripe Developer Coefficient, GitHub Octoverse. This second base is what grounds the platform’s recommendations in recognized industry standards, not opinion. When the system says “your team is losing X hours/week to rework,” that’s grounded in public research, not a guess.</p><p>The combination of both bases is what makes the platform’s recommendation simultaneously <strong>personalized</strong> (because it considers your data) and <strong>defensible</strong> (because it’s grounded in published research).</p><h3>3. LLM (consumed via API)</h3><p>The LLM itself is off-the-shelf. We don’t train models from scratch. Nobody at Series A actually does that (it costs millions and requires specialized teams). What matters isn’t which LLM is underneath. What matters is how it’s used.</p><p>And here lies the part that matters most, and to any enterprise decision-maker:</p><h3>The two non-negotiable commitments: Zero Code Retention and Non-Model-Learning AI</h3><p>These two terms have become a fixed part of our commercial materials. But they aren’t marketing. They’re architecture.</p><p><strong>Zero Code Retention:</strong> code that goes through analysis isn’t stored for training purposes. It’s processed at runtime, generates the signals the engine needs, and that’s it. No client code chunks end up in a training dataset anywhere.</p><p><strong>Non-Model-Learning AI:</strong> client data is used at runtime to contextualize answers (this is exactly what RAG exists for), but <strong>doesn’t retrain models</strong>. It informs the answer of the moment, and nothing more. ScaleQuality’s model doesn’t get “smarter” on client A’s data to better answer client B.</p><p><strong>Tenant isolation:</strong> each client is a tenant. Client A signals never inform answers for client B. The boundary is architectural, not policy-based.</p><p>Why does this matter so much?</p><p>Because today, when an AI startup says “our model learns from usage,” what a serious enterprise decision-maker hears is: <strong>“I’ll be feeding my competitors’ AI with my data.”</strong> And they’re right to hear it that way. We’ve seen this movie play out with several platforms.</p><p>The choice not to do this is a product choice. It means giving up a “free” continuous improvement vector. It means every product evolution has to come from the proprietary engine, from refining our logic, and from curating the research base. It doesn’t come from client data.</p><p>It’s harder. It’s the only honest way to operate enterprise AI in 2026.</p><h3>RAG solves more problems than it appears to</h3><p>Coming back to the original conversation. After I explained all of this, my friend made an observation that perfectly closed the point: that this approach is an effective way to reduce hallucination.</p><p>And that observation is the point. RAG isn’t only about privacy. It’s about <strong>honesty of the answer</strong>.</p><p>A pure LLM hallucinates. It fills gaps with plausibility, not with fact. When you ask “what’s the best testing pattern for API integration,” a pure LLM might give you a beautiful and entirely fabricated answer, citing books that don’t exist.</p><p>An LLM with RAG over public research answers the same question based on CISQ, DORA, or whichever paper is relevant. The answer is grounded. If the paper says X, the answer says X. If the paper doesn’t address it, the system admits it doesn’t know.</p><p>For a technology leader who will use the recommendation to defend investment in front of the board, that’s the difference between a “consultant who makes things up” and a “consultant who cites sources.”</p><h3>What this means for whoever is looking at ScaleQuality as a solution</h3><p>If you’re a VP of Engineering, CTO, Quality Architect, or Head of Quality evaluating ScaleQuality, these are the points that matter:</p><p><strong>1. The platform’s recommendations are grounded.</strong> They aren’t “automated guessing.” Grounding is in public research (CISQ, DORA, McKinsey, Stripe Developer Coefficient) cross-referenced with your real data via the Multi-Source Intelligence Engine.</p><p><strong>2. Your data does not train our model.</strong> It informs your answers, at runtime, inside your tenant. Period.</p><p><strong>3. Your code is not stored for training purposes.</strong> Zero Code Retention is architecture, not promise.</p><p><strong>4. Your team is a customer of a company, not a data source.</strong> Each tenant is a boundary. What happens in your tenant stays in your tenant.</p><h3>Why I’m writing this now</h3><p>Building an enterprise AI company in 2026 is building a trust company. Technology commoditizes fast. In two years, RAG will be as basic as a database is today. What doesn’t commoditize is how you handle the data of those who trusted you.</p><p>I wanted to put this in the open because I think more AI founders need to talk openly about architecture. The industry default has become “say you have AI, hide how it works.” For me, that isn’t strategy. It’s lack of courage.</p><p>And because my friend, asking that question on WhatsApp, did ScaleQuality a huge favor. Every objection that gets voiced is a solvable objection. The dangerous ones are those that stay only in the prospect’s head and never make it to us.</p><p>If you’re looking at enterprise AI to adopt at your company, ask this question. Always. To every vendor.</p><p>And if the answer comes back vague, you already have enough information to decide.</p><p><em>Erik Fernandes Amaral is Founder &amp; CEO of ScaleQuality, a B2B SaaS that connects to the engineering tools companies already use (GitHub, Jira, SonarCloud, and more) and continuously measures the quality of the software they build. 18+ years in software quality, Principal Quality Architect at AB InBev, and SRE Instructor at Alura.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d70adf4dc713" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quality Maturity Model for Engineering Teams (with AI Testing)]]></title>
            <link>https://medium.com/@erik.amaral/quality-maturity-model-for-engineering-teams-with-ai-testing-6f82ae769237?source=rss-1b71fd253fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f82ae769237</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[ai-testing]]></category>
            <category><![CDATA[maturity-model]]></category>
            <dc:creator><![CDATA[Erik Fernandes Amaral]]></dc:creator>
            <pubDate>Mon, 22 Sep 2025 22:07:47 GMT</pubDate>
            <atom:updated>2025-09-22T22:07:47.245Z</atom:updated>
            <content:encoded><![CDATA[<p>A pragmatic <strong>Quality Maturity Model</strong> gives teams a shared language to baseline where they are, set realistic targets, and sequence the next investments. This model treats <strong>AI Testing</strong> (LLMs and generative AI) as a first‑class capability alongside DevOps, CI/CD, performance, observability, security, and resilience. Use the scorecard to set <strong>quarterly OKRs</strong>, move one level at a time, and turn quality into a competitive advantage.</p><h3>Why a maturity model?</h3><p>In fast‑moving orgs, quality isn’t just a gate at the end — it’s a <strong>system of practices</strong> that must evolve with architecture and scale. A maturity model:</p><ul><li><strong>Baselines</strong> today’s capabilities and gaps.</li><li><strong>Aligns</strong> leaders and squads on the next most valuable increments.</li><li><strong>Sequences</strong> investments (people, tooling, process) into 90‑day plans.</li><li><strong>Measures</strong> outcomes via leading (process) and lagging (reliability/business) indicators.</li></ul><blockquote><em>As software architect Martin Fowler notes, maturity models are useful for understanding and improving organizational effectiveness (see </em>Maturity Model<em>). Treat them as a </em><strong><em>map</em></strong><em>, not the territory — use judgment and context.</em></blockquote><h3>The 5‑Level Quality &amp; AI Testing Maturity Model</h3><p>Each level is <strong>cumulative</strong> — you keep what came before. The model is scored across <strong>eight dimensions</strong>:</p><ol><li>Strategy &amp; Ownership</li><li>Architecture &amp; Environments</li><li>Test Automation (unit→E2E, contract)</li><li>Performance &amp; Reliability</li><li>Observability &amp; Synthetics</li><li>Security &amp; Privacy</li><li><strong>AI Testing (LLMs/GenAI)</strong></li><li>CI/CD &amp; Platform</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0TSxzM9oUoyB3yRLilbDGA.png" /></figure><h3>Snapshot</h3><p>Level Tagline Typical State <strong>1. Ad‑hoc</strong> Heroics Mostly manual testing, unstable environments, low signal, quality is a phase. <strong>2. Managed</strong> Basics in place CI enabled, smoke tests, first unit tests, static analysis, owners named. <strong>3. Defined</strong> Playbooks Test strategy by type, contract tests, 60%+ automation on critical flows, baseline perf. <strong>4. Measured</strong> SLO‑driven SLOs, synthetics, k6 in CI, chaos gamedays, coverage gates, dashboards. <strong>5. Optimized</strong> Platform &amp; learning loops Self‑service quality platform, test impact analysis, progressive delivery, continuous AI eval.</p><h3>Dimension detail by level</h3><h3>1) Strategy &amp; Ownership</h3><ul><li><strong>L1</strong>: Quality seen as QA’s job. No roadmap or budget.</li><li><strong>L2</strong>: Named owners, basic test policy (what/when), issues tracked.</li><li><strong>L3</strong>: Squad‑level <strong>Quality Strategy</strong> doc per service/app; risk‑based test matrix.</li><li><strong>L4</strong>: Org‑wide standards; <strong>SLOs</strong> tied to OKRs (e.g., availability, latency, defect escape).</li><li><strong>L5</strong>: Quality <strong>platform team</strong>; paved‑roads, scorecards on exec dashboards.</li></ul><h3>2) Architecture &amp; Environments</h3><ul><li><strong>L1</strong>: Shared dev environment only; flakiness from data coupling.</li><li><strong>L2</strong>: Ephemeral test envs; seed data scripts.</li><li><strong>L3</strong>: <strong>Prod‑like</strong> staging; test data mgmt; contract‑driven integration.</li><li><strong>L4</strong>: Blue/green &amp; canary; chaos experiments.</li><li><strong>L5</strong>: Policy‑as‑code for environments; automated drift &amp; resilience checks.</li></ul><h3>3) Test Automation (unit → E2E, contract)</h3><ul><li><strong>L1</strong>: Manual regression.</li><li><strong>L2</strong>: Unit tests on new code; <strong>static analysis</strong>; minimal UI smoke; CI feedback &lt;15 min.</li><li><strong>L3</strong>: <strong>Contract tests</strong> for top APIs; component tests; E2E only for critical journeys; <strong>≥60%</strong> automation on risk‑critical code; mutation testing pilots.</li><li><strong>L4</strong>: Coverage gates, flaky‑test quarantine, <strong>test impact analysis</strong>; mutation budget on core modules.</li><li><strong>L5</strong>: Self‑service test templates; cross‑repo contract &amp; schema governance; E2E as synthetic checks.</li></ul><h3>4) Performance &amp; Reliability</h3><ul><li><strong>L1</strong>: Ad‑hoc load tests late.</li><li><strong>L2</strong>: k6 smoke with single RPS; perf runs on demand.</li><li><strong>L3</strong>: Baseline <strong>NFRs</strong> per service; CI load tests on key endpoints; perf budgets.</li><li><strong>L4</strong>: <strong>SLOs</strong> (latency, error rate); regression detection in CI; capacity playbooks.</li><li><strong>L5</strong>: Auto‑generated load models from prod traces; adaptive perf tests per release.</li></ul><h3>5) Observability &amp; Synthetics</h3><ul><li><strong>L1</strong>: Logs only.</li><li><strong>L2</strong>: Basic metrics &amp; dashboards.</li><li><strong>L3</strong>: Traces, RED/USE dashboards; on‑call runbooks.</li><li><strong>L4</strong>: <strong>Synthetics</strong> for top journeys, CI‑triggered; alerting from SLO burn rate.</li><li><strong>L5</strong>: Continuous synthetic coverage; user‑journey coverage SLOs; business telemetry in the same views.</li></ul><h3>6) Security &amp; Privacy</h3><ul><li><strong>L1</strong>: Annual pentest.</li><li><strong>L2</strong>: SAST/DAST in CI; secrets scanning.</li><li><strong>L3</strong>: Threat modeling in PRD; dependency policies; privacy reviews.</li><li><strong>L4</strong>: Runtime protections; attack simulations; SBOM &amp; provenance in pipeline.</li><li><strong>L5</strong>: Continuous red‑team automation; least‑privilege drift detection.</li></ul><h3>7) AI Testing (LLMs/GenAI)</h3><ul><li><strong>L1</strong>: No AI in scope.</li><li><strong>L2</strong>: Prompt experiments offline; manual acceptance.</li><li><strong>L3</strong>: Offline <strong>evaluation harness</strong> with golden datasets; prompt &amp; config versioning; <strong>cost/latency budgets</strong>; basic toxicity filter.</li><li><strong>L4</strong>: <strong>Eval gates in CI</strong> (acceptance thresholds on accuracy/factuality); <strong>prompt regression</strong> suite; jailbreak &amp; bias tests; PII redaction; observability for LLM calls.</li><li><strong>L5</strong>: Continuous <strong>red teaming</strong>; drift &amp; model‑change detection; human‑in‑the‑loop feedback; fairness metrics; automatic rollback on eval regressions.</li></ul><h3>8) CI/CD &amp; Platform</h3><ul><li><strong>L1</strong>: Manual releases.</li><li><strong>L2</strong>: CI on PRs; a few pipelines scripted.</li><li><strong>L3</strong>: <strong>GitHub Actions</strong> templates; Terraform modules; standardized release flow.</li><li><strong>L4</strong>: Progressive delivery (canary, feature flags); change failure rate tracked (DORA).</li><li><strong>L5</strong>: Platform paved‑roads, policy‑as‑code, enterprise scorecards.</li></ul><blockquote><strong><em>Directional targets (tune per risk):</em></strong><em> critical code </em><strong><em>automation ≥60%</em></strong><em> by L3, </em><strong><em>≥80%</em></strong><em> by L4; mutation score on core packages; contract tests for top‑N APIs by L3; synthetics for top user journeys by L4.</em></blockquote><h3>Quick scorecard (self‑assessment)</h3><p>Score <strong>0/1/2</strong> for each item (0 = not in place, 1 = partial/pilot, 2 = solid &amp; repeatable). Sum and map to a level.</p><p><strong>Strategy &amp; Ownership</strong></p><ul><li>Quality strategy doc per product/service exists and is used.</li><li>Risk‑based test matrix drives scope per release.</li></ul><p><strong>Architecture &amp; Environments</strong></p><ul><li>Ephemeral envs with seeded data for PRs/features.</li><li>Staging is prod‑like (infra, config, data shape).</li></ul><p><strong>Test Automation</strong></p><ul><li>Contract tests on top APIs; E2E only for critical journeys.</li><li>Coverage &amp; mutation budgets on critical code paths.</li></ul><p><strong>Performance &amp; Reliability</strong></p><ul><li>k6 baseline in CI; perf budgets enforced.</li><li>SLOs (latency, availability) defined and monitored.</li></ul><p><strong>Observability &amp; Synthetics</strong></p><ul><li>Traces + RED/USE dashboards.</li><li>Synthetics cover top 5 journeys with on‑failure issue creation.</li></ul><p><strong>Security &amp; Privacy</strong></p><ul><li>SAST/DAST, SBOM, secrets scanning in CI; threat modeling practiced.</li></ul><p><strong>AI Testing</strong></p><ul><li>Offline eval harness with golden sets; accuracy/factuality tracked.</li><li>CI eval gates; jailbreak/toxicity/bias tests executed per change.</li></ul><p><strong>CI/CD &amp; Platform</strong></p><ul><li>Standard pipeline templates and Terraform modules adopted.</li><li>Progressive delivery (canary/flags) with automatic rollback criteria.</li></ul><p><strong>Interpretation (guide):</strong> 0–12 ≈ L1, 13–20 ≈ L2, 21–28 ≈ L3, 29–34 ≈ L4, 35–40 ≈ L5.</p><h3>90‑day adoption playbook (move one level up)</h3><p><strong>Day 0: Baseline</strong><br> Run the scorecard with leads. Pick <strong>one target level</strong> (e.g., L2→L3). Convert to OKRs.</p><p><strong>Day 1–30: Lay foundations</strong></p><ul><li>Create the <strong>Quality Strategy</strong> template (risk matrix, types of tests, envs, metrics).</li><li>Stand up <strong>contract tests</strong> for top 3 APIs; add to CI.</li><li>Add <strong>k6 smoke</strong> for 2 critical endpoints; store results.</li></ul><p><strong>Day 31–60: Make it visible</strong></p><ul><li>Wire <strong>SLO dashboards</strong> (latency, availability, error rate).</li><li>Add <strong>synthetics</strong> for top 2 user journeys.</li><li>Introduce <strong>AI eval harness</strong> on one LLM use case (200 golden prompts, pass‑rate ≥85%).</li></ul><p><strong>Day 61–90: Enforce &amp; scale</strong></p><ul><li>Turn on <strong>coverage/mutation budgets</strong> on critical modules.</li><li>Add <strong>CI eval gates</strong> for the AI use case (block on regressions).</li><li>Run a <strong>chaos gameday</strong> and publish learnings.</li></ul><p><strong>Example OKRs</strong></p><ul><li><em>O</em>: Reach L3 for Checkout &amp; Catalog by Q4.</li><li><em>KR1</em>: ≥60% automation on risk‑critical code; E2E only for 3 golden paths.</li><li><em>KR2</em>: Contract tests on top 5 APIs with CI gates.</li><li><em>KR3</em>: SLO dashboards live; synthetics on top 5 journeys.</li><li><em>KR4</em>: LLM eval harness (≥85% pass on golden set), CI gate enabled.</li></ul><h3>Metrics that matter (beyond coverage)</h3><ul><li><strong>Reliability</strong>: SLOs (p95 latency, availability), error budgets, incident MTTR.</li><li><strong>Delivery</strong>: DORA (lead time, deploy frequency, change failure rate, MTTR).</li><li><strong>Quality</strong>: escaped defects per release, flaky test rate, mutation score.</li><li><strong>Contracts</strong>: provider/consumer breakage rate, schema drift.</li><li><strong>Performance</strong>: saturation vs. demand, regression deltas vs. baseline.</li><li><strong>AI</strong>: factuality/accuracy, <strong>hallucination rate</strong>, toxicity/jailbreak rate, bias deltas, p95 latency &amp; cost/request, safety filter hit‑rate.</li></ul><h3>Tooling examples (technology‑agnostic, stack‑friendly)</h3><ul><li><strong>Automation</strong>: Playwright + TypeScript, Jest, contract tests (Pact‑style or schema‑first).</li><li><strong>Performance</strong>: k6 (local, CI, or cloud).</li><li><strong>Observability</strong>: Prometheus metrics, Grafana/Alloy, traces.</li><li><strong>Security</strong>: SAST/DAST, SBOM (e.g., Syft/Grype), secrets scanning.</li><li><strong>AI Testing</strong>: offline eval harness (golden sets), prompt versioning, guardrails (toxicity/PII), CI gates.</li></ul><blockquote><em>Use what fits your context; standardize interfaces and results, not brands.</em></blockquote><h3>FAQ</h3><p><strong>Isn’t a maturity model rigid?</strong><br> It’s a <strong>navigation aid</strong>, not a compliance checklist. Use it to guide sequencing and trade‑offs.</p><p><strong>Do we need 90% coverage?</strong><br> Use <strong>risk‑based</strong> targets. High coverage on critical code; lighter elsewhere. Prefer mutation/testing effectiveness over raw coverage.</p><p><strong>Where do we start with AI testing?</strong><br> Pick one user‑visible use case. Build a <strong>golden set</strong>, define acceptance thresholds, wire a minimal eval harness, then add safety/latency/cost.</p><h3>Credits &amp; further reading</h3><ul><li>Martin Fowler — <em>Maturity Model</em>.</li><li>Google SRE — SLOs &amp; error budgets.</li><li>ThoughtWorks — Continuous Delivery &amp; Testing in Production.</li></ul><h3>Feel free to adapt for your team with attribution.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f82ae769237" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shadow DOM Testing That Doesn’t Flake (Using Playwright)]]></title>
            <link>https://medium.com/@erik.amaral/shadow-dom-testing-that-doesnt-flake-using-playwright-1c9313d086d3?source=rss-1b71fd253fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c9313d086d3</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Erik Fernandes Amaral]]></dc:creator>
            <pubDate>Sun, 31 Aug 2025 18:26:11 GMT</pubDate>
            <atom:updated>2025-09-01T01:49:29.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZhoF8U-rB3AlR2yyeJQoQ.png" /></figure><p>Why Jest/RTL struggle with Shadow DOM, and how Playwright gives you stable, cross-browser UI tests for real components.</p><p>Shadow DOM encapsulates markup and styles inside components. That’s great for design systems — but it breaks most <strong>query</strong> strategies in Jest/RTL. If you’ve tried getByRole, getByTestId, or even raw querySelector and still can’t “see” inside the component, you’ve hit that wall.</p><p><strong>Playwright</strong> solves this at the <strong>UI level</strong>: its <strong>Locators</strong> naturally pierce the Shadow DOM, work cross-browser (Chromium/WebKit/Firefox), and ship with first-class tooling (trace viewer, codegen, parallelism, CI-friendly).</p><p>This post shows a small, production-ready setup and patterns that keep tests <strong>readable</strong> and <strong>stable</strong>.</p><h3>The problem with Jest/RTL inside Shadow DOM</h3><ul><li>Shadow DOM <strong>encapsulation</strong> prevents ordinary DOM queries from seeing internal nodes.</li><li>Even when you mock, you end up <strong>unit-testing implementation details</strong>, not behavior.</li><li>Result: <strong>gaps in coverage</strong> and missed regressions in critical UI pieces.</li></ul><h3>Why Playwright</h3><ul><li><strong>Locators pierce Shadow DOM</strong>: locator() / getByRole() can resolve elements inside web components.</li><li><strong>Cross-browser</strong>: run the same tests on Chromium, WebKit, and Firefox in CI.</li><li><strong>CI-first</strong>: parallel runs, HTML report, traces/screenshots on failure.</li><li><strong>Works at the right level</strong>: validates <strong>visual &amp; interactive behavior</strong>.</li></ul><p>Adopted across the Web Components ecosystem (e.g. Lit, Spectrum Web Components, LWC) for good reason.</p><h3>Example: “@unit-ui Login Flow”</h3><p>This keeps scope tight: <strong>fields visible</strong> + <strong>navigation to password recovery</strong>.<br> It uses an env var for base URL so you can run locally or against a preview.</p><pre>// tests/e2e/login.unit-ui.spec.ts<br>import { test, expect } from &#39;@playwright/test&#39;;<br><br>test.describe(&#39;@unit-ui Login Flow&#39;, () =&gt; {<br>  const baseUrl = process.env.BASE_URL ?? &#39;http://localhost:3001&#39;;<br><br>  test(&#39;displays login fields and buttons&#39;, async ({ page }) =&gt; {<br>    await page.goto(`${baseUrl}/login`);<br>    await expect(page.locator(&#39;input[name=&quot;email&quot;]&#39;)).toBeVisible();<br>    await expect(page.locator(&#39;input[name=&quot;password&quot;]&#39;)).toBeVisible();<br>    await expect(page.getByRole(&#39;button&#39;, { name: /entrar|login/i })).toBeVisible();<br>    await expect(<br>      page.getByRole(&#39;button&#39;, { name: /esqueci a senha|forgot password/i })<br>    ).toBeVisible();<br>  });<br><br>  test(&#39;navigates to password recovery and returns&#39;, async ({ page }) =&gt; {<br>    await page.goto(`${baseUrl}/login`);<br>    await page.getByRole(&#39;button&#39;, { name: /esqueci a senha|forgot password/i }).click();<br>    await expect(page.locator(&#39;input[name=&quot;email&quot;]&#39;)).toBeVisible();<br>    await expect(page.getByRole(&#39;button&#39;, { name: /voltar|back/i })).toBeVisible();<br>    await page.getByRole(&#39;button&#39;, { name: /voltar|back/i }).click();<br>    await expect(page.locator(&#39;input[name=&quot;password&quot;]&#39;)).toBeVisible();<br>  });<br>});</pre><blockquote><em>💡 </em><strong><em>Shadow DOM note</em></strong><em><br> You don’t need special “deep” selectors. Playwright </em><strong><em>locators</em></strong><em> traverse shadow roots by default, so patterns like<br> </em><em>page.getByTestId(&#39;login-form&#39;).getByLabel(&#39;Email&#39;)<br> work even if the textbox is inside a web component.</em></blockquote><h3>Project setup</h3><p><strong>1) Install</strong></p><pre>npm i -D @playwright/test<br>npx playwright install</pre><p><strong>2) </strong><strong>playwright.config.ts</strong></p><pre>import { defineConfig, devices } from &#39;@playwright/test&#39;;<br><br>export default defineConfig({<br>  testDir: &#39;./tests/e2e&#39;,<br>  timeout: 30_000,<br>  expect: { timeout: 5_000 },<br>  use: {<br>    headless: true,<br>    baseURL: process.env.BASE_URL ?? &#39;http://localhost:3001&#39;,<br>    trace: &#39;on-first-retry&#39;,<br>    screenshot: &#39;only-on-failure&#39;,<br>    video: &#39;retain-on-failure&#39;,<br>  },<br>  projects: [<br>    { name: &#39;Chromium&#39;, use: { ...devices[&#39;Desktop Chrome&#39;] } },<br>    { name: &#39;WebKit&#39;,   use: { ...devices[&#39;Desktop Safari&#39;] } },<br>    { name: &#39;Firefox&#39;,  use: { ...devices[&#39;Desktop Firefox&#39;] } },<br>  ],<br>  // Optional: auto-run your dev server for local runs<br>  // webServer: { command: &#39;npm run dev&#39;, port: 3001, reuseExistingServer: !process.env.CI },<br>});</pre><p><strong>3) </strong><strong>package.json script</strong></p><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;test:playwright:unit-ui&quot;: &quot;playwright test --grep @unit-ui --workers=4 --reporter=html&quot;<br>  }<br>}</pre><p><strong>4) </strong><strong>.gitignore</strong></p><pre>playwright-report/<br>test-results/</pre><h3>CI: GitHub Actions (minimal)</h3><pre>playwright-unit-ui:<br>  needs: [feature-branch, prepare-job]<br>  runs-on: ubuntu-latest<br>  steps:<br>    - uses: actions/checkout@v4<br><br>    - uses: actions/setup-node@v4<br>      with:<br>        node-version: ${{ env.NODE_VERSION }}<br>        cache: &#39;npm&#39;<br><br>    - name: Configure registry<br>      run: |<br>        echo &quot;registry=https://&lt;your-registry&gt;&quot; &gt; ~/.npmrc<br>        echo &quot;//&lt;your-registry&gt;/:_authToken=${{ secrets.AZURE_TOKEN }}&quot; &gt;&gt; ~/.npmrc<br><br>    - uses: actions/cache@v4<br>      with:<br>        path: node_modules<br>        key: node-modules-${{ hashFiles(&#39;package-lock.json&#39;) }}<br><br>    - run: npm ci<br><br>    - name: Install Playwright browsers<br>      run: npx playwright install --with-deps<br><br>    - name: Run Playwright Unit UI<br>      env:<br>        BASE_URL: https://${{ needs.prepare-job.outputs.branch }}.release.seller.ze.delivery<br>      run: npm run test:playwright:unit-ui<br><br>    - name: Upload HTML report<br>      if: always()<br>      uses: actions/upload-artifact@v4<br>      with:<br>        name: playwright-unit-ui-report<br>        path: playwright-report/</pre><h3>Shadow DOM patterns that stay stable</h3><ul><li><strong>Prefer ARIA over test IDs</strong>: getByRole, getByLabel create resilient tests — also inside Shadow DOM via locators.</li><li><strong>Chain locators through components</strong>:<br> page.getByTestId(&#39;login-form&#39;).getByRole(&#39;textbox&#39;, { name: /email/i })</li><li><strong>Use </strong><strong>:has() for stateful queries</strong> (parent that “has” a child):<br> page.locator(&#39;form:has(input[name=&quot;email&quot;])&#39;)</li><li><strong>Wait on UI, not time</strong>: rely on Playwright’s auto-waiting and expect(...).toBeVisible() instead of sleeps.</li><li><strong>Scope tests</strong>: keep flows short; use tags like @unit-ui to filter in CI.</li></ul><h3>Why this works (quick table)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*0xA4cjxsvHZ4C4N25Ltsug.png" /></figure><h3>References</h3><ul><li>Playwright Locators &amp; Shadow DOM — <a href="https://playwright.dev/docs/locators?utm_source=chatgpt.com#locate-in-shadow-dom">https://playwright.dev/docs/locators#locate-in-shadow-dom</a></li><li>Lit testing docs — <a href="https://lit.dev/docs/tools/testing/?utm_source=chatgpt.com">https://lit.dev/docs/tools/testing/</a></li><li>Spectrum Web Components — <a href="https://github.com/adobe/spectrum-web-components?utm_source=chatgpt.com">https://github.com/adobe/spectrum-web-components</a></li><li>open-wc testing — <a href="https://github.com/open-wc/open-wc/tree/main/packages/testing?utm_source=chatgpt.com">https://github.com/open-wc/open-wc/tree/main/packages/testing</a></li><li>(Bonus) Cypress Shadow DOM best practices — <a href="https://docs.cypress.io/guides/references/best-practices?utm_source=chatgpt.com#Shadow-DOM">https://docs.cypress.io/guides/references/best-practices#Shadow-DOM</a></li></ul><h3>From Codegen to Clean Tests (AI-assisted)</h3><p><strong>What codegen is:</strong> Playwright’s codegen opens a real browser, records your interactions, and outputs a runnable script. It’s perfect to <em>discover selectors</em> (including inside <strong>Shadow DOM</strong>) and quickly map a flow before you refactor into a clean test.</p><p><strong>Before you start</strong></p><ul><li>Run your app locally (e.g., http://localhost:3001) or set BASE_URL.</li><li>Use stable, accessible labels (roles/names). Avoid coordinates.</li><li>Don’t record secrets/PII while clicking around.</li></ul><p><strong>1) Record with codegen</strong></p><pre># Start from the login page (adjust the URL if needed)<br>npx playwright codegen http://localhost:3001/login</pre><p>Click the elements you care about (email/password inputs, <strong>Forgot password</strong>, <strong>Back</strong>, etc.).<br> When you’re done, close the recorder and <strong>copy the generated code</strong>.</p><p><strong>2) Convert to a real @unit-ui test (AI prompt)</strong><br> Paste the raw codegen output into ChatGPT (or your AI tool) with this prompt:</p><pre>Please transform the following Playwright codegen output into a clean @unit-ui test.<br>Requirements:<br>- Wrap with test.describe(&#39;@unit-ui Login Flow&#39;, ...).<br>- Use const baseUrl = process.env.BASE_URL ?? &#39;http://localhost:3001&#39;.<br>- Prefer page.locator(...) and getByRole(...) over brittle selectors.<br>- Assert with expect(...).toBeVisible() only (no timeouts/sleeps).<br>- Keep test names clear and the flow short (visibility + simple navigation).<br>Here is the raw codegen snippet:<br>&lt;PASTE HERE&gt;</pre><p><strong>3) Example of the expected result (shape)</strong></p><pre>import { test, expect } from &#39;@playwright/test&#39;;<br><br>test.describe(&#39;@unit-ui Login Flow&#39;, () =&gt; {<br>  const baseUrl = process.env.BASE_URL ?? &#39;http://localhost:3001&#39;;<br>  test(&#39;displays login fields and actions&#39;, async ({ page }) =&gt; {<br>    await page.goto(`${baseUrl}/login`);<br>    await expect(page.locator(&#39;input[name=&quot;email&quot;]&#39;)).toBeVisible();<br>    await expect(page.locator(&#39;input[name=&quot;password&quot;]&#39;)).toBeVisible();<br>    await expect(page.getByRole(&#39;button&#39;, { name: /login|entrar/i })).toBeVisible();<br>    await expect(page.getByRole(&#39;button&#39;, { name: /forgot password|esqueci a senha/i })).toBeVisible();<br>  });<br>  test(&#39;navigates to recovery and back&#39;, async ({ page }) =&gt; {<br>    await page.goto(`${baseUrl}/login`);<br>    await page.getByRole(&#39;button&#39;, { name: /forgot password|esqueci a senha/i }).click();<br>    await expect(page.locator(&#39;input[name=&quot;email&quot;]&#39;)).toBeVisible();<br>    await page.getByRole(&#39;button&#39;, { name: /back|voltar/i }).click();<br>    await expect(page.locator(&#39;input[name=&quot;password&quot;]&#39;)).toBeVisible();<br>  });<br>});</pre><h3>Final thoughts</h3><p>Don’t fight the Shadow DOM at unit level. Test <strong>components</strong> the way users experience them — with Playwright locators, cross-browser. Keep flows small, assertions meaningful, and let CI do the heavy lifting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c9313d086d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalable Test Architecture: Maintainability, Organization and Autonomy]]></title>
            <link>https://medium.com/@erik.amaral/scalable-test-architecture-maintainability-organization-and-autonomy-6eb8521b2ff0?source=rss-1b71fd253fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6eb8521b2ff0</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[quality-engineering]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Erik Fernandes Amaral]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 01:12:49 GMT</pubDate>
            <atom:updated>2025-04-03T01:19:34.928Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>How separating and distributing your tests can make your development cycle more efficient, reliable, and easier to maintain.</blockquote><h3>Introduction</h3><p>Building a robust test pipeline is one of the main challenges in continuous software delivery. On one hand, quality must be ensured with every release. On the other, testing should never become a bottleneck that slows down the team’s agility.</p><p>This article presents a scalable test architecture that distributes responsibilities across squads and test types. It also explains why monorepos for tests should be avoided, and why only unit tests (and, if necessary, security checks) should live within the application’s main repository.</p><p>This approach can be applied to any organizational structure and is especially valuable for companies looking to grow without compromising team autonomy or delivery quality.</p><h3>Why a Decentralized Test Architecture?</h3><h4>1. Scalability and Maintainability</h4><p>When tests are decentralized, each squad manages its own set of test responsibilities — avoiding a bloated and complex monorepo. Key benefits include:</p><ul><li><strong>Scalability</strong>: new squads can evolve independently without relying on centralized pipelines.</li><li><strong>Localized maintenance</strong>: changes affect only the relevant service scope, reducing the risk of cross-regressions.</li></ul><h4>2. Autonomy and Structure</h4><p>Keeping only unit and security tests inside the application repository ensures quick feedback and a clean development cycle.</p><p>All other test types — such as regression, E2E, integration, contract, and performance — should be organized in <strong>separate repositories</strong>, preferably by squad or domain. This structure improves test ownership, simplifies maintenance, and allows different layers of testing to evolve independently.</p><h4>3. Alignment with Software Architecture Best Practices</h4><p>Authors like Jez Humble, Nicole Forsgren, Martin Fowler, and Robert C. Martin highlight the importance of <strong>low coupling</strong>, <strong>high cohesion</strong>, and <strong>modularity</strong>. These same principles apply to testing strategy, supporting a sustainable, flexible, and robust structure.</p><h3>Test Execution Across the Delivery Pipeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*hpIS1LDzKHjKnJD3YfpbQA.png" /></figure><p>Beyond separating repositories, it’s important to define <strong>when and where</strong> each type of test should run in the CI/CD pipeline.</p><ul><li><strong>Unit and security tests</strong> run on every push, ensuring local validation and fast feedback.</li><li><strong>Integration and contract tests</strong> run in QA to validate inter-service communication.</li><li><strong>Regression and E2E tests</strong> cover business flows and run after stable builds.</li><li><strong>Performance tests</strong> can be run on demand or scheduled.</li><li><strong>Synthetic tests in production</strong> are executed periodically to monitor real-world functionality and stability.</li></ul><h3>Keep E2E and Regression Tests in Repositories per Squad or Business Context</h3><p>Storing high-level tests — such as regression and E2E — in <strong>separate repositories by squad or domain</strong> is essential for ensuring:</p><ul><li><strong>Low coupling between teams</strong><br> Each team evolves their tests without affecting other squads’ workflows.</li><li><strong>Organization by business context</strong><br> Tests reflect domain-specific logic, with dedicated rules and data.</li><li><strong>Easier maintenance</strong><br> Refactoring and fixing tests is localized, reducing ecosystem-wide impact.</li><li><strong>Natural scalability</strong><br> Avoids bottlenecks in centralized pipelines and allows parallel execution.</li><li><strong>Reduced flakiness</strong><br> Isolated test contexts are more predictable, with less variability in environment and data.</li></ul><h3>What to Avoid</h3><h4>Monolithic Test Repositories</h4><ul><li>Increase pipeline complexity</li><li>Create unnecessary dependencies between teams</li><li>Lead to merge conflicts and hard-to-maintain code</li><li>Are more prone to flaky and unstable tests over time</li></ul><h4>E2E Tests Inside the Application Repository</h4><ul><li>Slow down builds and test execution</li><li>Create tight coupling between product code and test logic</li><li>Make technical evolution and refactoring harder</li></ul><h3>Conclusion</h3><p>Adopting a scalable test architecture — with responsibilities distributed across test layers and squads — is essential to maintaining quality without slowing down delivery.</p><p>By keeping unit and security tests close to the application, and organizing high-level tests in independent repositories per domain or team, you foster greater autonomy, reliability, and clarity.</p><p>This approach strengthens engineering culture, reduces unnecessary coupling, and prepares your organization to grow safely and confidently.</p><h3>References</h3><ul><li><em>Continuous Delivery</em> — Jez Humble &amp; David Farley</li><li><em>Accelerate</em> — Nicole Forsgren, Jez Humble &amp; Gene Kim</li><li><em>Software Architecture in Practice</em> — Len Bass, Paul Clements &amp; Rick Kazman</li><li><em>Clean Architecture</em> — Robert C. Martin</li><li>Martin Fowler — Testing Strategies</li><li>ThoughtWorks — Tech Radar</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eb8521b2ff0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Testing: What Counts as Good Performance & Scalability for APIs and Message Queues?]]></title>
            <link>https://medium.com/@erik.amaral/testes-de-carga-o-que-%C3%A9-considerada-uma-boa-performance-e-escalabilidade-de-apis-e-kafka-e553cb00de92?source=rss-1b71fd253fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e553cb00de92</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[message-queue]]></category>
            <category><![CDATA[performance-testing]]></category>
            <dc:creator><![CDATA[Erik Fernandes Amaral]]></dc:creator>
            <pubDate>Sat, 10 Aug 2024 19:41:53 GMT</pubDate>
            <atom:updated>2025-09-24T03:33:42.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j52F6z7slQd-dYxLnG4w2A.png" /></figure><h3>Load Testing: What Counts as Good Performance &amp; Scalability for APIs and Message Queues? And How Do You Measure It?</h3><h3>What’s considered “good” today?</h3><p>For modern, well-tuned systems (context matters!), reasonable reference ranges are:</p><ul><li>APIs: roughly 200–1,000 TPS sustained with predictable latency under load.</li><li>Message queues (RabbitMQ/SQS/Kafka, etc.): thousands to tens of thousands msgs/s per cluster or consumer group when properly tuned (hardware, persistence mode, acks, ordering, and batching all change the ceiling).</li></ul><p>Treat these as conversation starters, not hard rules. Your targets must come from <em>your</em> traffic patterns, cost envelope, and risk tolerance.</p><h3>Calibrate with your own data</h3><ol><li><strong>Inspect recent peaks:</strong> what TPS/msg-s did you actually hit in the last 30–90 days?</li><li><strong>Add headroom:</strong> plan for <strong>P95 peak × 1.5–2.0</strong> as a first target.</li><li><strong>Turn into SLOs:</strong> latency, error rate, backlog depth/age, and cost per unit of work.</li></ol><h3>How do I know if my system is scalable, fast, and resilient?</h3><p>Run different load test types — each answers a different question:</p><h3>Load test types</h3><ul><li><strong>Smoke:</strong> Does it work at baseline?</li><li><strong>Load:</strong> Meets <strong>expected</strong> traffic with target SLIs/SLOs?</li><li><strong>Stress:</strong> Where (and how) does it break?</li><li><strong>Soak:</strong> Hours of stability (memory, throttling, GC, connection churn).</li><li><strong>Spike:</strong> Can it absorb sudden jumps?</li><li><strong>Breakpoint:</strong> Exact point where SLOs are no longer met.</li></ul><h3>Useful tools</h3><ul><li><strong>k6</strong> (JS-based, CI-friendly), <strong>JMeter</strong> (classic, many protocols), <strong>Locust</strong> (Pythonic, scalable).</li><li><strong>Broker-native perf tools</strong> (e.g., producers/consumers that publish/consume at controlled rates) are great complements.</li></ul><h3>Observability: what to watch while you test</h3><h3>For HTTP APIs</h3><ul><li>Latency percentiles (p50/p90/p95/p99) — end-to-end request time.</li><li><em>Example SLO:</em> p95 ≤ 300 ms at target TPS; p99 ≤ 800 ms.</li><li>Error rate — 5xx + policy 4xx. <em>SLO:</em> &lt;1% under load.</li><li>Saturation — CPU, memory, connection pools, GC pause time, DB pool saturation.</li><li>Guardrails: CPU ≤ 70–75% avg; pools &lt; 85% utilization.</li><li>Throughput — sustained vs offered TPS.</li><li>Tail stability — small jitter at p99 across the window.</li><li>Cost per request (esp. serverless).</li></ul><p><strong>API dashboard hints:</strong> request duration histogram + percentiles, total requests &amp; failures, dependency (DB/cache/HTTP) latency &amp; errors, CPU/memory, GC/threads, queue depth between tiers.</p><h3>For message queues (RabbitMQ, SQS, Kafka, etc.)</h3><p>Focus on flow (in vs. out), backlog health, and end-to-end delay:</p><ul><li>Enqueue rate (msgs/s) vs Consume rate (msgs/s)</li><li><em>Goal:</em> steady state at target volume with consume ≥ enqueue.</li><li>Backlog depth (number of messages waiting) and backlog age/oldest message age</li><li><em>SLO example:</em> time-lag ≤ 5s for business-critical flows (or ≤30s for best-effort) at target ingest.</li><li>End-to-end latency (produce → consume/ack or sink)</li><li><em>SLO example:</em> p95 ≤ 1–2s under expected volume.</li><li>Redelivery / DLQ rate and NACKs</li><li><em>SLO example:</em> redeliveries &lt; 0.1%; DLQ &lt; 0.01% under steady load.</li><li>Consumer concurrency / prefetch and ack behavior (at-least-once vs at-most-once)</li><li>Broker saturation — CPU, memory, disk I/O, file descriptors, replication health, shard/partition/queue leaders, connection churn.</li><li>Rebalance/resubscribe frequency or connection resets during load.</li></ul><blockquote><em>Tip: put API and queue metrics side-by-side — lots of “API slowness” is downstream pressure (queues, DB, external deps).</em></blockquote><h3>Reading results: a simple acceptance template</h3><p>API success criteria</p><ul><li>Sustained X TPS for Y minutes</li><li>p95 ≤ A ms, p99 ≤ B ms, error rate &lt; 1%</li><li>CPU ≤ 70%, memory stable, dependencies within baseline + Δ</li></ul><p><strong>Queue success criteria</strong></p><ul><li>Ingest: N msgs/s, Consume: ≥ N msgs/s (steady state)</li><li>Backlog depth stable, oldest message age/time-lag ≤ T seconds (p95)</li><li>Redeliveries &lt; 0.1%, DLQ &lt; 0.01%</li><li>No replication/leader health issues under target load</li></ul><p>Turn this into a checklist in CI and a short one-pager after each run (what changed, improvements/regressions, next actions).</p><h3>Example load plan (API + queue)</h3><ol><li><strong>Baseline smoke</strong> (5–10 min) at 10–20% of target.</li><li><strong>Load</strong> to target TPS/msg-s (30–60 min).</li><li><strong>Spike</strong> to 2× target for 2–5 min.</li><li><strong>Soak</strong> 2–4 h at 70–100% target.</li><li><strong>Stress</strong> until SLO breach; record <strong>breakpoint</strong> and failure mode.</li></ol><p><strong>Automation:</strong> run k6/JMeter/Locust in CI (scheduled and on-PR), stream to <strong>Prometheus + Grafana</strong> (or AppDynamics/Dynatrace/Datadog), and keep a compact status report.</p><h3>Conclusion</h3><p>Load testing is how you prove your system can meet demand — especially when APIs and message queues carry the core traffic. Start from sensible references, calibrate with your own peaks, run the right mix of tests, and watch the right SLIs: latency, error rate, saturation, and backlog depth/age. Then lock it in with SLOs and CI gates.</p><h3>Sources</h3><ul><li>Principles of scalable APIs &amp; microservices</li><li>Vendor docs for major brokers (RabbitMQ, AWS SQS, Kafka)</li><li>Grafana — Load testing and observability best practices</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e553cb00de92" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>