<?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 eduardo aparicio cardenes on Medium]]></title>
        <description><![CDATA[Stories by eduardo aparicio cardenes on Medium]]></description>
        <link>https://medium.com/@byeduardoac?source=rss-321e9c45ae3e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JW0Uf1LmspYHe64cl9tfMg.jpeg</url>
            <title>Stories by eduardo aparicio cardenes on Medium</title>
            <link>https://medium.com/@byeduardoac?source=rss-321e9c45ae3e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 08:09:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@byeduardoac/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[My latest engineering articles are now on eduardoac.dev — Retiring my medium blog]]></title>
            <link>https://medium.com/@byeduardoac/my-latest-engineering-articles-are-now-on-eduardoac-dev-retiring-my-medium-blog-4e15636c93ba?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e15636c93ba</guid>
            <category><![CDATA[mentorship]]></category>
            <category><![CDATA[engineering-leadership]]></category>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[frontend-architecture]]></category>
            <category><![CDATA[software-testing-strategy]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 07:46:40 GMT</pubDate>
            <atom:updated>2026-07-06T07:46:40.361Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gB1pOVLUW3XNphc1Dsow9w.png" /></figure><p>Thanks for all your support over the years. Medium has been my main channel for sharing with the community since 2016, giving me a decade of value with great tooling and content.</p><p>However, over time, it became clear that I needed a place of my own.</p><p>I wanted a space where I could unlock my ability to create my own content and build my brand as a software architect, mentor, and leader. Allowing me to achieve better and more effective content with the ability to tailor my articles in the way I want to communicate my thoughts and engage with the audience in a different and innovative way.</p><p>Therefore, I have started publishing my latest engineering articles directly on my own site:</p><p><a href="https://eduardoac.dev/blog">Engineering Blog | Eduardo Aparicio Cardenes</a></p><p>You can also connect with me on LinkedIn, where I share every new article:</p><p><a href="https://www.linkedin.com/in/eacardenes/">https://www.linkedin.com/in/eacardenes/</a></p><p>Medium has been a useful place for me to share technical writing over the years, but it has become just the canonical home for my articles. If you have been following my work across frontend architecture, testing strategy, payment systems, delivery confidence, and the kind of production lessons that are difficult to capture in isolation.</p><p>If you have been following my writing here, these are the latest articles now available on my site.</p><h3>New articles</h3><h3><a href="https://eduardoac.dev/blog/from-release-candidates-to-continuous-deployment-player-cashier-journey">Migrating from Release Candidates to Continuous Deployment: The Player Cashier Journey</a></h3><p>Published on 5 July 2026</p><p>This article tells the story of how Player Cashier moved from release candidates to continuous deployment.</p><p>It covers the delivery model we inherited, why manual promotion started to create friction, and how validation in isolation, trunk-based development, rollout automation, and operational confidence helped us move towards a safer release flow.</p><p>The main lesson is that continuous deployment is not only a tooling decision. Once a frontend surface becomes part of a live payment journey, the real question is whether the team can ship faster without making customers pay for the risk.</p><h3><a href="https://eduardoac.dev/blog/frontend-infrastructure-at-scale-aws-s3-cloudfront-migration">Frontend Infrastructure at Scale: Migrating AWS S3 and CloudFront Without Customer Disruption</a></h3><p>Published on 28 June 2026</p><p>This article goes deeper into frontend infrastructure.</p><p>It covers a migration from shared AWS S3 and CloudFront delivery to owned, auditable, jurisdiction-aware infrastructure for a critical payment frontend.</p><p>The work involved CloudFront distributions, S3 buckets, hosted zones, CSP, rollback paths, infrastructure ownership, and the practical challenge of changing the delivery model while customers were still using the payment journey.</p><p>The most successful infrastructure migration is usually the one nobody notices. That was the point.</p><h3><a href="https://eduardoac.dev/blog/the-initialisation-trap-in-typescript">The Initialisation Trap in TypeScript: When Your Types Describe a World Your Users Are Not In Yet</a></h3><p>Published on 21 June 2026</p><p>This article came from a practical TypeScript problem in a payment flow.</p><p>Sometimes our types describe the world we want the application to be in, while the user is still living through loading, bootstrapping, configuration, and partial state.</p><p>That gap can be easy to ignore when the UI eventually renders correctly. But in production systems, especially payment systems, the initialising state is part of the customer experience too.</p><p>The article explores nullability, readiness boundaries, discriminated unions, and how to make TypeScript model the runtime world honestly instead of pretending the application is ready before it is.</p><h3>What changes moving forward</h3><p>Going forward, all my new articles will be published on:</p><p><a href="https://eduardoac.dev/blog">https://eduardoac.dev/blog</a></p><p>I am also working on the subscription mechanism there, so readers can be notified when a new article becomes available.</p><p>Until that is ready, I wanted to share this update here with people who have followed my writing on Medium.</p><p>I will be retiring Medium as my main publishing channel in the coming year, and no new articles will be published here. My website is now the main home for the full archive and all future articles.</p><p>Thanks for reading and for following my decade-long journey on Medium.</p><p>If these topics resonate with you, I would be happy to see you over at <a href="https://eduardoac.dev/blog">eduardoac.dev/blog</a>. You can also follow me on LinkedIn, where I share every new article:</p><p><a href="https://www.linkedin.com/in/eacardenes/">https://www.linkedin.com/in/eacardenes/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e15636c93ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing Payment Flows with Outside-In Testing: A Practical Integration Testing Case Study — Part 2]]></title>
            <link>https://medium.com/@byeduardoac/testing-payment-flows-with-outside-in-testing-a-practical-integration-testing-case-study-part-2-2126c5f558dc?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2126c5f558dc</guid>
            <category><![CDATA[outside-in-testing]]></category>
            <category><![CDATA[integration-testing]]></category>
            <category><![CDATA[testing-strategies]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 21:59:36 GMT</pubDate>
            <atom:updated>2026-03-13T21:59:36.123Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XaswlZQpOFouYzCzVjnM8Q.png" /><figcaption><em>Opening framing: from customer journeys to actionable code, with integration acting as the confidence engine.</em></figcaption></figure><p>For years, inside-out testing felt like a sensible default. In Part 1, Outside-In Testing Strategy: Building Confidence for Continuous Deployment, I explained why outside-in testing is a more effective model for modern frontend systems, and why confidence should be built at the boundaries where the system meets reality.</p><p>That became increasingly important for me as frontend systems grew in complexity. What used to be a simpler collection of pages, components, and helper functions has evolved into a much richer orchestration layer.</p><p>Modern frontend applications coordinate APIs, embedded contexts, configuration, cross-platform contracts, redirects, experiments, and external providers. In that kind of environment, many of the most painful failures no longer live inside isolated units alone. They live where the system is entered, where state is resolved, where contracts are interpreted, and where control leaves the application and later returns.</p><p>That shift changed how I think about confidence.</p><p>Confidence does not come from testing more code in isolation and hoping trust grows from there. It comes from understanding the real shape of the system, identifying the boundaries where reality can break, and protecting the minimum journey that must always remain true for the product to deserve trust.</p><p>I also believe strongly in practice over theory. So rather than staying in the abstract, this second part walks through a real case study from one of the most sensitive and business critical areas of any product: payments.</p><p>More specifically, this article focuses on the <strong>Player Cashier</strong>, the UI payment experience used by customers across web, iOS, and Android. It is a good example because it is not just a page. It is an orchestration system embedded inside a wider product, with several runtime contracts shaping what the customer can actually do.</p><p>That makes it the perfect place to show how boundaries, customer journeys, and integration tests fit together into one coherent strategy.</p><p>In Player Cashier, every meaningful integration test protects a customer-visible truth at the boundary where production risk actually lives.</p><h3>The Player Cashier is a frontend system inside a larger system</h3><p>The Player Cashier powers deposit and withdrawal related payment interactions across multiple channels.</p><ul><li>On the web, it runs inside an iframe embedded in the host site.</li><li>On iOS and Android, the same experience is consumed inside native web views.</li></ul><p>That gives the team important benefits, especially around security and separation of concerns, but it also makes the system more than a simple screen. It becomes an embedded subsystem with contracts on both sides.</p><p>The architecture makes that clear. The internal cashier experience is intentionally separated from the host shells on one side and from backend services on the other.</p><ul><li>Adapters hide platform-specific communication details.</li><li>The API layer hides environment-specific request logic.</li></ul><p>Together, they keep the internal system focused, but they also define the exact places where risk enters the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPfWpZpI2v19_I-DxE53mw.png" /><figcaption><em>Player Cashier in context: host shells and backend sit outside the internal system, while adapters and the API layer define the most important runtime interfaces.</em></figcaption></figure><p>That architectural shape matters because it changes the testing conversation. If we reduce the Player Cashier to a collection of screens, components, and helper functions, it becomes easy to optimise for isolated validation while missing the places where real production risk actually enters the system.</p><p>But if we look at it as a frontend system inside a larger system, the meaningful questions become much clearer.</p><ul><li>How does it enter with the correct context?</li><li>How does it fetch and interpret backend data?</li><li>How does it communicate with the host platform?</li><li>How does it adapt safely when runtime configuration changes?</li></ul><p>These are not secondary implementation details. They are part of the product’s operating surface.</p><h3>Identifying the key boundaries of the Player Cashier</h3><p>Once I looked at the Player Cashier through an outside-in lens, four boundaries stood out.</p><ol><li><strong>The URL boundary:</strong> in an embedded application, the URL is not just navigation. It defines how the system is entered, what context is available, and which jurisdiction or environment assumptions the application starts with.</li><li><strong>The feature flag boundary:</strong> in payments, LaunchDarkly is not just a convenient rollout tool. It is part of the operating model. Kill switches and payment-group flags can change what the customer sees at runtime, which means configuration outside the application directly changes the journey inside it.</li><li><strong>The API boundary:</strong> payment methods, balances, configuration, and operational state are all resolved through backend calls. If that boundary is wrong, the UI may still render nicely while the customer journey fails in practice.</li><li><strong>The adapter boundary:</strong> the Player Cashier needs to communicate with web, iOS, and Android shells through stable interfaces even though those platforms behave differently under the hood. That makes the communication contract itself part of the system boundary.</li></ol><p>These are not abstract architectural notes. They are the points where production risk lives.</p><p>Once those boundaries are visible, the testing strategy becomes much clearer because the team can stop asking:</p><blockquote>What code should we test next?</blockquote><p>and start asking,</p><blockquote>What customer-visible truths must still hold when the system meets reality?</blockquote><h3>Defining the Player Cashier confidence loop</h3><p>Part 1 introduced the idea that confidence starts with the journey, then works inward towards the code. In payments, that shift matters because the customer does not care how the orchestration is implemented. They care that the right methods appear, that the amount can be entered or selected, that clicking deposit does what it promises, and that the system ends in the right outcome.</p><p>That is exactly what the confidence loop is meant to protect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nRXERSX3h4hvnJPWoLXMUw.png" /><figcaption><em>Outside-in framing: start from the customer journey, then validate the features, code paths, and contracts required to keep that journey true.</em></figcaption></figure><p>In the Player Cashier, the deposit and withdrawal journey can be described simply enough for any stakeholder to understand. At this stage, there are two core journey shapes for these transaction types: fully embedded journeys and external third-party journeys.</p><p><strong>External third-party journeys</strong></p><ol><li>The customer enters the cashier.</li><li>The available payment methods are shown.</li><li>A method is selected.</li><li>The amount or payment information is provided.</li><li>The payment journey is triggered.</li><li>The external provider flow takes over where necessary.</li><li>Control returns to the cashier through redirection.</li><li>Redirect state resolves.</li><li>The payment outcome is shown.</li></ol><p><strong>Fully embedded journeys</strong></p><ol><li>The customer enters the cashier.</li><li>The available payment methods are shown.</li><li>A method is selected.</li><li>The amount or payment information is provided.</li><li>The payment journey is triggered.</li><li>The relevant UI is shown integrated through SDKs.</li><li>Payment outcome resolves through an API response or SSE event.</li></ol><p>These are the loops that deserve protection first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ZPRFiZoo8rigzkP1pUWVg.png" /><figcaption><em>The deposit experience embedded inside the wider account area.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rhdYJ6pI42MX_MW39RJvUw.png" /><figcaption><em>The close-up view of the payment widget the customer actually interacts with.</em></figcaption></figure><p>These two journey shapes differ in how control moves through the system, but they share the same testing need.</p><p>In both cases, the confidence loop is the minimum journey that must remain true from entry to outcome.</p><p>The details of the payment route may change, but the need for the customer to see the right method, trigger the right action, and reach the right result does not.</p><h3>Why integration became the primary confidence engine</h3><p>Once the boundaries and the confidence loop became clear, the role of integration testing became much easier to understand.</p><p>A modern testing strategy still needs static checks and unit tests.</p><ul><li>Static checks give fast feedback on safety.</li><li>Unit tests help validate complex isolated business logic like taxation.</li><li>Selective end-to-end tests remain useful when the full environment itself must be proven.</li></ul><p>But in a payment orchestration frontend, <strong>integration tests</strong> <strong>become the widest part of the confidence model</strong> because it is the layer that can actually validate runtime context, feature flags, API responses, state transitions, adapter behaviour, and user-visible outcomes together.</p><p>That is why the testing trophy matters here. It does not say every kind of test has equal value. It shows that the greatest return comes from the tests that preserve the most meaningful customer behaviour while still providing stable and fast enough feedback for day-to-day engineering work. In the Player Cashier, that sweet spot sits squarely in integration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dq11c_2XvvRlI8JX6r7Sxw.png" /><figcaption><em>The practical hourglass: integration carries most of the pre-deployment confidence, while end-to-end remains more selective and slower.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L8y68Jr5hJZBj_jj43yvjw.png" /><figcaption><em>The wider testing trophy model: static and unit tests matter, but most customer-facing confidence sits higher up the stack. (credits to Daniel Alonso for illustration)</em></figcaption></figure><p>This is also why end-to-end cannot be the only answer. End-to-end gives maximum realism, but it also comes with slower feedback, more environmental fragility, more difficult debugging, and higher operational cost. In practice, integration becomes the place where confidence is most usable before deployment.</p><p>It is close enough to reality to matter, but controlled enough to remain trustworthy.</p><p>That is what makes the next examples useful: they are not isolated test snippets, but concrete proofs of how this confidence model works in practice.</p><h3>Code walkthrough: validating the customer reality in Player Cashier</h3><p>The most useful way to read the rest of this article is as a repeated split pattern.</p><p>At the top sits a customer-visible state or interaction. Underneath sits the integration test that proves that state is real. This is where the article stops being theory and becomes evidence.</p><p>That split matters because it links four things together at once:</p><ul><li>what the customer sees</li><li>which boundary is being exercised</li><li>what the test code is actually validating</li><li>why that test deserves confidence</li></ul><p>Each example in the following sections follows that same structure. The UI on top reflects the behaviour the customer experiences. The code underneath reflects the integration test that proves that behaviour is real.</p><p>That is the practical payoff of the strategy described so far. Once the boundaries are visible and the confidence loop is clear, the next step is to validate customer-visible truths where production risk actually enters the system.</p><p>From here, the article moves boundary by boundary, showing how the Player Cashier protects that reality in practice.</p><h3>Boundary 1: URL and environment context</h3><p>The first truth to protect is that the cashier boots into the correct environment.</p><p>In an embedded payment system, the journey starts before the first click. The domain and URL shape which runtime context is resolved, which jurisdiction is active, and what assumptions the system can safely make. If this boundary is wrong, everything that follows can be wrong too, even if the UI still renders.</p><p>The test underneath reflects that reality. It mounts the application with the expected stage domain, waits for the runtime to settle, then asserts that the store contains the environment context the cashier should have derived from the URL.</p><p>This is a good example of outside-in thinking: the team is not testing a helper in isolation; it is proving that the user entered the right system state before the visible journey even begins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxbWpSh52qPF8k8EHi9F8Q.png" /><figcaption><em>Split example for the URL boundary: the runtime context shown on top is the same context asserted by the integration test below.</em></figcaption></figure><h3>Boundary 2: Feature flags shape what the customer can do</h3><p>In payments, feature flags are operational controls like kill switches as much as experimentation tools.</p><p>A payment method may need to be turned off immediately. A payment group may need to be restricted for a specific rollout or environment. That means the customer-visible journey can change at runtime without any application code changing.</p><p>The split example makes that explicit. At the top, the disabled-state UI shows a warning instead of an active payment option. Underneath, the integration test sets the feature flag state and proves that the cashier renders the correct behaviour.</p><p>This is exactly why feature flags belong in the boundary model: they are external configurations that directly reshape the real product experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aE4GB-1kvqiIxXC24n-h6Q.png" /><figcaption><em>Split example for the feature flag boundary: the warning state shown to the customer is driven by the same flag state configured in the integration test.</em></figcaption></figure><h3>Boundary 3: The API layer is mocked at the boundary, not inside the journey</h3><p>The Player Cashier needs to preserve its real request path if the tests are going to be useful.</p><p>That is why Mock Service Worker is such a good fit. Instead of bypassing the API layer from inside the application, the tests replace the backend at the network boundary. The cashier still talks to its own API layer exactly as it would in production. The difference is that the response is controlled by the test.</p><p>This preserves the internal orchestration path while keeping the suite deterministic. It lets the team validate that the cashier interprets backend responses correctly, renders the right methods, and reacts to user actions in a realistic way. In other words, the backend is simulated where the system meets it, not where the customer journey depends on it.</p><p>This is an important principle of the whole strategy: <strong>we mock at the boundary, not inside the journey</strong>.</p><p>That is what keeps the test close to reality without giving up control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCdCYLAuf8gihlRv0aLL_g.png" /><figcaption><em>The MSW setup keeps the Player Cashier talking through the real API layer while the backend is replaced at the network boundary.</em></figcaption></figure><h3>Boundary 4, part one: The journey must reflect what the customer just did</h3><p>One of the simplest but most important customer truths in the deposit journey is that selecting a quick amount should actually update the amount the cashier will use.</p><p>The customer sees those buttons as real actions, not as decorative UI. So the test underneath proves that choosing 50, 150, or 200 updates the input field exactly as the interface promises.</p><p>This is a small example, but it shows why integration matters. The test validates the visible UI control, the interaction path, and the resulting state together. That is much closer to user reality than proving that a local value changed inside a single component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c5WPTfKaHDa38fQjRYJtpw.png" /><figcaption><em>Split example for the journey boundary: a customer-visible quick amount selection is matched by a test that validates the real update in the cashier state.</em></figcaption></figure><h3>Boundary 4, part two: Creating the deposit and withdrawal and handing off to the payment provider</h3><p>The strongest journey-level example is the one that goes beyond rendering and proves orchestration. Once the customer has selected an amount and clicked deposit:</p><ol><li>The cashier must create the deposit request</li><li>Receive the provider response</li><li>Redirect correctly into the payment journey.</li></ol><p>That is not a single unit of behaviour. It is the coordinated result of the URL context, the feature flag state, the API boundary, and the journey logic all holding together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*haPXjobxcOFz4e8pZKNpEw.png" /><figcaption><em>Split example for deposit creation: the visible deposit action above is backed by a test that validates the real request and redirect handoff to the payment provider.</em></figcaption></figure><p>The split view works especially well here.</p><p>The screenshot at the top shows the interface the customer trusts.</p><p>The integration test below proves that the click is meaningful: the request is created, the correct provider URL is produced, and the handoff to the payment journey happens as expected.</p><p>This is exactly the kind of test that earns trust because it protects a real business-critical transition, not just a local implementation detail.</p><h3>Bringing the Player Cashier testing strategy together</h3><p>Once you line these examples up, the strategy becomes much easier to see.</p><p>Each test is doing more than validating an isolated piece of behaviour. It is protecting a customer-visible truth at one of the boundaries where production risk actually enters the system.</p><ul><li>The URL boundary proves the cashier started in the correct context.</li><li>The feature flag boundary proves the customer is seeing the right runtime configuration.</li><li>The API boundary proves the cashier is interpreting backend reality correctly.</li><li>The journey-level tests prove that the visible interactions still lead to the real outcome the customer expects.</li></ul><p>This is why the strategy works.</p><p>If we review the methodology described at Part 1 for Outside-In Testing Strategy, confidence comes from protecting journeys, not isolated units. In Player Cashier, that means the most valuable tests are the ones that preserve customer truth where the system meets the world.</p><h4>Key takeaways</h4><ul><li>Confidence comes from protecting customer journeys, not just isolated units.</li><li>The Player Cashier testing strategy is shaped by four key boundaries: URL, feature flags, API, and adapters.</li><li>Integration tests are the primary confidence engine because they validate runtime context, configuration, orchestration, and user-visible outcomes together.</li><li>The value of the strategy is not test count. It is the amount of real production risk removed before release.</li><li>The outcome is a clearer path to releasing payment changes with confidence.</li></ul><h3>Player cashier testing strategy: what’s next</h3><p>This strategy is already useful, but it is not finished.</p><p>The next step is to deepen journey completion so more of the payment flow is validated end to end within the integration model before selective real end-to-end checks are added.</p><p>The adapter boundary can also be externalised further so communication across web, Android, and iOS can be validated more explicitly and with stronger cross-platform confidence. A practical next step here is to explore browser mode in Vitest 4 alongside iframe and web view scenarios, so the real adapter boundary can be exercised through integration tests whenever possible.</p><p>Beyond that, the same outside-in model should be extended into accessibility and visual validation. Payments do not only need to work logically.</p><p>They also need to be understandable, usable, and visually trustworthy for customers. That makes accessibility and visual checks natural next layers in the same confidence model, rather than separate concerns living outside it.</p><p>The strategy remains evolutionary: deepen the journey, harden cross-platform boundaries, and add accessibility and visual confidence deliberately.</p><h3>Closing thoughts</h3><p>The most important lesson from the Player Cashier is that the article and the test suite should tell the same story.</p><ul><li>The transaction type, payment option and methods are visible because a feature flag allowed it.</li><li>The amount changes because the customer selected it. A deposit starts because the cashier created the request and redirected correctly.</li><li>The system boots into the right state because the URL and environment context were resolved correctly.</li></ul><p>When the images on top and the code underneath say the same thing, the strategy becomes much easier to understand and much easier to trust.</p><p>That is the real promise of outside-in testing.</p><p>It gives the team a way to connect customer-visible behaviour, architecture boundaries, and engineering proof into one model. In a payment system, that is the difference between having tests and having confidence.</p><p>I hope you found this real case study useful. If it resonated with you, share it with your team, and feel free to reach out with comments or questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2126c5f558dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outside-In Testing Strategy: Building Confidence for Continuous Deployment — Part 1]]></title>
            <link>https://medium.com/@byeduardoac/outside-in-testing-strategy-building-confidence-for-continuous-deployment-part-1-9ee6cd888376?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ee6cd888376</guid>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[integration-testing]]></category>
            <category><![CDATA[trophy-of-testing]]></category>
            <category><![CDATA[outside-in-testing]]></category>
            <category><![CDATA[software-testing-strategy]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 19:49:14 GMT</pubDate>
            <atom:updated>2026-03-10T19:49:14.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Outside-in testing strategy extending the trophy of testing model for deliverying fast with confidence" src="https://cdn-images-1.medium.com/max/1024/1*C1WuKD2pK65-VX0hKzzolQ.png" /><figcaption>Outside-in testing strategy extending the trophy of testing model for deliverying fast with confidence</figcaption></figure><p>Last year, I joined a team responsible for one of the most critical areas of any digital product: payments.</p><p>The team was already delivering significant business value, but one challenge was clear. Time to market was still heavily shaped by long release cycles, which had become the default operating model across the company. Coming from teams that had already made the transition to continuous delivery or deployment, I saw an opportunity to help drive that shift here as well.</p><p>However, that kind of change does not happen just because a team wants it to. Very early on, I framed the problem around three pillars that had to be in place before continuous delivery could become realistic: reliable feature-branch validation, infrastructure capable of supporting frequent change, and sufficient product confidence to earn trust in the release process. That third pillar, confidence, became one of the main areas I focused on leading.</p><p>That experience reinforced something I now believe strongly: modern frontend applications are no longer simple user interfaces. They orchestrate complex business workflows.</p><p>Over the following year, I led the evolution of the testing strategy for a complex frontend system operating across multiple jurisdictions. The goal was not simply to add more tests. It was to build enough confidence in the product that the team could move faster, reduce release friction, and create a real path towards continuous deployment. I worked closely with the team to turn that strategy into something practical, repeatable, and aligned with the realities of the system we were operating.</p><p>Today’s web applications coordinate:</p><ul><li>APIs and backend services</li><li>embedded environments</li><li>authentication flows</li><li>redirects to third-party providers</li><li>cross-window communication</li><li>platform-specific integrations</li></ul><p>And yet many teams still test these systems as if they were simple collections of functions.</p><p>They focus heavily on internal logic.</p><p>But the failures that reach production rarely originate from that logic.</p><p>They originate at the <strong>boundaries of the system</strong>.</p><p>The real challenge, I found across many companies, was not writing more tests.</p><p>It was understanding <strong>what actually needed to be tested</strong>.</p><p>The turning point came when we stopped asking:</p><blockquote>“How do we test this code?”</blockquote><p>and started asking:</p><blockquote>“Where does reality break?”</blockquote><h3>The illusion of test confidence</h3><p>Most teams begin with a familiar testing hierarchy:</p><ol><li>Unit tests verify logic</li><li>Integration tests validate interaction</li><li>End-to-end tests simulate real workflows</li></ol><p>On paper, this approach should provide strong confidence.</p><p>In practice, it often creates a false sense of security.</p><p>Teams accumulate hundreds, sometimes thousands, of tests. The pipeline turns green. The release moves forward.</p><p>And yet production incidents still happen.</p><p>When they do, the response is often the same: add more tests, then repeat the cycle.</p><h3>Why?</h3><p>Because the system being tested is not always the system that actually runs in production.</p><p>In complex frontend applications, the majority of failures occur at <strong>inegration boundaries</strong>:</p><ul><li>When an API response changes shape</li><li>When an authentication token expires</li><li>When a redirect flow returns unexpected parameters</li><li>When cross-window communication breaks</li><li>When embedded environments behave differently than expected</li></ul><p>These are not unit failures.</p><p>They are orchestration failures.</p><p>You can have excellent unit coverage and still ship a broken experience, because users do not interact with units. They interact with journeys.</p><p>That is the trap many teams fall into. They build confidence around what is easiest to test rather than what is most likely to break.</p><p>And those are not the same thing.</p><h3>From inside-out to outside-in testing</h3><p>Traditional testing strategies are <strong>inside-out</strong>.</p><p>They begin by verifying internal implementation details and gradually expand towards the rest of the system.</p><p>That approach often sounds like this:</p><ol><li>Verify the logic</li><li>Verify the interactions</li><li>Verify the full workflow</li></ol><p>There is nothing inherently wrong with that model.</p><p>The problem is that in complex frontend systems, confidence does not emerge from within first.</p><p>It emerges from whether the journey actually works.</p><p><strong>Outside-in</strong> testing starts from a different question.</p><p>Instead of asking:</p><blockquote>Does this function behave correctly?</blockquote><p>It asks:</p><blockquote>Does the system behave correctly from the user’s point of view?</blockquote><figure><img alt="Comparison of inside-out and outside-in testing approaches showing code-first testing versus user-journey-driven testing." src="https://cdn-images-1.medium.com/max/1024/1*XMRdEekUsmGTaKJh7jCf7g.png" /><figcaption>Comparison of inside-out and outside-in testing approaches showing code-first testing versus user-journey-driven testing.</figcaption></figure><p>That shift changes the centre of gravity of the testing strategy. The journey comes first. The boundaries come next. The implementation details support both.</p><p>This does not mean unit tests stop mattering. They still have value, especially for deterministic logic, calculations, and highly isolated transformations. But they stop being the primary source of confidence. The more useful question becomes: “What must be true for the journey to succeed?”</p><p>Once that becomes the question, the answer is rarely “more unit tests”. It usually provides a better understanding of the system boundaries.</p><h3>The importance of understanding system boundaries</h3><p>If you want to build meaningful integration tests, <strong>a vital part of outside-in testing</strong> is understanding your system’s boundaries.</p><p>Every application exists within a wider environment. It communicates with external systems through contracts, protocols, assumptions, and runtime behaviour. Those interactions define the true shape of the system far more than the internal file structure ever will.</p><p>Typical frontend boundaries include:</p><ul><li>HTTP APIs</li><li>Third-party services</li><li>Embedded host applications</li><li>Browser APIs</li><li>cross-window communication</li><li>platform-specific adapters</li></ul><p>These boundaries are where assumptions meet reality.</p><figure><img alt="Diagram showing application system boundaries including APIs, authentication, redirects, host applications, and external providers." src="https://cdn-images-1.medium.com/max/1024/1*FZT3Fov-XOSWYg1Eaxj9_Q.png" /><figcaption>Diagram showing application system boundaries including APIs, authentication, redirects, host applications, and external providers.</figcaption></figure><p>They are where the behaviour of your application depends on systems you do not fully control.</p><p>They are also where many of the most painful production failures originate, whether that is between two components owned by different teams, or between parts of the same system with different responsibilities.</p><p>What matters is recognising the boundaries that define the subsystem at each level, from component composition to page transitions to network communication.</p><p>For that reason, a strong testing strategy must treat boundaries as <strong>first-class citizens</strong>.</p><p>Rather than isolating the system completely, tests should deliberately exercise these boundaries in controlled ways.</p><h3>Defining the confidence loop</h3><p>Once the system’s boundaries become clear, the next step is to identify the minimum journey that must always hold. That is what I came to think of as the <strong>confidence loop</strong>.</p><figure><img alt="Confidence loop diagram showing user action, orchestration, external interaction, state resolution, and user outcome." src="https://cdn-images-1.medium.com/max/1024/1*wKnJ0KtzO4ce0ZvJHhXDzg.png" /><figcaption>Confidence loop diagram showing user action, orchestration, external interaction, state resolution, and user outcome.</figcaption></figure><p>Every system has one. Every system has a minimal sequence of events that defines whether the product works.</p><p>It is the smallest end-to-end sequence that determines whether the product is behaving correctly from the user’s point of view. If that loop works, the experience works. If that loop breaks, almost nothing else matters.</p><p>For the kind of systems I have worked on, that loop often looks something like this:</p><ol><li>The user initiates an action</li><li>The application begins orchestration, sometimes through an API request, other times through a state update</li><li>An external interaction takes place</li><li>Control returns to the application</li><li>State is resolved</li><li>The outcome is shown to the user</li></ol><p>That is the loop the testing strategy needs to protect first.</p><p>Once that loop is identified, the conversation around testing starts to change. The question is no longer whether enough internal pieces are covered. The real question becomes whether the journey can still fail.</p><p>That shift is important.</p><p>It makes prioritisation clearer. It exposes testing gaps more honestly. It also creates a shared language across engineers, QA, and stakeholders around what confidence actually means.</p><p>The confidence loop becomes the smallest story that must remain true for the product to deserve trust.</p><h3>Integration tests are the primary confidence engine</h3><p>Once the system boundaries and confidence loop were clearly defined, the role of integration testing changed dramatically.</p><p>Integration tests were no longer a secondary safety net between unit tests and end-to-end tests.</p><p>They became the <strong>primary engine of confidence</strong>.</p><p>Integration tests are uniquely suited to validate:</p><ul><li>orchestration logic</li><li>API communication</li><li>state transitions</li><li>redirect behaviour</li><li>message passing</li><li>recovery after external interactions</li></ul><p>At the same time, they avoid many of the challenges associated with full end-to-end testing environments.</p><p>If the goal is to protect the confidence loop, integration tests are usually the layer where confidence becomes practical.</p><p>This approach aligns closely with the philosophy popularised by the Testing Trophy model:</p><p>Write tests. Not too many. Mostly integration.</p><p>Integration tests occupy the pragmatic middle ground.</p><p>They provide realistic validation without sacrificing speed or stability.</p><h3>Testing the real system, not a simplified version</h3><p>One of the <strong>easiest traps in frontend testing</strong> is simplifying the environment so aggressively that the system under test slowly stops resembling the one that actually runs in production.</p><p>It usually starts with <strong>good intentions</strong>:</p><ul><li>A call is mocked to make a test easier to write.</li><li>An orchestration step is bypassed to keep the setup small.</li><li>A dependency is stubbed so the test can focus on one narrow piece of behaviour.</li></ul><p>Each decision looks harmless in isolation. Over time, though, the suite starts validating a version of the system that is cleaner, simpler, and more predictable than reality.</p><p>That is a dangerous place to be. That is <strong>where false confidence begins</strong>.</p><p>If integration tests are meant to protect the confidence loop, they need to preserve as much of the real execution path as possible. Otherwise, they may still pass while the product fails in exactly the places users care about most.</p><p>One principle became especially useful to me here: the closer the mock is to the boundary, the more production behaviour you preserve.</p><p>That matters.</p><p>To avoid this drift, we focused on preserving <strong>real execution paths</strong> wherever possible.</p><p>For example, instead of mocking API calls directly inside the application, we intercepted network traffic at the boundary using tools such as Mock Service Worker.</p><p>This allowed us to:</p><ul><li>preserve the real HTTP client</li><li>maintain realistic request flows</li><li>simulate server responses deterministically</li></ul><p>That distinction matters because the application is still exercising the same network layer and request lifecycle it would use in production. The response is controlled, but the behaviour is still real.</p><p>This approach gave us strong realism without introducing external dependencies.</p><p>The same principle applies beyond HTTP. If the system depends on message contracts, redirect flows, or embedded contexts, the test setup should preserve those interaction models as much as possible. The more of that behaviour you remove, the more likely the suite is to drift away from production reality.</p><p>A green test suite is only useful if it still reflects the system that actually ships.</p><p>That is the real standard.</p><p>The goal is not simply to make tests pass. The goal is to keep them truthful.</p><h3>Simulating platform interactions without losing realism</h3><p>Some boundaries are harder to validate than an API call.</p><p><strong>Embedded environments, host applications, and platform-specific adapters introduce a different category of risk.</strong> The system may behave correctly in isolation and still fail when mounted in a real host context.</p><p>At that point, the boundary itself becomes part of the problem:</p><ul><li>Message timing changes</li><li>Payloads drift</li><li>Ordering assumptions break</li><li>Availability becomes less predictable</li><li>State recovery becomes critical</li></ul><p>That is why preserving realism at this layer matters just as much.</p><p>In practice, though, jumping straight to full platform-level end-to-end testing is rarely the best first move. It is often too expensive, too fragile, and too dependent on infrastructure that is not yet stable enough to become a trustworthy feedback loop.</p><p>A more pragmatic step is to simulate the adapter layer in a way that preserves the contract and the interaction model.</p><p>That distinction is essential.</p><p>Because the goal is not to mock the platform so aggressively that the risk disappears from the test, the goal is to preserve the surface where your application meets the outside world, while still keeping the environment controlled enough to remain useful.</p><p>In our case, that meant validating message-based interactions in a way that still exercised the application’s orchestration behaviour, rather than bypassing it entirely.</p><p>This allowed the system to exercise:</p><ul><li>Message contracts</li><li>State transitions</li><li>Orchestration behaviour</li></ul><p>The system still had to respond to realistic inputs, correctly recover state, and produce the correct outcome when control was returned.</p><p>You are not trying to simulate everything.</p><p>You are aiming to preserve as much of the production behaviour as possible, minimising the drift introduced by the mock.</p><p>This gives the team a practical middle step between isolated application tests and full platform end-to-end coverage. It allows the contract, the orchestration, and the recovery behaviour to be validated before the wider platform is stable enough for broader E2E adoption.</p><p>In systems where cross-context communication is part of the product, that layer of confidence matters just as much as the HTTP boundary.</p><h3>Why not rely entirely on end-to-end testing?</h3><p>At this point, a natural question appears: if realism matters so much, why not test everything end-to-end?</p><p>In theory, full end-to-end testing offers the highest level of confidence. In practice, it also introduces the highest operational cost.</p><p>Large end-to-end suites tend to bring a different category of problems:</p><ul><li>Fragile environments</li><li>Long feedback loops</li><li>Difficult test data management</li><li>Unpredictable failures unrelated to the application itself</li><li>Reduced trust in the pipeline as flakiness starts to grow</li></ul><p>Large end-to-end suites often reduce developer confidence rather than increasing it.</p><p>Because once a test suite becomes noisy, it stops creating confidence and starts consuming it.</p><p>This is why full end-to-end testing is rarely the right default. Not because it lacks value, but because it is too expensive to use as the primary answer to every risk.</p><p>In orchestrated frontend systems, integration tests usually provide a better balance. They preserve enough realism to protect the confidence loop while remaining fast, deterministic, and useful in day-to-day development.</p><p>Instead of replacing integration tests with end-to-end testing, we adopted a layered approach:</p><ul><li>Integration tests provide continuous confidence</li><li>End-to-end tests act as targeted validation for critical flows</li></ul><p>This balance preserves speed while still validating real-world behaviour.</p><ul><li><strong>Used well:</strong> It is a confidence amplifier. It validates the few flows where the added realism is worth the added cost.</li><li><strong>Used too broadly:</strong> it slows delivery down, increases maintenance overhead, and makes the feedback loop harder to trust.</li></ul><p>A stronger strategy is to let integration carry most of the confidence, then selectively introduce end-to-end coverage, where the wider environment itself becomes part of the risk that needs to be proven.</p><p>That is usually the more sustainable path.</p><p>The goal is not to eliminate end-to-end testing.</p><p>The goal is to use it deliberately.</p><h3>From coverage metrics to confidence metrics</h3><p>Another important shift in this journey was moving away from coverage as the primary signal of quality.</p><p>Code coverage can be useful. It can highlight blind spots, reveal untested areas, and give teams a basic sense of how much of the codebase is being exercised.</p><p>But it often creates the wrong incentives.</p><p>It becomes easy to optimise for the threshold, and over time, developers start writing tests to satisfy coverage targets rather than to validate meaningful behaviour.</p><p>A high percentage can still hide critical gaps if the boundaries are not validated and the confidence loop is not protected.</p><p>Instead, I guided the team to focus on <strong>confidence metrics</strong>.</p><p>The more important questions became:</p><ul><li>Are the critical journeys protected?</li><li>Are the system boundaries being exercised in meaningful ways?</li><li>Are the major failure modes visible?</li><li>Can the team release safely and predictably?</li><li>Does the suite catch the kinds of regressions that actually happen in production?</li></ul><p>This change reframed testing as an engineering capability rather than a compliance exercise.</p><p>Confidence is not built by proving that code was executed.</p><p>It is built by proving that the system still behaves correctly where failure actually matters.</p><h3>How does this enable continuous deployment?</h3><p>One of the most tangible outcomes of this strategy was the ability to introduce continuous deployment confidently.</p><p>When the test suite accurately reflects the system’s behaviour, deployments become predictable. Smaller changes become safer. The team no longer relies on heavyweight release rituals to build confidence that should already have been established earlier in the lifecycle.</p><p>The team can release changes knowing that the most critical paths have already been validated.</p><p>By guiding the strategy towards boundaries, confidence loops, and integration-first validation, I was not just trying to improve the suite’s quality. My core objective was to make releasing with confidence something that the team could do continuously, rather than something that had to be recreated at the end of every cycle.</p><p>Continuous deployment does not become a leap of faith.</p><p>It becomes the natural consequence of having trustworthy feedback, and that trust is only earned when the feedback loop consistently reflects the behaviour of the real system.</p><p>In that sense, testing stopped being a separate safety ceremony before release.</p><p>It became part of how release confidence was created every day.</p><p>That is what makes continuous delivery realistic. Not because risk disappears, but because the team becomes better at seeing it earlier, validating it more meaningfully, and reducing it before release ever becomes an issue.</p><p>Reliable boundary validation + reliable journey validation + reliable release decisions = deliver fast with confidence.</p><p>That’s the equation</p><h3>An evolving strategy, not a static one</h3><p>Outside-in testing is not a fixed framework.</p><p>As systems evolve with the maturity of the product, the platform, and the organisation, the boundaries of confidence expand.</p><p>The goal is not to jump straight into the most realistic or most expensive form of testing. The goal is to expand confidence, one stable boundary at a time, deliberately.</p><p>In practice, that usually means starting with the boundaries that matter most, protecting the confidence loop, and letting integration carry the bulk of the confidence first. From there, realism can increase progressively as the surrounding platform becomes stable enough to support it.</p><p>A <strong>testing strategy</strong> that is<strong> too ambitious too early</strong> often <strong>creates noise</strong> instead of confidence. It <strong>adds operational cost</strong> before the system is ready to earn value from it.</p><p>A typical progression path is to let the strategy mature alongside the product itself:</p><ol><li>Clarify the core boundaries of the system you aim to validate</li><li>Define the confidence loop</li><li>Make integrationas the backbone</li><li>Preserve as much real behaviour as possible</li><li>Introduce broader end-to-end validation only where the wider environment becomes part of the risk that must be proven</li></ol><p>This makes the strategy more sustainable.</p><p>It also makes it easier for teams to improve their confidence model without waiting for a perfect end state before making progress.</p><p>Because in practice, confidence is rarely built all at once.</p><p>It is built iteratively, as the team learns which boundaries matter most, which journeys need the strongest protection, and which parts of the system are mature enough to support deeper forms of validation.</p><p>The point is not to follow a static formula.</p><p>The main objective is to keep expanding confidence in ways the system can actually sustain.</p><h3>Lessons learned</h3><p>Several lessons became clear through this journey.</p><ol><li><strong>Understanding the architecture of your system is essential for designing meaningful tests:</strong> if you do not understand the system’s real shape, your tests will eventually drift away from production reality.</li><li><strong>Boundaries matter more than teams often expect: </strong>In orchestrated frontend systems, the most important failures rarely happen inside isolated units. They happen where contracts meet assumptions, where control returns from the outside world, and where the system must recover its state correctly.</li><li><strong>Realism only adds value when it remains trustworthy:</strong> a more realistic test is not automatically a better test if it introduces so much noise that the team can no longer trust the feedback loop.</li><li><strong>Integration tests are often underestimated:</strong> When designed around the right boundaries, they provide the most practical balance between realism, speed, and trust.</li><li><strong>Confidence is not built by having a higher test coverage percentage:</strong> it is built by having the right tests in the right places, aligned with the points where failure is most likely and most costly.</li></ol><p>That was one of the biggest mindset shifts in this journey.</p><p>The goal was never to create the largest suite.</p><p>It was to create the most reliable path to releasing with confidence.</p><h3>Closing thoughts</h3><p>As time passes, modern frontend systems are shaped as much by their interactions as by their internal logic.</p><p>A testing strategy that focuses only on implementation details will eventually miss the places where real failures emerge. But when the strategy starts from the boundaries, protects the confidence loop, and treats integration as the backbone, something important changes.</p><p>Testing stops being a ceremony that happens before release. It becomes part of how confidence in releases is built every day. That shift matters because the goal is not simply to prove that code ran.</p><p>The goal is to prove that the system still holds where failure actually matters.</p><p>Confidence is not built inside isolated units alone.</p><p>It is built where the system meets reality.</p><p>At the boundaries.</p><p>Because the goal is not simply to prove that code ran.</p><p>The goal is to prove that the system still holds where failure actually matters.</p><p><strong>Part 2: Testing Payments at Scale, A Practical Case Study in Outside-In Testing</strong></p><p>In the next article, I will move from theory to practice and show how I applied this approach in a real payment orchestration system, including how I defined the boundaries, shaped the confidence loop, used boundary-level simulation, and turned the strategy into a practical path towards releasing with confidence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ee6cd888376" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Defaulting to Options Objects in Helper Functions, A 2026 Decision Framework]]></title>
            <link>https://medium.com/@byeduardoac/stop-defaulting-to-options-objects-in-helper-functions-a-2026-decision-framework-fbaa0000b0da?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbaa0000b0da</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[helperfunction]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 17:51:03 GMT</pubDate>
            <atom:updated>2026-02-01T17:51:03.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKXkbdKe75r5LFlm-js-tQ.png" /></figure><p>Not long ago, I was about to ship a change when a pull request comment landed: “Can we switch these parameters into an object parameter as we have more than 3?”</p><p>It’s a fair instinct. Options objects handle optionality well; they keep call sites stable as APIs evolve, and they can make intent obvious when arguments start to look like fn(2000, 3, true).</p><p>Which sparked a simple question in my mind. In 2026, with TypeScript, refactor tooling, and strong IDE hints, is the options object still the default best choice for internal helper functions, or have we turned it into a habit?</p><p>That question led me to re-examine the role of object parameters (the option object pattern) in helper functions. Helper functions exist to support delivery by encapsulating small units of logic behind a clear contract. That contract often wants to be explicit, and in many cases, explicit means positional parameters.</p><p>Consider the same helper expressed in two shapes:</p><ul><li>functionA(min, max, defaultMin, defaultMax, currency, optionId)</li><li>functionB({ min, max, defaultMin, defaultMax, currency, optionId })</li></ul><p>Both can do the same job. The question is whether the second form improves clarity in a helper function context or is simply a familiar convention.</p><p>To be clear about scope: this article is about internal helper functions, not configuration-heavy public APIs, and not component props.</p><h3>How the options object pattern became the “default” choice</h3><h3>A short history of why the “options object” became normal in JavaScript</h3><p>JavaScript appeared in 1995 with positional parameters and no true named arguments. When the first ECMAScript standard was published in June 1997, that model effectively became the baseline.</p><p>Before JavaScript had modern ergonomics, there were two big realities.</p><ol><li><strong>No named arguments<br></strong>JavaScript does not support true named parameters, so if you wanted call sites to be self-documenting, you had to build that behaviour yourself. A common substitute became: pass a single object, then destructure it inside the function.</li><li><strong>Optional parameters got messy fast<br></strong>As soon as you had more than one optional value, positional parameters forced you into brittle patterns like passing undefined placeholders just to reach the argument you care about. Discussions dating back well over a decade recommend moving to an object once optionality and ordering start to hurt.</li></ol><p>So the options object pattern took off as a practical compromise. It is not named parameters, but it gets you close enough.</p><p>Once that shape is in your muscle memory, it starts to feel like the correct answer even when the original reasons are not present.</p><h3>The era that cemented it: libraries and web APIs</h3><p>The pattern did not become popular because of the theory. It became popular because of the APIs people used every day.</p><ul><li><strong>The jQuery era (jQuery 1.0, 26 August 2006):<br></strong>$.ajax({ … }) is basically a poster child for the pattern: a configuration object where settings are optional, defaults exist, and new keys can be added over time. This shaped the mental model of a whole generation of frontend developers: when there are many knobs, you pass an object.</li><li><strong>The Node.js era (Node.js initial release, 27 May 2009)<br></strong> Many APIs accept an options object to control behaviour without exploding the positional signature. That same idea shows up in core filesystem APIs, among many others.</li></ul><p>This is part of why the pattern still feels “obviously correct” to many reviewers: it has been reinforced by mainstream library design for years.</p><h3>ES2015 made it feel clean: destructuring and defaults</h3><p>ES2015 was finalised in June 2015, and it introduced destructuring and default parameters. Suddenly, the options object pattern felt significantly more ergonomic:</p><ul><li>Call sites still pass a single object.</li><li>Implementations can destructure keys, apply defaults, and clearly show what is used.</li></ul><p>TypeScript later documented this approach directly, including a key ergonomic benefit: properties can be optional for callers while still being definitely present inside the function body due to defaults.</p><p>This is the moment the pattern shifted from a workaround to a style.</p><p>There is also an important cultural reinforcement here: TypeScript was unveiled publicly in October 2012, and React was open-sourced in May 2013. Both pushed object-shaped inputs and were destructured into daily muscle memory.</p><h3>Style guides normalised the shape.</h3><p>Even when teams do not explicitly mandate option objects, the ecosystem heavily normalises the ingredients that make the pattern common:</p><ul><li>Widespread encouragement of destructuring and object patterns as a readability tool</li><li>Frontend organisations adopting that style guide baseline</li></ul><p>By the mid to late 2010s, this ceased to be “a pattern some people use” and became the prevailing norm.</p><h3>What still holds in 2025 and 2026</h3><p>In 2025 and 2026, the pattern remains recommended, but the rationale is slightly revised.</p><p>The debate has shifted away from “JavaScript is untyped, so we need named arguments” and toward “TypeScript gives safety, but ergonomics and API evolution still matter”.</p><p>In other words, TypeScript changed the trade-offs but did not eliminate the original reasons for the pattern.</p><p>This is the important bridge: the historical case for options objects is strongest when optionality and configuration are central. Helper functions often sit in a different category, and that is where the trade-offs change.</p><h3>Why do we still use it so heavily in 2026</h3><p>The options object pattern survived into 2026 for a simple reason: in many parts of web development, it genuinely works.</p><p>It was originally a pragmatic solution to two recurring problems: optional parameters that do not scale positionally, and call sites that become ambiguous once arguments start to look like fn(2000, 3, true).</p><p>Modern frontend development reinforced this pattern culturally. React, in particular, made object-shaped inputs feel natural by modelling component inputs as props, a single object that is easy to destructure and evolve over time. Once that mental model becomes your daily default, it is easy for it to spill into everything else: hooks, utilities, service wrappers, and eventually helper functions.</p><p>And that is where things get interesting.</p><h3>Options Object vs Positional Parameters in Helper Functions</h3><p>Helper functions are usually small, deterministic pieces of logic. They are often called in a narrow local context, and they tend to have stable signatures.</p><p>That changes the trade-offs.</p><h3>Why helper functions are different</h3><p>Helper functions often play a different role from configuration APIs or component interfaces. They tend to be small, deterministic utilities with stable contracts and narrow responsibilities.</p><p>In many helper functions:</p><ul><li>Every value is required</li><li>Every value is used every time</li><li>The call sites are few and come from a clear execution flow</li></ul><p>When that is the case, switching to an options object can stop solving the original problems and start introducing new ones:</p><ul><li>extra indirection at the call site and inside the function</li><li>An extra ceremony that can spread through multiple layers, as values are proxied</li><li>signatures that hide what is required behind a shape, rather than stating it plainly</li></ul><p>This is where the conversation should shift from “objects are cleaner” to a more specific question:</p><p>Does this option object make the contract clearer, or does it hide the contract behind a shape?</p><h3>The Balance of Flexibility and Simplicity</h3><p>Object parameters are still the right tool in many situations:</p><ul><li><strong>Evolving APIs: </strong>when a function’s inputs are likely to grow or change over time.</li><li><strong>Grouped concepts: </strong>when parameters form a cohesive domain concept rather than a list of independent values.</li><li><strong>Configuration-heavy functions: </strong>where optionality and defaults are central to usability.</li></ul><p>The issue is not the pattern itself, but treating it as a default response to “too many parameters”. The goal is to pick the signature that makes the contract easiest to understand and hardest to misuse.</p><h3>When Positional Parameters Make Sense</h3><p>In 2026, positional parameters are often the clearer choice when:</p><ul><li><strong>All parameters are required: </strong>If the function always needs all values, an object can add indirection without simplifying the contract.</li><li><strong>The function is called a discrete number of times: </strong>Especially in helper functions or internal logic, clarity often comes from explicitness.</li><li><strong>The signature is stable: </strong>If the helper’s inputs are unlikely to evolve, a positional signature can remain readable and explicit.</li></ul><p>In these cases, positional parameters are not a step backwards; they are often the most honest representation of the function’s intent.</p><p>Yes, the helper might have five or six parameters. If each one matters and is always used, the signature is doing real explanatory work.</p><p>Here is a concrete example:</p><pre>function calculateDepositLimits(<br>  min: number | undefined,<br>  max: number | undefined,<br>  defaultMin: number,<br>  defaultMax: number,<br>  currency: string,<br>  optionId: string<br>) {<br>  const effectiveMin = min ?? defaultMin;<br>  const effectiveMax = max ?? defaultMax;<br>  if (effectiveMin &gt; effectiveMax) {<br>    throw new Error(`Invalid limits for ${optionId} in ${currency}`);<br>  }<br>  return { effectiveMin, effectiveMax };<br>}</pre><p>If every caller must provide all of these values, wrapping them into { min, max, defaultMin, defaultMax, currency, optionId } does not reduce complexity. It just moves it.</p><h3>Clean code heuristics, use them as guidance, not law</h3><p>Clean code guidance often encourages limiting the number of function parameters. The intent is good: smaller interfaces are easier to read and test.</p><p>The risk is turning that guidance into a mechanical rule. Moving parameters into an object does not reduce complexity by itself; it can simply relocate it.</p><p>If a helper has “too many parameters”, consider these alternatives before wrapping:</p><ul><li>Break the logic into smaller helpers with tighter responsibilities</li><li>Introduce a domain object that names the concept</li><li>Refactor the design so the caller is not responsible for assembling unrelated values</li></ul><p>Reducing parameter count should be a by-product of better design, not the sole design goal. That typically reduces parameter count naturally and makes call sites clearer, regardless of whether you use an object.</p><h3>A third option that is often better than both</h3><p>If the parameters form a real concept, name it.</p><p>This is not an “options object”. It is a domain object.</p><pre>type DepositLimits = {<br>  min: number | undefined;<br>  max: number | undefined;<br>  defaultMin: number;<br>  defaultMax: number;<br>};<br><br>function calculateDepositLimits(<br>  limits: DepositLimits,<br>  currency: string,<br>  optionId: string<br>) {<br>  const effectiveMin = limits.min ?? limits.defaultMin;<br>  const effectiveMax = limits.max ?? limits.defaultMax;<br>  return { effectiveMin, effectiveMax };<br>}</pre><p>That change is meaningful because it models something real. It also reduces parameter count without turning the signature into “one big bag of unrelated fields”.</p><h3>The TypeScript factor, what changed by 2026</h3><p>TypeScript does not make options objects obsolete. It changes what you get “for free” with positional parameters.</p><h3>Type safety reduces the classic risk</h3><p>TypeScript reduces the risk of mixing up arguments, and it makes refactors safer because signature changes are validated across the codebase.</p><p>TypeScript changed what we get for free at the call site:</p><ul><li><strong>Type safety: </strong>Strong typing and compiler checks reduce the risk of mixing up parameters.</li><li><strong>Discoverability</strong>: types and editor hints make intent clearer even with positional arguments</li><li><strong>Refactor safety</strong>: renaming, reordering, and changing types is easier to validate across a codebase</li><li><strong>Defaults and optional support</strong>: these are now first-class language features, reducing the need to rely on objects solely for optionality.</li></ul><p>This does not make options objects obsolete. It changes the baseline. If you are using an object primarily to reduce parameter count, TypeScript often provides safer alternatives while keeping the contract explicit.</p><h3>IDE support changes readability at the call site</h3><p>Object parameters can improve call site clarity when values are otherwise ambiguous. However, they can also introduce navigation overhead: the reader may need to jump to a type or object definition to understand what is required, what is optional, and what defaults exist.</p><p>One of the original arguments for options objects was self-documentation.</p><p>In 2026, the IDE often provides that with positional calls:</p><ul><li>Parameter hints</li><li>Inline types</li><li>Jump to definition</li><li>Safe rename and refactor tools</li></ul><p>So if your only reason for an options object is “call sites should be readable”, TypeScript may already be solving a large part of that.</p><h3>Performance, GC, and When It Actually Matters</h3><p>Most of the time, performance is not the deciding factor. Still, it is worth understanding what is real, what is myth, and where habits can bite you later.</p><h3>“Is there real payload overhead?”</h3><p>A common misconception is that passing an object means “copying data”. In JavaScript, objects are passed by reference, not copied. Overhead is typically at the call site: creating the object literal and accessing properties, not copying.</p><p>There are still runtime realities worth addressing in hot paths, but historically, the motivation has not been micro-performance.<strong> It was human factors: readability, API evolution, and optionality</strong>.</p><h3>Benchmarking and reality</h3><p>Microbenchmarks can be surprising, especially in modern <a href="https://v8.dev/blog/adaptor-frame">V8</a>. Call site stability, inlining decisions, and argument adaptation can affect outcomes. The V8 team has written about call performance and argument mismatch behaviour, which helps explain why some benchmark shapes can mislead.</p><p>In most user flows, the performance difference between positional parameters and an options object is negligible. The more meaningful risk is behavioural: allocation patterns and indirection can become habits, and those habits can leak into hot paths where they matter.</p><p>Microbenchmarks can be misleading in modern engines. Results depend heavily on:</p><ul><li>whether the call site is stable</li><li>whether the function gets inlined</li><li>whether the engine can optimise property access patterns</li></ul><p>That is why you will sometimes see benchmarks where “objects are fine” and other benchmarks where “objects are slower”; both can be true in different shapes.</p><p>In everyday business logic, you rarely notice. In hot paths, you might.</p><h3>Garbage Collection and Memory Considerations</h3><p>The more practical performance concern is allocation and garbage collection.</p><p>If you create a fresh object for every call in a frequently executed path, you increase short-lived allocations. That can increase GC activity and introduce latency spikes in the wrong places.</p><p>Positional parameters do not create that allocation pressure because they primarily live on the stack.</p><p>So a reasonable stance is:</p><ul><li>In cold paths, prefer clarity and intent</li><li>In hot paths, be mindful of allocation patterns, especially in tight loops or render adjacent code</li></ul><p>Using object parameters can introduce real runtime costs:</p><ul><li><strong>Memory allocation</strong>: Creating objects on the heap per call allocates heap memory.</li><li><strong>Garbage collection pressure</strong>: short-lived objects increase GC activity, which can matter in hot paths.</li></ul><p>Positional parameters live on the call stack and have minimal GC impact. For code executed frequently, this difference can become relevant. For code executed a handful of times, it usually does not.</p><p>Understanding where your code sits on that spectrum matters more than following a blanket rule.</p><h3>The rule of thumb: a practical checklist for 2026</h3><p>Use positional parameters when:</p><ul><li>The inputs are required, stable, and used every time, even if there are more than three</li><li>The helper is internal, called in a clear flow, and does not need to evolve frequently</li><li>You want the signature to state the contract explicitly</li></ul><p>Use one options object when:</p><ul><li>You have two or more optional values</li><li>The interface is expected to grow</li><li>Call site meaning matters because raw values are otherwise ambiguous</li><li>The parameters describe a single domain concept that naturally belongs together</li></ul><p>Prefer introducing a domain parameter object when:</p><ul><li>The parameters represent a real concept you can name (limits, range, pagination, coordinates)</li><li>That concept can be reused across multiple functions or call sites</li></ul><p>Avoid:</p><ul><li>one-property options objects in helpers, unless you have a clear reason to expect growth soon</li><li>using an options object purely to satisfy a parameter-count heuristic</li></ul><h3>Conclusion: Defaults Matter, Context Matters More</h3><p>In 2026, object parameters are no longer a default best practice. They are a contextual design decision.</p><p>They remain valuable for configuration-heavy or evolving APIs. Still, they are not inherently faster, cleaner, or more maintainable in every scenario. TypeScript and modern tooling have shifted the trade-offs, making positional parameters a perfectly valid, and often clearer, choice for many helper functions.</p><p>The real takeaway is simple:</p><ul><li>design function signatures based on how they are used</li><li>optimise for clarity at the call site</li><li>use patterns intentionally, not automatically</li></ul><p>Recognising when you don’t need object parameters anymore is not regression; it’s engineering maturity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbaa0000b0da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Android WebView breaks first- oversized cookies, redirects, and a silent 400]]></title>
            <link>https://medium.com/@byeduardoac/when-android-webview-breaks-first-oversized-cookies-redirects-and-a-silent-400-042f72283176?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/042f72283176</guid>
            <category><![CDATA[iframe]]></category>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[android-webview]]></category>
            <category><![CDATA[http-redirect]]></category>
            <category><![CDATA[payment-systems]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 17:53:13 GMT</pubDate>
            <atom:updated>2025-12-21T17:59:53.103Z</atom:updated>
            <content:encoded><![CDATA[<h3>When Android WebView breaks first: oversized cookies, redirects, and a silent 400</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8gpHbjOJOrHMUOitKE1tqw.png" /><figcaption>When Android WebView breaks first: a silent 400 emerging from an oversized redirect chain.</figcaption></figure><p>One of the most fascinating challenges I have faced over the past months is an error that <strong>exclusively</strong> occurred in Android WebView.</p><p>The symptom looked simple, almost silly: a <strong>400 HTTPS error</strong> response during a redirect: no response body, no details, no useful logs. The only clue we had was something a colleague noticed while looking at the failing request: <strong>once the Cookie header exceeded 4 KB, the redirect stopped working</strong>, and the only thing WebView returned was a generic network error.</p><p>After learning this, I started investigating what could be causing such a bizarre outcome, because cookies usually get truncated, and even if some information is missing, the flow should still work, or at least fail in a way that makes sense.</p><p><strong>Why wasn’t intuition alone enough?</strong></p><p>I gave quite a bit of thought to this, recalling all my experiences with cookies, URLs, and affiliate-style integrations from my almost 4 years at Skimlinks, supporting thousands of customers integrating custom scripts and facing all kinds of edge cases. It felt like one of those classic “works everywhere except this one constrained environment” problems.</p><p>So, <strong>where can we start understanding the issue?</strong> <strong>How can we find the root cause with so little information to begin with?</strong></p><p>Well, the first step in any root cause analysis is gathering evidence, context, and information.</p><h3>A bit of context first</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Omp7pFZfloRRpJHJarjhfQ.png" /><figcaption>Payment flow overview (deposit → Nuvei → Paysafe → failure)</figcaption></figure><p>Before going any further, some context is important. Let me set the scene, because without it, the rest of the story does not really make sense.</p><p>We have a <strong>web-based payment flow</strong> that runs across multiple channels:</p><ul><li>Desktop web supporting all browsers (mainly focus on Chrome and Safari)</li><li>Mobile web supporting all browsers (mainly focus on Chrome and Safari)</li><li>a native Android app, using <strong>Android WebView</strong></li><li>a native iOS app, using <strong>iOS WebView</strong></li></ul><p>This setup allows us to keep a single source of truth for the payment experience, improve security, and move faster without duplicating logic across platforms.</p><p>In native journeys, the WebView loads the payment UI iFrame, performs redirects to a payment provider, and then returns control to the app once the payment reaches a final state.</p><p>This journey relies heavily on redirects. The user moves from our web experience to the payment provider, and then back again, with different possible outcomes:</p><ul><li>success</li><li>error</li><li>pending</li><li>back or cancel</li></ul><p>This detail matters because redirects are not just “navigation”. Redirects carry <strong>headers</strong>, headers carry <strong>cookies</strong>, and cookies can silently become part of your <strong>payload budget</strong> without you realising it.</p><h3>What changed, and when</h3><p>Historically, this WebView channel was working relatively well.</p><p>We first launched the Android WebView flow in <strong>August 2025</strong> for the Poland jurisdiction, and it was stable. Shortly after, we temporarily disabled it due to minor issues and to support a <strong>large migration of the payment platform</strong>, which went live in Poland on the <strong>1st of September</strong>.</p><p>Once those minor issues were resolved, we attempted to re-enable Android WebView in <strong>October 2025</strong>. That is when things started to break.</p><p>The only symptom we had was that same silent <strong>400-style network error</strong> during redirects. No backend errors. No useful logs. Just a failed navigation inside WebView.</p><p>So we went through the usual checklist:</p><ul><li>logs</li><li>code from Android, Web, and Backend</li><li>release timelines</li><li>conversations with multiple people involved in the migration</li></ul><p>Nothing obvious popped out as “this is broken”.</p><p>And that is precisely <strong>why the cookie size clue became so important</strong>.</p><h3>Why is this setup inherently fragile?</h3><p>What makes this problem particularly tricky is how many systems are involved indirectly in a simple redirect:</p><ul><li><strong>The payment provider</strong>, because redirect URLs and parameters are part of the contract</li><li><strong>Your backend</strong>, because it often validates or allows some of those parameters</li><li><strong>Your observability tooling</strong>, because it captures navigation and URL data</li><li><strong>Android WebView</strong>, because it is the most constrained environment and usually breaks first</li></ul><p>In our case, the cookie at the centre of the issue was called <strong>dtSa</strong>, created by <strong>Dynatrace RUM instrumentation</strong>. That cookie was carrying navigation context, including <strong>full URLs</strong>, which is where things started to get interesting.</p><p>At this point, we had plenty of <strong>context</strong>, but still no explanation we could <strong>prove</strong>. The system made sense on paper, the flow was correct, and nothing obvious was broken. Yet <strong>Android WebView kept failing in a way that left no trace behind</strong>.</p><p>This is usually the moment where <strong>speculation starts to creep in</strong>, but speculation does not fix production issues. When intuition runs out, <strong>engineering discipline has to take over</strong>. We needed something <strong>concrete</strong>, something <strong>measurable</strong>.</p><p>The next step was to stop reasoning about what <em>might</em> be happening and start looking at what <em>actually</em> happened <strong>on the wire</strong>, <strong>byte by byte</strong>.</p><h3>The first real clue, a captured failing request</h3><p>Once we decided to stop theorising and start measuring, the next question was simple:</p><p><strong>What is the exact request that Android WebView is failing to send?</strong></p><p>This is where the investigation finally became tangible.</p><p>The turning point was not a log, not an exception, and not a stack trace. It was a <strong>cURL capture</strong>.</p><p>An Android engineer captured a failing request directly from WebView and shared it with the team. For the first time, we were no longer guessing based on symptoms. We had the <strong>exact request</strong>, with the <strong>exact headers</strong>, that WebView was trying to send.</p><p>That capture became our <strong>single source of truth</strong>.</p><p>From there, we did something straightforward, but very powerful:</p><ul><li>Extracted the full <strong>Cookie header</strong> from the request,</li><li>measured it <strong>byte by byte</strong> using a small Node script that breaks down cookie sizes,</li><li>focused only on the <strong>largest contributors</strong>, not the noise</li></ul><p>No assumptions. No hand-waving. Just numbers.</p><h3>What the measurements showed</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*591NaaFhc51U0OY1OkQbMQ.png" /><figcaption>Cookie header size breakdown</figcaption></figure><p>The results were not subtle.</p><ul><li><strong>Total Cookie header size:</strong> ~<strong>4.35 KB</strong></li><li><strong>Number of cookies sent:</strong> <strong>13</strong></li><li><strong>Largest cookie:</strong> dtSa, approximately <strong>2770 bytes</strong> (~<strong>2.7 KB</strong>)</li><li><strong>Share of total header:</strong> dtSa alone accounted for <strong>63.8%</strong></li></ul><p>At this point, the nature of the problem changed completely.</p><p>We were no longer debugging:</p><ul><li>a redirect endpoint</li><li>a payment provider integration</li><li>backend validation logic</li></ul><p>We were debugging a <strong>payload-size issue</strong> that surfaced only in the <strong>most constrained environment</strong>.</p><p>One cookie accounted for almost <strong>two-thirds of the Cookie header</strong>. Everything else combined was secondary.</p><p>This also explained several things that had not made sense before:</p><ul><li>Why did the backend see no request at all?</li><li>Why do desktop and mobile Chrome behave normally?</li><li>Why did Android WebView fail silently, before anything reached the server?</li></ul><p>From here, the investigation stopped being about <em>where</em> the redirect was failing and became about <strong>what was inside that cookie</strong>, and <strong>why it had grown so large</strong>.</p><h3>The more likely culprit: redirect URL truncation leads to a silent 400</h3><p>The size increase was evidence, but not necessarily the root cause.</p><p>The nuance I did not appreciate at the start is simple: <strong>cookie size was not automatically the thing that broke the flow</strong>. Cookies are often truncated, and even when they are, many flows still work.</p><p>What the cookie measurement gave us was something more valuable: proof that we had crossed into a fragile zone where something in the request chain was likely being cut, dropped, or rejected.</p><p>The real question became:</p><p><strong>If something is being truncated, what is the first thing that would turn into a silent 400?</strong></p><p>To answer that, we had to understand what dtSa actually contained</p><h3>What is dtSa, and why did it explode in size</h3><p>Suppose you have never seen dtSa before, a quick explanation. dtSa is a cookie generated by <strong>Dynatrace RUM</strong>. Its purpose is to store <strong>navigation context</strong> so that user journeys can be analysed and replayed later for observability and troubleshooting.</p><p>In our case, that navigation context included <strong>full URLs</strong>, and that is where things started to go wrong.</p><p><strong>The part that hurt us</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rLiub32jh_lZdaFx7c85Q.png" /><figcaption>Redirect URL duplication micro-diagram</figcaption></figure><p>The dtSa cookie included <strong>four complete redirect URLs</strong>, one for each possible outcome of the payment flow:</p><ul><li>success_url</li><li>error_url</li><li>back_url</li><li>pending_url</li></ul><p>Each of those URLs contained a large number of <strong>verbose query parameter names</strong>, things like:</p><ul><li>redirectPaymentStatus</li><li>redirectProvider</li><li>redirectMethod</li><li>redirectHasMadeDeposit</li><li>plus multiple identifiers, tokens, and environment flags</li></ul><p>Individually, none of these parameters was unreasonable individually.</p><p>The problem was <strong>duplication</strong>.</p><p>All four redirect URLs shared almost the same structure. The only meaningful difference between them was the final redirect state. As a result, the cookie ended up storing <strong>four near-identical blocks of URL data</strong>, repeating the same long parameter names again and again.</p><h3>What the numbers actually looked like</h3><p>Once we broke dtSa down <strong>byte by byte</strong>, the scale of the problem became very clear.</p><p>From the measured breakdown:</p><ul><li><strong>Total dtSa size:</strong> ~<strong>2770 bytes</strong></li><li><strong>Current URL portion:</strong> <strong>2519 bytes</strong>, about <strong>91% </strong>of dtSa</li><li><strong>Redirect URL parameters across the four URLs:</strong> ~<strong>1.1 KB</strong> of payload</li></ul><p>This is where precision matters.</p><p>Each redirect URL, success, error, pending, and back, contributed <strong>around 270 to 275 bytes</strong> on its own. Because all four URLs shared almost the same structure and the same verbose query parameter names, the cookie ended up storing <strong>four near-identical blocks of data</strong>.</p><p>Four redirect URLs at ~275 bytes each meant that <strong>around 1.1 KB of payload</strong> came solely from redirect URLs, before even accounting for the current page URL or additional analytics metadata.</p><p>Once combined with everything else, this pushed the <strong>total Cookie header to ~4.35 KB</strong>.</p><p>None of these URLs looked unreasonable individually.</p><p>Collectively, they pushed the request into a <strong>fragile zone</strong>, where <strong>Android WebView began behaving differently</strong>, causing the <strong>redirect to fail before the request could reliably reach the payment provider API</strong>, even though the same flow continued to work in full Chrome.</p><p>So yes, the cookie size was tangible and measurable.</p><p>But it still didn’t fully explain the 400.</p><h3>The missing piece: the redirect hop that has a 2048-byte ceiling</h3><p>In our flow, the “redirect problem” is not only the WebView moving between pages. There is also a redirect hop <strong>from the payment provider’s hosted page to a third-party provider</strong>, for example, Paysafe.</p><p>That hop is exactly where long URLs become dangerous, because third parties often impose hard limits on the size of URL fields.</p><p>Paysafe documentation, for example, specifies URL fields such as return URLs and cancel URLs as <strong>URL (2048)</strong>.</p><p>Once you see that, the incident reads differently:</p><ul><li>The redirect URLs were getting larger because we kept appending parameters.</li><li>Those long URLs were duplicated across success, error, pending, and back.</li><li>The payment provider then has to carry those URLs through its own flow and hand them off to a third-party provider on the next hop.</li><li>If that URL exceeds a 2048-character constraint, one of two things usually happens: it is rejected, or it is truncated.</li><li><strong>Truncation is the worst case</strong>; it tends to drop tail parameters first, which is often where client metadata and environment details end up.</li><li>Missing required parameters then surface as a <strong>generic 400</strong> with no helpful body, especially inside WebView.</li></ul><p>This is why the “cookie over 4 KB” observation was a helpful clue, but not the root cause. The growing cookie was signalling that our redirect URLs were ballooning and that we were losing headroom.</p><p>We cannot confirm the exact failure point with certainty because the redirect chain involves multiple parties, each with its own constraints and behaviours. The most likely explanation is a combination: an overlong redirect URL hitting a third-party ceiling, alongside tighter handling in older Android WebView implementations, which made the whole chain fail in a way that was hard to observe.</p><p>In other words, <strong>the cookie was not the only cause</strong>; it told us we were about to exceed a limit elsewhere in the redirect chain.</p><h3>Why does Android WebView break first?</h3><p>This is the part that makes the issue tricky, and also why it is worth sharing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*94r8BcBEre8_yUOyE8m9qw.png" /><figcaption>Android WebView vs Chrome behaviour comparison</figcaption></figure><p>Once we understood the size and structure of the request, the next obvious question was:<br><strong>Why did this only fail on Android WebView?</strong></p><p>There is no universal cookie limit that every runtime enforces consistently. People often cite around <strong>4096 bytes</strong> as a commonly supported minimum, but implementations vary, and embedded environments tend to enforce limits more strictly or behave differently under pressure.</p><p>What we observed in practice was very clear:</p><ul><li><strong>Desktop Chrome</strong> accepted the header, and the flow completed</li><li><strong>Mobile Chrome</strong> accepted the header, and the flow completed</li><li><strong>Android WebView</strong> failed before the request reliably reached the payment provider API</li></ul><p>This explains the worst part of the incident: <strong>the backend saw nothing</strong>. No logs, no errors, because the request never arrived.</p><p>This is also why WebView becomes the <strong>canary in the coal mine</strong>. If you are operating close to protocol or payload limits, WebView is usually the first environment to tell you that you have <strong>no headroom left</strong>.</p><h3>Why has it started happening now?</h3><p>At this point, the remaining question was not <strong>what</strong> was happening, but <strong>why it started happening now</strong>.</p><p>Looking back at the timeline, the Android WebView flow had been working previously. The failures only appeared after the payment platform migration, and the only visible symptom was that same silent 400-style network error during redirects.</p><p>After reviewing logs, code across Android, Web, and Backend, release history, and talking to multiple team members, a consistent pattern emerged.</p><p>On the <strong>15th of September</strong>, a change was introduced to support the new payment platform, <strong>Betler</strong>. As part of that change, the <strong>back-redirect URL parameter</strong> began being <strong>proxied to the payment provider</strong>.</p><p>Previously, this parameter had been effectively stripped out because it was <strong>not included in the provider’s allowlist of redirect parameters</strong>. Once that limitation was removed, the back URL started flowing through as part of the redirect payload.</p><p>That change alone did not break anything functionally. What it did was increase the footprint of the <strong>redirect URL</strong>. From that point on:</p><ul><li>The cookie header size started to grow</li><li>That growth was dominated by <strong>dtSa</strong></li><li>And dtSa growth was dominated by <strong>URLs</strong>, especially the full redirect URL set</li></ul><p>This is why the issue appeared suddenly rather than gradually. The system crossed a threshold.</p><p>At this stage, it was reasonable to frame this as a <strong>high-likelihood working hypothesis</strong> rather than a fully proven root cause.</p><p>The next step was to validate it.</p><h3>Validating the hypothesis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*txaZ99rVa3K9q9SRWABIHg.png" /><figcaption>Validation vs solution comparison</figcaption></figure><p>At this point, we had a strong, evidence-backed hypothesis, but it was still just that, a hypothesis. Before exploring long-term solutions, we needed to answer one simple question:</p><p><strong>Is the request payload size actually the trigger, or just a correlation?</strong></p><p>To do that safely, we treated this as an <strong>experiment</strong>, not a fix.</p><h3>The experiment</h3><p>From the earlier analysis, we knew that each redirect URL contributed roughly <strong>270–275 bytes</strong>, and that the recently added back_url redirect was the most recent contributor to the payload. Temporarily removing it would reduce the Cookie header size without changing any other part of the flow.</p><p>So we changed <strong>one variable only</strong>:</p><p>We removed the back redirect URL.</p><p>Nothing else.</p><h3>The rollout strategy</h3><p>Because this affected payments, we validated the change incrementally.</p><ul><li>First, with <strong>internal customers</strong> at <strong>Superbet</strong> in Poland</li><li>Then, with a <strong>small percentage of external traffic</strong>, around <strong>10%</strong>, in Poland</li><li>Once metrics looked stable, we ramped up to <strong>100%</strong> of traffic in Poland</li><li>From there, we started rolling the change out to other jurisdictions where the <strong>Nuvei</strong> integration was in use, including Romania</li></ul><p>At each step, we closely monitored completion rates and WebView failures.</p><h3>What we observed</h3><p>The results were consistent.</p><p>Once the back redirect was removed:</p><ul><li>The <strong>Cookie header size dropped below the fragile threshold</strong></li><li><strong>Android WebView redirects started working reliably again</strong></li><li>The <strong>payment flow completed successfully</strong></li></ul><p>As traffic increased, the failures faded away completely.</p><p>This gave us the confirmation we needed. The issue was not caused by redirect logic, backend validation, or the payment provider API. It was triggered by the <strong>request payload size</strong>, and <strong>Android WebView was simply the first environment to surface it</strong>.</p><h3>Why was this not the solution?</h3><p>This validation also made one thing very clear.</p><p>Removing the back redirect was <strong>not a real solution</strong>. That redirect is functionally essential for the user journey, and removing it permanently would be a regression.</p><p>What this experiment gave us was confidence, not closure.</p><p>At this point, the problem statement changed.</p><p>It was no longer <strong>“what is broken?”</strong></p><p>It became <strong>“how do we keep the behaviour and reduce the payload?”</strong></p><p>That is where the solution space opened up.</p><h3>Finding the right solution: The options we considered, and why</h3><p>Once we validated that the <strong>request payload size</strong> was the trigger, the problem statement became very clear:</p><p>How do we keep all redirect behaviour intact while reducing the payload enough to make Android WebView stable?</p><p>At this point, removing the back redirect was off the table. It had served its purpose as a validation step, but it was not an acceptable long-term solution.</p><p>This section describes the options considered to mitigate the high likelihood issue of an oversized dtSa cookie and a large overall Cookie header in Android WebView. The options are not strictly mutually exclusive; some can be combined or sequenced over time.</p><p>So we explored several alternatives, each with different trade-offs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MaFzjUSg3Ag55jplJvRxhg.png" /></figure><p>These estimates are based on applying each strategy to the same captured payload and re-running the size analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljjQlYTPMjz7uXPXsX7kag.png" /></figure><h3>Option 1: Ask vendors to reduce analytics payloads</h3><p>One obvious option was to ask third parties to reduce what they store inside analytics cookies, for example, by limiting which URLs are captured or compressing internal payloads.</p><p>This could work long term, but it comes with clear drawbacks:</p><ul><li>Timelines are outside your control</li><li>Changes are not guaranteed to land quickly</li><li>Even if they land, the reduction might not be sufficient</li></ul><p>This was a good <strong>parallel track</strong>, but not something we could rely on to unblock production. However, it was made clear that the payment provider couldn’t support us until 16th of December 2025, as it wasn’t a critical issue but rather a feature request, as we were affected exclusively by the new cashier embedded within a WebView.</p><h3>Option 2: Shorten redirect query parameter keys</h3><p>The most attractive option was to reduce the size at the source.</p><p>The redirect URLs contained many verbose query parameter names, repeated across four nearly identical URLs (success, error, pending, back). By shortening those keys at serialisation time, we could keep:</p><ul><li><strong>The same values</strong></li><li><strong>The same behaviour</strong></li><li><strong>The same redirect semantics</strong></li></ul><p>While <strong>significantly reducing duplication</strong>.</p><p>This approach had several advantages:</p><ul><li><strong>Fully owned by the frontend</strong></li><li><strong>Fast to implement</strong></li><li><strong>Measurable before rollout</strong></li><li><strong>Reversible behind a feature flag</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j3210_LqANzq1dz-7Os4MQ.png" /></figure><p>From the captured failing request, shortening keys alone reduced:</p><ul><li>dtSa size by <strong>~304 bytes (11.0%)</strong></li><li>total Cookie header size from <strong>~4.24 KB to ~3.95 KB</strong></li><li>per redirect URL size by <strong>~10%</strong>, multiplied across four URLs</li></ul><p>The main trade-off was reduced human readability of raw URLs and analytics data. This could be mitigated with <strong>explicit key mappings and documentation</strong>, making the compromise acceptable given the stability gains.</p><h4>Option 2.1: Shorten both keys and values</h4><p>A more aggressive variant of Option 2 was also to compress commonly repeated values, such as enum-like strings or environment flags.</p><p>This offered additional savings, but at the cost of:</p><ul><li><strong>Higher complexity</strong></li><li><strong>Harder debugging</strong></li><li><strong>Stricter coordination across teams</strong></li></ul><p>Based on the same payload evidence, this approach could reduce dtSa size by <strong>~15.3%</strong>, compared to <strong>~11%</strong> for keys only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hls-OFvp8IWa9z5caD5HQ.png" /></figure><p>We considered this a <strong>second step</strong>, to be used only if key shortening alone did not provide sufficient headroom under Android WebView constraints.</p><h3>Option 3: Replace redirect URLs with a compact identifier</h3><p>The most extreme option was to stop passing full redirect URLs altogether and replace them with a compact identifier or hash, backed by a lookup on the receiving side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXURQ3j1rfy7fNgHTnK2Vg.png" /></figure><p>This would give the <strong>maximum payload reduction</strong>, but it would also:</p><ul><li><strong>Require architectural changes</strong></li><li><strong>Introduce new moving parts in a critical payment flow</strong></li><li><strong>Increase coordination across systems</strong></li></ul><p>However, it comes with clear trade-offs:</p><ul><li>Requires a <strong>new architectural component</strong> to manage code-to-URL mappings</li><li>Introduces an <strong>additional dependency</strong> in a critical payment flow</li><li>Makes debugging more indirect, as URLs are no longer self-descriptive</li><li>Requires <strong>cross-team coordination</strong> across frontend, backend, analytics and potentially payment providers</li><li>Has a <strong>longer design and delivery timeline</strong>, making it unsuitable as a rapid stabilisation measure</li></ul><p>For these reasons, while attractive as a long-term architectural direction, this option was <strong>not appropriate as an incident-driven mitigation</strong>. It is better suited as a longer-term architectural improvement once the immediate fragility is addressed.</p><h3>What we went for, and the measurable impact</h3><p>After evaluating the options, the decision became straightforward. We chose to <strong>shorten redirect query parameter keys at serialisation time</strong>.</p><p>This approach gave us the best balance between <strong>risk, speed, ownership, and impact</strong>, while preserving the existing behaviour of the payment flow.</p><p>The key reasons were simple:</p><ul><li>It directly targeted the <strong>largest source of duplication</strong>, the redirect URLs</li><li>It reduced payload size <strong>without changing semantics or values</strong></li><li>It was <strong>fully owned</strong> by the frontend, with no vendor dependencies</li><li>It was <strong>easy to measure</strong> before and after rollout</li><li>It could be deployed <strong>incrementally and safely</strong> behind a feature flag</li></ul><p>In other words, it solved the actual problem we had validated, not a theoretical one.</p><h3>What we actually changed</h3><p>Instead of passing long, descriptive query parameter names in redirect URLs, we introduced a compact mapping at the point where URLs were generated.</p><p>For example:</p><ul><li>redirectPaymentStatus became ps</li><li>redirectProvider became pp</li><li>redirectMethod became pm</li><li>environment and platform flags were shortened in a similar way</li></ul><p>The important part is what we <strong>did not change</strong>:</p><ul><li>Values stayed the same</li><li>The redirected behaviour stayed the same</li><li>backend contracts remained intact</li></ul><p>Only the <strong>URL’s shape</strong> changed.</p><p>Because those same parameters were repeated across <strong>four redirect URLs</strong>, even small reductions per parameter added up quickly.</p><h3>Why this worked</h3><p>This change reduced the size of each redirect URL by a meaningful amount, and because those URLs were duplicated inside the analytics cookie, the savings were effectively multiplied.</p><p>The result was enough headroom to move the Cookie header away from the fragile threshold where Android WebView started behaving unpredictably. Importantly, this was not about squeezing bytes for the sake of optimisation. It was about <strong>restoring the safety margin</strong>.</p><h3>Why we did not go further (yet)</h3><p>We deliberately did not start with more aggressive approaches, such as compressing values or replacing URLs with hashes.</p><p>Those options remain valid, but they entail greater complexity and coordination costs. The key-shortening approach solved the immediate problem with minimal risk and left room for further optimisation if needed in the future.</p><p>Once stability was restored, we could afford to be deliberate rather than reactive.</p><h3>Key takeaways and lessons learned</h3><p>This issue looked, at first glance, like a redirect problem or a payment provider issue. It was neither. It was a <strong>payload size problem</strong>, and Android WebView was simply the first environment to expose it.</p><p>There are a few lessons from this that are worth carrying forward.</p><h3>1. Payload size is a real budget, not an abstract limit</h3><p>Cookies, headers, and URLs are not just implementation details. They are part of your network contract.</p><p>You can be well within what desktop Chrome tolerates and still be <strong>beyond what Android WebView can handle reliably</strong>. When you operate close to these limits, small, reasonable changes can suddenly tip the system over.</p><h3>2. Analytics and observability can break production flows</h3><p>Analytics tooling is invaluable, but it often captures <strong>more context than you realise</strong>, sometimes duplicating URLs or metadata in ways that are hard to spot until something fails.</p><p>In our case, analytics cookies were carrying multiple full redirect URLs, multiplying the impact of otherwise reasonable query parameters. That does not make analytics “bad”, but it does mean they need to be considered part of the critical path.</p><h3>3. WebView is the canary in the coal mine</h3><p>If something works everywhere except Android WebView, that is usually a signal, not an anomaly.</p><p>WebView tends to be the most constrained environment, and it will surface issues around size, timing, and protocol edge cases earlier than full browsers. Treat those failures as early warnings, not platform-specific quirks.</p><h3>4. Validation is not the same as a solution</h3><p>Temporarily removing the back redirect validated our hypothesis, but it was never the fix.</p><p>Treating validation steps as experiments, with controlled rollouts and clear success criteria, enabled proving causality without introducing regressions. Only once we had that confidence did it make sense to invest in a proper solution.</p><h3>5. Prefer solutions you own, especially under pressure</h3><p>Shortening query parameter keys was not the most elegant or theoretically perfect solution, but it was <strong>fast, low risk, fully owned</strong>, and <strong>measurable</strong>.</p><p>In production incidents, restoring headroom and stability matters more than architectural purity. You can always come back later and improve things once the system is no longer fragile.</p><h3>Final thoughts</h3><p>The biggest lesson for me is not “cookies have limits”. We all know that.</p><p>The lesson is: <strong>you can be within what Chrome tolerates and still be beyond what WebView tolerates</strong>, and the failure mode can be silent enough that you will blame the wrong system for days.</p><p>If Android WebView breaks first, treat it as a signal that your system has lost its safety margin.</p><p>And if your observability tooling embeds your URLs in cookies, you now know where to look.</p><h3>Practical advice if you hit something similar</h3><p>If you are reading this and thinking, “this could happen to us”, here is what I would do immediately:</p><ol><li>Capture the failing request from WebView, cURL if possible</li><li>Measure the Cookie header size, do not guess</li><li>Identify the top cookie contributors</li><li>Inspect for duplication patterns, especially URLs embedded in analytics cookies</li><li>Reduce repeated verbosity first; keys are a great low-risk win</li><li>Roll out behind a flag, ramp gradually, and monitor Android completion rates</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=042f72283176" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Day I Walked Away Thinking “I Could Have Done Better”]]></title>
            <link>https://medium.com/@byeduardoac/the-day-i-walked-away-thinking-i-could-have-done-better-fdf030c21000?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdf030c21000</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[career-growth]]></category>
            <category><![CDATA[mentoring]]></category>
            <category><![CDATA[failure-to-success]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Sat, 09 Aug 2025 16:28:24 GMT</pubDate>
            <atom:updated>2025-08-09T16:31:24.185Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0yQ_YKgroZo0CZpnk0owQ.png" /></figure><p>Yesterday, I recorded my very first podcast with <a href="https://neciudan.dev/">Dan Neciu</a>.</p><p>It was a moment I’d been looking forward to for weeks — a chance to talk about something deeply important to me: mentoring engineers.</p><p>And yet… when the conversation ended, an all-too-familiar voice popped up in my head:</p><p><em>“I could have done better.”</em></p><p>If you’ve ever walked away from an important meeting, presentation, or conversation replaying everything you <em>should</em> have said, then you know that feeling.</p><p>It’s uncomfortable. It’s frustrating. And if we’re not careful, it can quietly eat away at our confidence.</p><h3>The Turning Point</h3><p>After years of speaking at conferences, leading meetups, and mentoring dozens of engineers, you’d think I’d be immune to this. I’m not.</p><p>But here’s what I’ve learned: moments like these aren’t failures — they’re <em>pressure</em>.</p><p>And just like diamonds, we are shaped and refined by pressure.</p><p>Yesterday, halfway through my workout, I stopped, sat down, and confronted those feelings head-on.</p><p>The result? I turned that raw frustration into one of the most personal and actionable pieces I’ve ever written — a story about how to channel failure into success, and how mentoring can help turn setbacks into rocket fuel for growth.</p><p>👉 <strong>Read the full article here:</strong><br> <a href="https://eduardo-aparicio-cardenes.website/blog/channeling-failure-into-success-mentoring-lessons-for-engineers"><strong>Channelling Failure into Success: Mentoring Lessons for Engineers</strong></a></p><p><em>Nin (忍) === Win. Diamonds are formed by pressure.</em></p><p>#Engineering #Mentoring #Leadership #CareerGrowth #FailureToSuccess</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdf030c21000" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Higher-Order Components vs Vue.js Slots: A Dynamic Components Comparison]]></title>
            <link>https://medium.com/@byeduardoac/react-higher-order-components-vs-vue-js-slots-a-dynamic-components-comparison-9368efd7ad1a?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9368efd7ad1a</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[vuejs-3]]></category>
            <category><![CDATA[vuejs-development]]></category>
            <category><![CDATA[dynamic-components]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 16:55:57 GMT</pubDate>
            <atom:updated>2025-03-30T11:27:14.352Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LypxaBmmCX6tbTYHKEEauA.png" /><figcaption>React Higher-Order Components vs Vue.js Slots: A Dynamic Components Comparison</figcaption></figure><p>Recently, I faced the interesting challenge of customising the experience of a button group component on VueJS as part of my job at Happenning. As someone deeply experienced in React but a newcomer to VueJS, I approached the problem as I would on React by turning the value property from a string into a ReactNode (component) and attempting to pass it down to be evaluated within the loop but quickly realise that it wasn’t as simple as I thought so I decided to bring today my learnings on how to achieve such a things on VueJS but more interestingly how React compares to VueJS to achieve such a thing.</p><p>So please fasten your seatbelts and put your tray table in the upright position. This will be an incredible journey you won’t want to miss.</p><h3>The challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*ti-8jF0LUvTS5GP6HU_zAg.png" /><figcaption>Example: deposit amount quick select large devices</figcaption></figure><p>Imagine we have a RadioButtonGroup component responsible for showing multiple buttons arranged uniformly, behaving like a radio button, and allowing one choice. However, on smaller devices, the currency text in the buttons breaks onto the following line due to insufficient horizontal spacing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*pI2GBC89ionNhtyLwofm6Q.png" /><figcaption>example: deposit amount quick select in smaller devices</figcaption></figure><p>In addition, this particular component is expected to receive a list of objects containing various properties such as icons, badges, and key-value pairs.</p><p>For this article, we will focus exclusively on the key-value pair and the challenge of customising the option label field within the RadioButtonGroup component, considering that the product decision is to hide the currency in smaller devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QD23vtJ6G6YGwNUs" /><figcaption>VueJS vs React — Radio Button Group component</figcaption></figure><p>At first glance, Vue.js and React components seem pretty similar. However, our goal here is to explore in more depth how each library tackles supporting passing a custom component to handle the label customisation, minimising RadioButtonGroup behaviour disruptions and supporting product requirements.</p><h3>Design Considerations</h3><p>To tackle this challenge effectively while minimising disruptions, we made the following key decisions:</p><ol><li><strong>Maintain Backward Compatibility</strong>: Ensure that existing consumers of the component experience no unexpected breakages.</li><li><strong>Keep the Component Agnostic</strong>: The component should not dictate how labels are rendered, preserving flexibility.</li><li><strong>Support Label Customisation</strong>: Introduce a mechanism for customising the label rendering.</li><li><strong>Delegate data manipulation</strong>: The component should delegate label rendering to a customization layer, avoiding rigid implementations (e.g., treating “100 EUR” differently from { amount: “100”, currency: “EUR” }).</li></ol><p>For those interested in best practices, trade-offs, and the reasoning behind these decisions, refer to the Annexe section below.</p><h3>The Solution</h3><p>When we approach this problem with an open mind, we can see multiple ways to tackle dynamic components and customization in Vue.js and React. This article will explore how each library handles these challenges and compare their approaches.</p><p>I’d like to mention that I received valuable support from great colleagues in finding these answers, but they’re not perfect. So, as you go through the solutions, please use your own judgment. If you have any improvements, feel free to leave a comment below; I’d love to hear your thoughts on how they can be improved. 👇</p><h3>Solving this with VueJS</h3><p>VueJS 3 currently support two ways of providing this kind of customisation into the RadioButtonGroup component, both are different towards developer experience and value, so we will explore them to guide a holistic view of the alternatives.</p><p><strong>Option 1: Using a Dynamic Component</strong></p><p>This approach allows the <strong>label</strong> to be rendered as a dynamic component inside <strong>RadioButtonGroup</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25a5bccdb45c789b31f7a8a7da00ff0a/href">https://medium.com/media/25a5bccdb45c789b31f7a8a7da00ff0a/href</a></iframe><p><strong>What this option provides</strong>:<br> This approach uses the h function in Vue.js to create a VNode (similar to a ReactNode) that can be passed down to the component for rendering. The component :is=&quot;option.label&quot; directive is used to dynamically render the passed component as the label.</p><p>✅ <strong>Pros</strong>:</p><ul><li><strong>Simple and Declarative</strong>: Allows dynamic rendering of custom components in a very Vue-idiomatic way.</li><li><strong>Flexible</strong>: Provides full flexibility for passing any component to render.</li></ul><p>🚫 <strong>Cons</strong>:</p><ul><li><strong>Type Safety</strong>: This approach may have issues with type checking, as it doesn’t enforce specific types when passing custom components.</li><li><strong>No Prop Management</strong>: Props may be splattered and not properly scoped for the child component.</li></ul><p><strong>Option 2: Using a Slot</strong></p><p>Here, we use a slot inside the <strong>RadioButtonGroup</strong>., allowing the parent component to control how the <strong>label</strong> is rendered.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1f6f1ffc71e1d3ab3b1884abb093cfd/href">https://medium.com/media/c1f6f1ffc71e1d3ab3b1884abb093cfd/href</a></iframe><p><strong>Slots</strong> are more idiomatic and more powerful in Vue.js (you can pass anything from the parent component, apply styling, and avoid prop drilling or overrides). Slots preserve type checking, whereas &lt;component :is=&quot;option.label&quot; /&gt; generally drops types.</p><p>✅ <strong>Pros</strong>:</p><ul><li><strong>Strong Type Checking</strong>: Slot usage maintains proper type integrity.</li><li><strong>Flexibility</strong>: The parent has full control over the content rendered in the slot.</li><li><strong>Idiomatically Vue</strong>: Using slots is the preferred and idiomatic way to customize content.</li></ul><p>🚫 <strong>Cons</strong>:</p><ul><li><strong>Less Explicit</strong>: The lack of a clear render mechanism can be confusing to new Vue.js developers.</li><li><strong>Requires More Setup</strong>: You must define the slot in the child and pass the custom content from the parent.</li></ul><h3>Solving This with React</h3><p>React, unlike Vue.js, does not have a built-in slot system. Instead, it relies on <strong>composition through ReactNode</strong>, <strong>render props</strong>, or <strong>higher-order components (HOCs)</strong> to achieve similar levels of customization.</p><h4>Option 1: Using ReactNode as a Prop</h4><p>The simplest way to customise the label is to pass a ReactNode (JSX element) instead of a string.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/859f6371069eb6a05bb34807444228ae/href">https://medium.com/media/859f6371069eb6a05bb34807444228ae/href</a></iframe><p>The RadioButtonGroup component accepts an array of option objects, each containing value and label properties. The label property can either be a string or a JSX element. Here, label is passed as a JSX element (&lt;CustomElement displayName=&quot;100 EUR&quot; /&gt;), which is then rendered as part of the RadioButtonGroup.</p><p>✅ <strong>Pros:</strong></p><ul><li>Simple and intuitive.</li><li>Full flexibility to pass in components.</li><li>React naturally supports JSX as children.</li></ul><p>🚫 <strong>Cons:</strong></p><ul><li>Not as explicit as Vue slots for customization.</li><li>TypeScript can struggle with mixed types (e.g., string | JSX.Element).</li></ul><h4>Option 2: Using Render Props</h4><p>To explicitly define how the label is rendered, we can provide a <strong>render function</strong> as a prop:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab68b4a6a2d5986f48f228b1e7fe53bd/href">https://medium.com/media/ab68b4a6a2d5986f48f228b1e7fe53bd/href</a></iframe><p>The RadioButtonGroup component accepts a renderLabel function as a prop. The renderLabel function is called for each option in the optionList. This function receives the option object, and it&#39;s responsible for rendering the label, which can be a custom JSX element or component based on the data in option.</p><p>✅ <strong>Pros:</strong></p><ul><li>More explicit than passing ReactNode directly.</li><li>Works well with TypeScript (explicit types).</li></ul><p>🚫 <strong>Cons:</strong></p><ul><li>More verbose than Vue slots.</li><li>Requires additional function calls, which can be slightly less performant.</li></ul><h4>Option 3: Using Higher-Order Components (HOCs)</h4><p>A more advanced pattern in React is to <strong>wrap</strong> the RadioButtonGroup with an HOC that injects label customization logic:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/514a89d7f80685b17aa6f15c44e66101/href">https://medium.com/media/514a89d7f80685b17aa6f15c44e66101/href</a></iframe><p>The withCustomLabel HOC wraps the RadioButtonGroup component and injects custom label logic. In this case, the label field of each option is transformed into a JSX element (&lt;CustomElement displayName={option.label} /&gt;). The HOC provides an enhanced version of the RadioButtonGroup with custom label logic.</p><p>✅ <strong>Pros:</strong></p><ul><li>Encapsulates logic cleanly.</li><li>Works well in component libraries.</li></ul><p>🚫 <strong>Cons:</strong></p><ul><li>Overkill for simple cases.</li><li>Less popular since React Hooks became the norm.</li></ul><h3>Comparing Vue.js and React Approaches</h3><p>The tables highlight these key differences by showing that while <strong>Vue.js slots</strong> provide an easy and explicit way to customize components, <strong>React’s JSX and render props</strong> offer more fine-grained control at the cost of complexity. Both systems prioritise flexibility but in different ways. Vue focuses on simplicity, and React on extensive composability, making the choice of framework depend on the developer’s need for clarity versus dynamic flexibility.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/186c9307eb965bf6bd2ee9508c744e3b/href">https://medium.com/media/186c9307eb965bf6bd2ee9508c744e3b/href</a></iframe><p>Vue.js and React take fundamentally different approaches to component customisation. Vue.js offers a <strong>declarative system</strong> with <strong>slots</strong>, making it easy to inject custom content into components in a clear and structured way. Vue requires you to explicitly declare the slot in the template, which adds an additional layer of setup.</p><p>The <strong>slots system</strong> is ideal for clear and intuitive customisations, though it <strong>may not scale well for more complex dynamic content scenarios.</strong> This is particularly noticeable when defining <strong>dynamic components</strong> or handling more complex customisations, as Vue often requires extra steps to specify slot names and pass content into them.</p><p>In contrast, React provides more <strong>flexibility</strong> through <strong>JSX, render props, and higher-order components (HOCs)</strong>. React’s approach allows for explicit control over component behavior, particularly with render props and JSX elements, making it highly customisable.</p><p><strong>React’s JSX</strong> system, on the other hand, <strong>allows for more direct composition</strong>, meaning you can simply pass <strong>ReactNodes</strong> or <strong>components</strong> directly into the parent component without explicitly defining placeholders like Vue’s slots. The simplicity of this model often means less boilerplate and easier customizations in smaller applications, especially for developers familiar with JSX.</p><h3>Final Thoughts</h3><p>When compared, <strong>Vue.js</strong> and <strong>React</strong> both offer powerful tools for component customisation, but they approach the task differently.</p><p><strong>Personally, I lean towards React’s composition model </strong>for the reasons already exposed, especially as projects grow in complexity; handling side effects, re-renders, and customisation can be managed in a more predictable and scalable manner. Particularly, Vue’s Single File Components (SFCs) can become large, making them harder to read and maintain. Additionally, Vue requires <strong>explicit setup for reactivity</strong> (e.g., ref() and reactive() in the Composition API), while React’s state management is <strong>implicitly handled</strong> through hooks like useState and useEffect.</p><p>However, I acknowledge that <strong>Higher-Order Components (HOCs) are more fragile than slots</strong>, as HOCs require awareness of a child component’s implementation details, potentially introducing unintended dependencies. In contrast, Vue’s <strong>slots</strong> promote encapsulation by allowing flexible content injection, making it easier to create declarative and highly customisable UI structures.</p><p>However, while coding <strong>React’s broader architecture </strong>naturally lead us towards<strong> KISS over DRY</strong>, encouraging a clear, composable interfaces over tightly coupled logic. Vue.js, on the other hand, naturally encourages <strong>encapsulating logic within components</strong>, given the convenience of scoped slots and its reactivity system.</p><p>Over the years, we have seen how the industry has evolved towards <strong>clearer component interfaces, </strong>as seen in modern UI libraries such as Ant Design and Material UI (Check the Annexe 👇 for more details). These libraries favour <strong>composability and customisation</strong> over deeply nested, all-inclusive components. Given the varied nature of web applications and the increasing demand for flexibility, <strong>React’s approach tends to align better with modern UI component architecture trends</strong>.</p><h3>Annexe: Design Considerations</h3><p>As we tackle every problem we encounter in our daily lives, we must understand the context to provide effective solutions that consider our system&#39;s constraints. Otherwise, we will fix our particular issue but affect other developers and customers along the way.</p><h3>Understanding the current architecture</h3><p>The mindset of DRY (Don’t repeat yourself) components where all the logic is self-contained has fallen out of favour because it presents the challenges towards flexibility, adaptability and maintainability as the component can be used in multiple different contexts, for instance, if RadioButtonGroup is used to display notifications, menus, navigation, etc.</p><p>These days, component libraries have moved towards a different philosophy, easy to read and change, showing components that explore KISS (keep it simple and stupid), exposing an easy-to-use interface that allows you to customize the component and adjust to your particular use case using syntax like Ant Design does for their <a href="https://ant.design/components/radio">radio component</a>. <em>Explore the Ant Design Radio Button Playground</em> <a href="https://codesandbox.io/p/sandbox/37pcq7"><em>here</em></a><em>.</em></p><pre>&lt;Radio.Group&gt;<br>  &lt;Radio.Button value={}&gt;{label}&lt;/Radio.Button&gt;<br>  &lt;Radio.Button value={}&gt;{label}&lt;/Radio.Button&gt;<br>  &lt;Radio.Button value={}&gt;{label}&lt;/Radio.Button&gt;<br>&lt;/Radio&gt;</pre><p>As with most engineering decisions, there is no clear winner but rather trade-offs: DRY components will sacrifice flexibility to minimise boilerplate code, while KISS is the way around.</p><h3>Scoping your change</h3><p>While doing our work, we tend to improve things, but this can quickly increase the scope of changes we aim to make, leading to wasted engineering effort, frustration, and disagreement.</p><p>Hence, it’s vital to keep yourself grounded, particularly when you enter a new job, project, or organisation. Based on your experience, personal preferences, and surrounding tech debt, you can start making large changes that will delay your fix from reaching the customers.</p><p>First, allow yourself to go through the brainstorming as your curiosity, passion and drive should always be encourage but take the time to write them down how things are and how you will do things in a piece of paper or document so you can take a step back when written to break it down in quick win and medium and short term solutions like I am doing on this article, I wanted to compare VueJS vs React but I am writing also about principles and philosophies towards better architect solutions and insights on how to approach this challenges.</p><h3>Be mindful of the existing consumers.</h3><p>When you are altering any existing behavior, it is tempting to change the component in a way that fixes your issue. Still, you must always think about how other people will adopt the change and the importance of caring for them so always aim to be backwards compatible or minimise disruptions like React does within his ecosystem when function components replaced classes or hooks replaces classes lifecycles and avoid outcome like Angular 1 to 2 fiasco that drive a lot of developers away from a great framework.</p><p>However, if you need to make a disruptive change, you must provide a clear path forward with examples, migration guides, and tools to enable them to do so. Expo is an excellent example of tooling for migrating between versions.</p><h3>Document your decisions</h3><p>While we were talking about scoping your change, it’s valuable to document what decisions and why you have taken them to add to your ticket or PR to allow others have the necessary context to provide effective feedback as it happens to you while you are looking into all the potential solutions, scope and context same it will be experience by people that are outside of the work that you have done so it could help them to trim the decision tree and get better perspective on what you achieving with you changes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9368efd7ad1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging Metrics to Communicate Business Value]]></title>
            <link>https://medium.com/@byeduardoac/leveraging-metrics-to-communicate-business-value-facd91f72cfa?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/facd91f72cfa</guid>
            <category><![CDATA[better-software-engineer]]></category>
            <category><![CDATA[engineering-practices]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[data-driven-decisions]]></category>
            <category><![CDATA[incident-management]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Sun, 06 Oct 2024 15:14:43 GMT</pubDate>
            <atom:updated>2024-10-06T15:42:42.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_LF_KVrcEDtomyRiYLXBg.png" /><figcaption>Leveraging Metrics to Communicate Business Value</figcaption></figure><p>Over the past decades, it’s been a transformative reality where metrics have become part of our day-to-day lives with different flavours. We use them to compare products, select vacations, choose banks, decide between job opportunities or compare graphic cards; metrics provide us with simple to digest information to guide our decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/0*m8v2u651j34m9_bB" /><figcaption>Metrics usage across products to communicate value (Booking, Amazon, Npm, etc)</figcaption></figure><p>My goal with this article is to share my view on how you can enhance communications within your organisation through the use of metrics. Over the years of working within different organisations, I’ve noticed that technical conversations among engineers often revolve around opinions and personal preferences. While this might work to cause discussions, it becomes pretty ineffective in decision-making as it might lead to long, drawn-out conversations, as there is an invisible gap between understanding and knowing.</p><p>Therefore, I want to share three ways metrics can help elevate these conversations in your organisation and among your peers. Imagine walking into a room filled with strong opinions. By bringing data to the table, we can transform those heated debates into clear, fact-based discussions that everyone can rally around. Metrics offer an unbiased foundation to support your viewpoint, making it easier for your audience to understand your perspective and move past the subjective opinions.</p><h4>Why Should Engineers Care About Metrics?</h4><p>You might be asking why we engineers, of all people, should care about metrics; honestly, this is a valid question. Consider the last time you talked to your colleagues and didn’t convince them of your point of view. While strong opinions can drive passionate debates, they don’t always lead to predictive outcomes. Metrics, on the other hand, shift the focus from opinions to facts as an engineer who knows how to use the organisation’s data to measure value effectively. These are some of the benefits I found when metrics using metrics effectively:</p><ul><li><strong>Move from opinions to data: </strong>Make conversations objective and centred around facts.</li><li><strong>Simplify complex discussions: </strong>Clear data simplifies complex subjects like architectural decisions.</li><li><strong>Bridge knowledge gaps</strong>: Audiences with different expertise levels can easily follow a data-driven argument.</li><li><strong>Easy to optimise for</strong>: Metrics provide a baseline to measure progress and optimise effectively.</li><li><strong>Enhance decision-making</strong>: Transition from qualitative to quantitative discussions.</li></ul><h3>The Power of Metrics to Communicate Business Value</h3><p>Let’s talk about one of the most critical areas where metrics can make a positive impact: communicating business value. Recently, I started conversations with our organisation’s product, engineering and design teams about the importance of investing resources into improving our design system. While we all understood its significance, the reality is that we were struggling to get dedicated resources. We were competing with other high-priority items in the company roadmap, and without clear return of investment (ROI) metrics, we lacked enough evidence to justify moving forward.</p><p>Consequently, this led me to take a step back and think critically about how we could quantify the value of the design system in a way that resonated with the team; I realised that by presenting a clear and simple message using metrics, we could cut through the noise and provide a compelling case based in data, not just a gut feeling. To illustrate this example, let’s look at an example of how these two ways of presenting arguments can look like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2TWZ0K9v2LPTmriy" /></figure><p>Looking at the example above, both messages have merit and describe the same reality. However, the second one offers a clearer, measurable message for the audience that we can optimise. Therefore, the next time you have to talk to others, think about ways to provide a clear message using metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2XKtSSQ8WtoFdhn6" /><figcaption>Design system — Component Usage across projects</figcaption></figure><p>To further reinforce the concept, let’s take a closer look at the image above to understand how components are used in this design system. By examining the usage of components within a design system library, we can easily understand how we are utilising the available components. This provides us with actionable metrics we can optimise for, enabling better communication within the engineering team to understand why people may not use the components to their full extent. This could be due to various reasons, such as lack of need, difficulty in use, or lack of discoverability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*doGoi4GP6asHpqdj" /><figcaption>Component usage over time (credit to <a href="https://medium.com/@cervomatheus?source=post_page-----b389308d6663--------------------------------">Matheus Cervo</a>)</figcaption></figure><p>If we combine the component usage data above with their use over time, we can identify patterns to help us make better decisions. In this case, a likely cause of underutilisation could be that while the design team’s design has evolved, the design system itself hasn’t kept pace. As a result, engineers may be forced to create custom components to deliver new features.</p><p><strong>Note</strong>: Are you curious to dive deeper into design systems? Stay tuned for my upcoming article series, where I will explore how I apply this and other techniques to improve a real-life design system within our organisation, touching on metrics and standardization to how to write strategic and roll-out plans.</p><h3>Shift Left Decision-Making Using Metrics</h3><p>We’ve already discussed the importance of using metrics to enhance conversations. Now, let’s take this concept further by shifting left. By integrating metrics earlier in the decision-making process, we can catch issues sooner, make informed decisions earlier, and ultimately reduce unnecessary costs.</p><h4>Using Issue Triage as an Example</h4><p>A great example of where this “shift left” approach can bring value is issue triage. In many organisations, it’s common to jump straight into fixing an issue as soon as it’s spotted, often without fully understanding its impact. On the flip side, some issues get added to the backlog and are forgotten until a stakeholder suddenly demands action; sometimes, the bug can remain years in the backlog from the team without having provided any value in the meantime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/0*u4LKJwNOF_REGqkX" /></figure><p>Here’s where metrics can help us give the right level of attention to each issue. Mature organisations typically have some form of triage process in place, but it’s often inefficient and requires multiple teams to weigh in, consuming time and resources. By using data more effectively, we can streamline this process.</p><h4>Why Is This Important?</h4><p>Consider how often you’ve been asked to fix a bug that affected only a single internal user, or you had to drop what you were doing because the product team wanted to know how severe a particular issue was. These situations can be avoided by using the available data to create metrics that automatically triage most cases.</p><p>With proper metrics in place, we can assess the real impact of an issue, whether it affects a single user, a specific user group, or the entire customer base. This allows engineers to prioritise their time and focus on what matters most, providing the following benefits:</p><ul><li><strong>Efficient triage</strong>: Using metrics to assess the priority and impact of issues helps teams focus on the most critical tasks, avoiding unnecessary work on low-impact problems.</li><li><strong>Preventing wasted effort</strong>: It reduces the chances of working on problems that don’t significantly affect business value, like minor bugs that affect only a few users.</li><li><strong>Reduced context-switching</strong>: Metrics-driven triage minimises interruptions caused by urgent, last-minute requests, allowing engineers to focus on their priorities and maintain productivity.</li><li><strong>Clear impact visibility</strong>: Metrics provide transparency across teams, making it easy to see the direct impact of decisions, which fosters accountability and better cross-functional collaboration.</li></ul><h4>Measuring Impact</h4><p>This approach applies to many different cases, but when it comes to issue triage, a common method of measurement is an incident prioritisation matrix. This allows us to quickly and straightforwardly evaluate incoming issues to engineering and assign them a priority based on the category they fall into.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*_gGYiJU1oiLQc0QjAfC-pw.png" /><figcaption>Incident Priority Matrix (credits to Sophie Danby)</figcaption></figure><p>In the image above, we illustrate a series of cases that can bring us some clarity on how to approach this. Nevertheless, this requires us to measure things correctly to know what’s causing each problem and categorise it, considering things like:</p><p><strong>How many users are affected?</strong></p><p>Is it fewer than 10 users out of millions, or does it impact a significant portion of the user base?</p><p><strong>Metrics</strong>: Number of users who logged the issue, usage frequency, and user segments affected.</p><p><strong>What is the nature of the issue?</strong></p><p>Does the issue have regulatory implications? Is it purely a visual or style-related problem, or is it a critical API failure?</p><p><strong>Metrics</strong>: System affected (e.g., payments, authorisation, user profiles), geographic regions, countries, or specific markets impacted.</p><p><strong>If it’s an API failure, what is the scope of the impact?</strong></p><p>Does it affect the web, mobile, or both? Are all devices affected, or just specific ones (e.g., Android, iOS, Windows)?</p><p><strong>Metrics</strong>: Device ID, user-agent, trace ID, platform (e.g., web or mobile), and request failure patterns.</p><p><strong>What’s the criticality of the affected system?</strong></p><p>Is it related to core functionality like login, payments, or user account changes?</p><p><strong>Metrics</strong>: Meta information about the system, results from regression testing, aggregated data from the metrics above, and historical failure patterns.</p><p><strong>What is the user’s journey at the time of the incident?</strong></p><p>Collecting stack traces, logs, and events can provide context about where in the workflow the issue occurred and help pinpoint its impact more accurately.</p><p>By measuring and answering these questions, engineering teams can make informed decisions about how to address each issue, prioritise their work, and minimise the impact on the user experience. This data-driven approach reduces guesswork and improves the efficiency of issue triage, ensuring that high-priority problems get the attention they deserve while lower-impact issues don’t unnecessarily consume valuable resources.</p><h3>Aim for completeness</h3><p>When sharing information, it is easy to get caught providing only part of the information to influence decision-making in a certain direction. While this might work in the short term, it risks undermining your credibility in the long run and can lead to costly mistakes or larger issues down the line.</p><p>It’s essential to present a full picture for yourself and others when exploring alternatives, including the impact, trade-offs and implications of the situation. By aiming for completeness, you build trust with your audience and help ensure that decisions are based on accurate data.</p><h4>Real-life Example: CI Costs in GitHub Actions</h4><p>Let’s explore the cost of using GitHub Actions as part of a continuous integration (CI) pipeline using a real-world example. For context, the CI cost of a GitHub project is generally expressed in GitHub minutes, and the price will vary depending on the machine used to run the actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GNyElrvd4aSoP1fF" /><figcaption>Understanding CI Costs in GitHub Actions: A Real-Life Example</figcaption></figure><p>For simplicity, we will use the <a href="https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions#per-minute-rates-for-standard-runners">smallest standard GitHub runner</a>, which costs <strong>$0.008 per minute.</strong></p><p>Consider the mobile application within your organisation shared across all the teams with an average of <strong>100 pull requests (PRs) per week</strong>. Due to the complexity of the project and the number of tests required, each CI execution for this repository takes <strong>90 minutes</strong> on average.</p><p>At first glance, the weekly cost of running CI for this repository looks manageable:</p><p>100 PRs / week * 90 minutes/PR * 0.008 $/minutes = $72/week</p><p>However, let’s dig deeper. Metrics show that tests in this project are unreliable, failing <strong>2.2 times on average per PR</strong>, with some PRs failing up to <strong>7 times</strong>. This increases the cost significantly:</p><p>$72/week * 2.2 retries/PR = $158.40/week</p><h4>Understanding the Bigger Picture</h4><p>This isolated figure might not seem alarming. But if we compare it to the overall infrastructure cost, say <strong>$1,500 per week</strong> for your AWS infrastructure, running the CI for this single repository costs the equivalent of <strong>10%</strong> of your total infrastructure budget. These numbers provide clear, actionable insights for the audience, allowing us to see the reality of the project. This enables us to prioritise technical debt reduction, thereby reducing costs, while also providing a baseline for optimisation, as described in previous sections.</p><h4>Beyond Financial Impact</h4><p>The cost implications are not just financial. Frequent test retries can negatively impact <strong>engineer morale</strong>, leading to frustration and a loss of confidence in the system’s quality. This, in turn, can slow down development and increase the risk of further issues in the long run.</p><p>Furthermore, the calculation provided only covers pull requests (PRs). Continuous Integration (CI) also runs on feature branches after every developer push, so the real cost is likely even higher. By tracking the number of branch runs, total pushes, and their corresponding CI executions, you can get a more accurate picture of the total cost.</p><h4>Work towards making data-informed decisions</h4><p>By gathering and presenting comprehensive metrics for cost, performance, or reliability, you create a clear, data-driven basis for decision-making. This allows for better prioritisation of efforts, such as optimising CI, addressing technical debt, or improving test reliability as discussed in earlier sections. Ultimately, complete and transparent information is essential for making informed, strategic decisions that drive long-term success.</p><h3><strong>Final thoughts</strong></h3><p>After discussing these three key areas for elevating your conversations to the next level using metrics to engage the business and improve systems, mitigate tech debt, and optimise resources, we provided practical examples of improving critical areas such as incident management, design systems, and prioritising technical debt. These real-life examples allow for clearer and more impactful conversations.</p><p>It’s essential to bridge the gap between understanding specific problems and knowing the trade-offs and cost opportunities of different alternatives. Metrics pave the road to success, enabling a smoother ride for the next challenge and improvement. When considering what data could enable the creation of necessary metrics to describe your optimisation goals, it’s crucial to think about the next challenge and improvement.</p><p>Ultimately, it’s not just about collecting data but using it to tell a compelling story. Metrics provide the clarity and context needed to make informed decisions, align cross-functional teams, and move the organisation forward with confidence. By aiming for completeness, transparency, and consistency in the way we present and act on metrics, we can create a more efficient, reliable, and scalable engineering process.</p><p>Start thinking beyond assumptions, close the invisible gap, and let metrics be the foundation of your next decision.</p><h3>Resources</h3><ul><li><a href="https://blog.invgate.com/itil-priority-matrix">ITIL Priority Matrix: How to Use it for Incident, Problem, Service Request, and Change Management</a> by <a href="https://blog.invgate.com/author/sophie-danby">Sophie Danby</a></li><li><a href="https://uxdesign.cc/design-systems-adoption-metrics-over-the-past-5-years-b389308d6663">The challenge of Design Systems adoption metrics</a> by <a href="https://medium.com/@cervomatheus?source=post_page-----b389308d6663--------------------------------">Matheus Cervo</a></li><li><a href="https://github.com/EduardoAC/design-system-metrics">Design system metrics</a> by <a href="https://github.com/EduardoAC">Eduardo Aparicio Cardenes</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=facd91f72cfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guide for URL Query vs Path Parameters in protected Web Apps]]></title>
            <link>https://medium.com/@byeduardoac/guide-for-url-query-vs-path-parameters-in-protected-web-apps-36362cd619c9?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/36362cd619c9</guid>
            <category><![CDATA[url-structure]]></category>
            <category><![CDATA[web-app-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[query-parameters]]></category>
            <category><![CDATA[path-parameter]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 10:16:54 GMT</pubDate>
            <atom:updated>2024-09-15T10:16:54.905Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>Guide for URL Query vs Path Parameters in Protected Web Apps</h3><figure><img alt="Using standardised REST API practices to Web Application URLs" src="https://cdn-images-1.medium.com/max/1024/1*_lYgrsuvEetZRynWM4U5oA.png" /><figcaption>Using standardised REST API practices to Web Application URLs</figcaption></figure><p>Recently, I had an engaging discussion about the best way to structure parameters within a website’s URL. It reminded me of my earlier work on eCommerce platforms between 2016 and 2018, where optimising URL structures was crucial. Since then, I’ve been focused on Fintech and credential-protected products, where URL structuring became less critical.</p><p>However, revisiting this topic by reading about other bloggers and their posts brought back memories of a few barely touched aspects that are invaluable in simplifying our codebase and enhancing the overall user experience.</p><p>In this article, I’ll share insights on using slugs, path parameters, and query parameters in web applications. These are key concepts in crafting clean, efficient URLs, and knowing when to use each one can significantly improve your frontend development and user experience.</p><h4>Understanding the Basics: URL Paths, Slugs, and Query Parameters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/0*_tf7XWh8szVRABtd" /><figcaption>URL path vs query parameter</figcaption></figure><p>To understand the value of these URL components, let’s first revisit how they’ve been used for decades to create well-structured REST API endpoints. Once the fundamentals are clear, it will become evident when and where to apply them in your web applications.</p><p>When building API endpoints, the <strong>URL path</strong> (or slug) is often used to define access to a specific resource. This path needs a URL-friendly identifier for the data you want to access, and it should be readable by both machines and humans. On the other hand, <strong>query parameters</strong> are ideal for actions like searching, sorting, filtering, and paginating results.</p><p>During my time at Zalando, I was part of the API chapter, where we had great guidelines for best practices in structuring these endpoints. These guidelines — still widely used in the industry — offer practical advice that can be applied to any web application, ensuring clarity and ease of use. They can be found <a href="https://opensource.zalando.com/restful-api-guidelines/#urls">here</a>.</p><h4>Why This Matters for Web Applications</h4><p>Though much of this applies to APIs, the same principles are relevant for frontend development. <strong>A well-structured URL path is more than just a technical necessity </strong>— Google’s SEO algorithms use these paths to index and rank website content. <strong>If done right, URLs can even give users a preview of the content before they click the link</strong>. This is why search engines reward clean, well-organised URL structures.</p><p>But what about internal or credential-protected applications where SEO isn’t a concern? In these cases, maintaining a clear, intuitive URL structure reduces cognitive load for your users. <strong>Users are accustomed to specific navigation patterns, and deviating from those can be frustrating</strong> — especially for those relying on accessibility tools to navigate your site.</p><p>Moreover, adhering to standard URL practices makes life easier for your development team. If your APIs and frontend follow consistent URL patterns, <strong>your team won’t need to switch mental gears when moving between projects</strong>. This consistency reduces confusion and helps avoid unnecessary complexity.</p><h4>Best Practices for URL Parameters</h4><p>Adopting industry-standard practices is a smart move when building web applications, whether internal or external. Here are a few key takeaways:</p><ol><li><strong>Use URL paths or slugs for resources</strong>: If you’re accessing a specific entity (like a product or user), include that entity in the URL path. Make the path short, readable, and descriptive.</li><li><strong>Reserve query parameters for actions</strong>: Use query parameters for actions like searching, filtering, or sorting — actions that modify or refine the content being requested.</li><li><strong>Keep it simple</strong>: Avoid overcomplicating your URL structures. Overly complex or custom URL formats can confuse users and developers alike, increasing both the cognitive load and the maintenance burden.</li><li><strong>SEO considerations</strong>: While I won’t go into SEO specifics here, it’s worth noting that a well-structured URL can improve your site’s visibility in search engines. For a more in-depth comparison of URL parameters and slugs, I recommend reading articles like “<a href="https://angulardive.com/blog/url-parameters-vs-url-slugs-what-s-the-difference/">URL Parameters vs. URL Slugs: What’s the Difference?</a>” by Jose Matos.</li></ol><h4>Final Thoughts</h4><p>In conclusion, when building any web application—whether public-facing or internal—stick to standardised industry practices for structuring your URLs. Doing so reduces the cognitive load for both your users and your team and simplifies the adoption of third-party tools that assume standard patterns.</p><p>While these practices aren’t a one-size-fits-all solution, they provide a solid foundation for making informed decisions. <strong>Use your experience and judgment, and engage with the community to ensure your approach fits your project’s specific needs</strong>. Following these principles will minimise development overhead, streamline user experience, and make your web applications more maintainable.</p><p>By focusing on clean, intuitive URL structures, you’ll improve your project’s usability and create a codebase that’s easier to navigate and maintain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36362cd619c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Form fields the never-ending debate inner vs outer spacing]]></title>
            <link>https://medium.com/@byeduardoac/form-fields-the-never-ending-debate-inner-vs-outer-spacing-b0102003e3d1?source=rss-321e9c45ae3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0102003e3d1</guid>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[web-design]]></category>
            <dc:creator><![CDATA[eduardo aparicio cardenes]]></dc:creator>
            <pubDate>Sat, 24 Aug 2024 15:14:42 GMT</pubDate>
            <atom:updated>2024-08-24T15:14:42.341Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>When discussing creating a great user experience, we must address forms — the standard method for collecting user information in our applications.</p><p>For many years, the ongoing debate about the best way to design form fields and create reusable components has been a cornerstone of our field. Forms can have fields arranged vertically, horizontally, or in combination. In this article, we will delve into the two most common approaches to creating effective form layouts and discuss the trade-offs associated with each. By the end, you will have a deep understanding of form field spacing and layout, which you can immediately apply to your projects.</p><p>Let’s begin by defining a form text field as a component comprising a label, an input, and a crucial element- the state/subtext. This element plays a pivotal role in providing feedback to the user based on their input, thereby enhancing their interaction with the form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-wmtIS6NW9ggVDw1" /><figcaption>Form field component alternatives, inner or outer spacing</figcaption></figure><p>The image doesn’t adhere to exact pixel measurements, but let’s clarify the key dimensions. Assume the label uses a 16px font size with a total height of 32px, including 8px spacing above and below. The subtext/feedback below the input has a 12px font size with 10px spacing on both the top and bottom. The input itself uses a 16px font size with a line height of 24px, along with 16px of vertical padding and a 1px solid border, resulting in a total height of 58px as displayed on the screen.</p><h3>Spacing is not just an attribute but a component.</h3><p>Now that we have the overall context of how the component was initially composed let’s take a step back and think about what defines this component. We can consider the label, input, and subtext/feedback as three separate elements that conform to the text field experience, and no one will argue against this mindset. But what about spacing? Will you consider it part of the component or the form layout?</p><p>Depending on your choice, this will have implications for how you build your experience; applying some analytical thinking, we can see the ramifications of this choice. Let’s consider the following contact form as an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SuGUjE8DB8r5xTLl" /><figcaption>Outer spacing contact form example for different devices</figcaption></figure><p>In the examples above, both the image and the <a href="https://demo.mobiscroll.com/forms/responsive">form</a> from Mobiscroll.com treat spacing as external to the Text Field. This approach offers the advantage of separating concerns between the component and the layout, which results in a cleaner design. However, it comes with a trade-off. Subtext and feedback elements, such as error messages, can disrupt the visual spacing within the form. These changes in height can be more expensive for the browser to render and visually jarring for the user. Since the component itself does not directly manage the layout, the parent form component must handle these scenarios, adding complexity and requiring additional consideration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhpovbapsAB_XHaYCXhxwg.jpeg" /></figure><p>Alternatively, consider incorporating the spacing directly within the component itself using inner spacing. This approach allows the component to manage the spacing internally, freeing the layout from handling this responsibility. It also enables the component to seamlessly transition between different subtext/feedback states, such as error and success. The benefit here is that the component maintains control over the additional real estate it occupies, ensuring smooth adjustments in various scenarios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OTSIHEQBhbtokRXB" /><figcaption>Inner spacing contact form example for different devices</figcaption></figure><p>However, this approach introduces new considerations. For instance, what happens when no text is displayed or when an error message requires two lines instead of one? These situations may still impact the overall layout. If the error text expands, will the component push other content down, reintroducing layout shifts that we aimed to avoid?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*18Mi_cw8ZDg2DgME" /></figure><h3>Inner vs. Outer Spacing Trade-offs</h3><p>We have explored the differences between inner and outer spacing and how they impact content. By now, you should have a clear understanding of what each approach entails: inner spacing, also known as padding, and outer spacing, also known as margin.</p><p>Let’s dive deeper into the benefits and drawbacks of each approach.</p><h4>Outer Spacing</h4><p><strong>Pros:</strong></p><ul><li>Keeps components simple, with minimal logic and a clear purpose.</li><li>Positions are dictated by outer containers, making it easier to manage layout consistency.</li></ul><p><strong>Cons:</strong></p><ul><li>Additional feedback, such as error messages, can disrupt the experience by causing unexpected changes in width if not appropriately handled.</li><li>Forces the outer container to make decisions based on the component’s nature rather than focusing on organising content.</li><li>Requires the outer container to consider each field’s nature and data to make layout decisions, adding complexity to the design.</li></ul><h4>Inner Spacing</h4><p><strong>Pros:</strong></p><ul><li>Maintains a consistent user experience within the same context, which is especially important as the form evolves. For example, labels may appear above, to the left, or even inside the input at different stages.</li><li>Allows layout decisions to be made within the context of the data, including feedback such as error, success, or warning states.</li></ul><p><strong>Cons:</strong></p><ul><li>Requires more granular control of the layout flow and stricter criteria on what can be allowed within the component.</li><li>Offers less flexibility in complex forms that require heterogeneous spacing for the same field type.</li></ul><h3>Conclusion</h3><p>Designing forms and fields within a design system requires careful consideration of spacing, layout, and feedback to create a seamless user experience. Throughout this article, we’ve explored the trade-offs between inner and outer spacing strategies, the importance of maintaining consistency, and the challenges of managing component behaviour in various states.</p><p>Inner spacing, or padding, offers the advantage of maintaining a consistent experience within the component’s context, especially as forms evolve over time. On the other hand, outer spacing, or margin, simplifies component logic but places greater responsibility on the layout to manage potential disruptions caused by feedback elements like error messages. Each approach has its own merits and drawbacks, and the choice between them should be guided by the specific needs of your design system and the complexity of your forms.</p><p>Ultimately, a well-crafted design system balances these considerations, providing reusable, adaptable components that ensure both visual consistency and functional flexibility. By standardising how spacing and feedback are handled, you empower developers and designers to build forms that are not only aesthetically pleasing but also highly user-friendly. As you continue to refine your design system, remember that the goal is to create a unified experience across all touchpoints, enhancing usability while maintaining a clear, cohesive design language.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0102003e3d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>