<?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 Adnan Arif Sait on Medium]]></title>
        <description><![CDATA[Stories by Adnan Arif Sait on Medium]]></description>
        <link>https://medium.com/@adnansait74?source=rss-bc4d29631d3b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yk-Vv3_ZnYtcSig-.jpg</url>
            <title>Stories by Adnan Arif Sait on Medium</title>
            <link>https://medium.com/@adnansait74?source=rss-bc4d29631d3b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:33:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adnansait74/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[How Cursor Orchestrates MCP Servers (And What It’s Costing You)]]></title>
            <link>https://medium.com/@adnansait74/how-cursor-orchestrates-mcp-servers-and-what-its-costing-you-703d28745fe2?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/703d28745fe2</guid>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[cursor]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 12:49:28 GMT</pubDate>
            <atom:updated>2026-03-22T12:49:28.679Z</atom:updated>
            <content:encoded><![CDATA[<h4>What your IDE isn’t telling you</h4><h4><em>A UI developer’s guide to understanding what’s really happening under the hood when Cursor calls your tools</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mrNENqVsdOGvP4G_M22RFw.jpeg" /><figcaption>Cursor leveraging MCP servers to perform actions</figcaption></figure><p>You type one sentence into Cursor: <em>“Validate the completion of ticket ABC-123.”</em></p><p>Over the next minutes, Cursor fetches the Jira ticket, reads the acceptance criteria, finds the associated branch on GitHub, checks it out, pulls the design link from the ticket and retrieves the Figma specs, then opens a live browser session to screenshot the UI and compare it against the design.</p><p>You wrote one sentence. Five systems were touched. You never left your editor.</p><p>It feels like magic; spoiler — it isn’t.</p><p>What’s happening is a tightly choreographed orchestration loop — one where the <strong>LLM is the brain</strong>, Cursor is the nervous system, and your MCP servers are the hands doing the real work. Understanding this loop changes how you think about Cursor — not as a smart text editor, but as an orchestration engine that happens to live inside one.</p><p>Let’s break it all down.</p><h3>First, What Even Is MCP?</h3><p><strong>Model Context Protocol (MCP)</strong> is an open protocol introduced by Anthropic that gives LLMs a standardised way to talk to external tools and data sources. Before MCP, every tool integration was a bespoke, brittle connector. With MCP, any tool that implements the protocol can speak the same language as the model.</p><p>MCP is built on <strong>JSON-RPC 2.0</strong>, a lightweight remote procedure call protocol. When Cursor connects to an MCP server, two things happen:</p><ul><li><strong>tools/list</strong> — A handshake call. Cursor asks the server: <em>&quot;What can you do?&quot;</em> The server responds with a list of callable functions — each describing a name, what it does, and the shape of its inputs. Cursor then injects these definitions into the model&#39;s context window so the model knows what&#39;s available.</li><li><strong>tools/call</strong> — The execution call. Cursor says: <em>&quot;Run this function with these inputs.&quot;</em> The server executes it and returns a result.</li></ul><h3>The LLM Is the Brain — Not a Chatbot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*amPjl1NXH1QNDxFtFQqdnA.png" /><figcaption>Cursor Model Architecture</figcaption></figure><p>Most developers still think of an LLM as a smart autocomplete — you send it a message, it sends one back. In an agentic context like Cursor, that’s only half the picture. The LLM isn’t just <em>responding</em> — it is <strong>planning, deciding, and directing</strong>.</p><p>It’s worth being precise about what that directing actually looks like. The LLM doesn’t reach out to external systems directly — it can’t. It is, at its core, a text-in/text-out system. What it <em>can</em> do is emit a structured <strong>tool call block</strong> inside its response — a machine-readable instruction that says: <em>“I want to call this function with these inputs.”</em> Cursor reads that output, recognises the instruction, routes it to the right MCP server, runs it, and feeds the result back into the conversation. The LLM is the decision-maker. Cursor is the one that actually picks up the phone.</p><p>Here’s what Cursor injects into every agentic conversation before the model ever sees your prompt:</p><ol><li><strong>System context</strong> — Your project files, rules, active editor state.</li><li><strong>Tool schemas</strong> — The full definitions of every MCP tool you have connected, serialised as structured text.</li><li><strong>Your prompt</strong> — What you actually typed.</li></ol><p>The model reads all of this and, instead of just writing text back, may include a tool call block in its response — structured output that names a function and its inputs. Cursor intercepts this, routes it to the right MCP server, appends the result to the conversation, and sends everything back to the model. The model now has more context and either emits another tool call or generates a final response.</p><p>This loop — <strong>Plan → Instruct → Execute → Observe → Continue</strong> — is the core of how agentic AI works. The model never leaves its context window. Every tool call is a structured message it passes to Cursor, and every result is a message Cursor passes back.</p><h3>The Orchestration Workflow, Step by Step</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*1Y_nQ35GYrNqoiiM5Dk6Dw.png" /><figcaption>Cursor MCP Tools Workflow</figcaption></figure><p>The workflow diagram above maps this loop visually — each column represents a participant: you, the model, Cursor’s orchestration layer, and the MCP servers. Here’s what each step actually involves.</p><p><strong>Session boot</strong><br>Cursor reads your open files, active editor state, and project rules. It then calls tools/list on every connected MCP server to discover available tools. All tool schemas are injected into the model&#39;s context window — this happens before your prompt is even processed.</p><p><strong>Planning</strong><br>The model receives the full context in a single pass: project state, all tool definitions, and your prompt. Rather than responding immediately, it produces a plan — in this case, fetch the Jira ticket first, then use whatever comes back to determine the next steps.</p><p><strong>Tool call #1 → Project management MCP</strong><br>The model emits a tool call block: get_issue({ id: &quot;ABC-123&quot; }). Cursor routes this to the connected Jira server. The result — ticket title, acceptance criteria, assignee, and crucially the embedded Figma design link — is appended to the conversation context.</p><p><strong>Tool calls #2 and #3 → Version control MCP</strong><br>With the ticket in context, the model identifies the associated branch and emits find_branch({ issue: &quot;ABC-123&quot; }). Branch name, PR status, and review approvals come back. The model then emits a second call to check out the branch — Cursor executes this directly in your editor.</p><p><strong>Tool call #4 → Design MCP</strong><br>The model reads the Figma link that was embedded in the Jira result — a piece of data it discovered, not something you provided — and emits get_file({ url: &quot;...&quot; }). Design specs, component layout, and a reference screenshot return and are added to context.</p><p><strong>Tool call #5 → Browser DevTools MCP</strong><br>With the branch checked out and the design in context, the model calls screenshot({ url: &quot;http://localhost:3000/...&quot; }). A live screenshot of the running UI is captured and returned.</p><p><strong>Synthesis</strong><br>The model now holds the acceptance criteria, the Figma reference, and the live UI screenshot — all in the same context window. It reasons across all of them and produces a validation report: what matches the design, what doesn’t, and what warrants a closer look.</p><p>You wrote one sentence. The model made five decisions. Cursor executed five round-trips across four systems. You got back a validation report.</p><h3>Understanding the Cost of Tool-Heavy Workflows</h3><h3>Schema injection: a fixed upfront cost</h3><p>When Cursor boots a session, it calls tools/list on every connected MCP server and injects all the tool definitions — name, description, JSON schema, parameter types — into the context window before you&#39;ve typed a single word. This is how the model knows what tools are available to call.</p><p>The overhead scales quickly with the number of servers connected. Anthropic’s engineering team documented real-world schema sizes across common developer tools:</p><ul><li>GitHub — 35 tools — ~26K tokens</li><li>Slack — 11 tools — ~21K tokens</li><li>Sentry — 5 tools — ~3K tokens</li><li>Grafana — 5 tools — ~3K tokens</li><li>Splunk — 2 tools — ~2K tokens</li></ul><p>That five-server setup consumes roughly <strong>55K tokens before a single message is sent.</strong> Add Jira — which alone accounts for ~17K tokens — and you’re approaching 100K of upfront overhead. At Anthropic’s internal scale, tool definitions were observed consuming <strong>134K tokens</strong> before any optimisation was applied.</p><p>Every connected MCP server loads its full schema regardless of whether a single tool gets called in that session. Open files and codebase context add to this further, and Cursor’s own built-in tools (file read, file write, terminal) contribute their own overhead on top.</p><p><em>PS — Anthropic shipped </em><strong><em>MCP Tool Search</em></strong><em> in January 2026, which loads tool definitions on-demand rather than upfront, cutting overhead from ~77K to ~8.7K tokens in their benchmarks — an 85% reduction. </em><a href="https://www.anthropic.com/engineering/advanced-tool-use#tool-search-tool"><em>Anthropic Engineering</em></a></p><h3>Every conversation turn is billed on the full history</h3><p>The more consequential cost in a tool-heavy workflow isn’t the upfront schema injection — it’s how the bill compounds across turns. LLMs have no built-in memory. They only know what is currently in their context window. To maintain a coherent conversation, Cursor re-sends the entire history on every turn: your messages, the model’s responses, and every tool result that has accumulated so far.</p><p>In the ticket validation workflow, the cost stacks like this:</p><pre>Turn 1 billed:  system + schemas + your prompt<br>Turn 2 billed:  system + schemas + prompt + response 1 + Jira result + next instruction<br>Turn 3 billed:  system + schemas + all prior + GitHub result + next instruction<br>...<br>Turn 7 billed:  system + schemas + all messages + all 5 tool results + final synthesis</pre><p>The total cost of a session is the <strong>sum of every API call made</strong>, not just the last one. By the time the model is writing its final validation report, it is being billed on the full accumulated context — schemas, all intermediate reasoning, and all five tool results combined. This compounding is where the real cost lives in agentic workflows, and it’s worth having a clear mental picture of it.</p><h3>Keeping Costs in Check</h3><ul><li><strong>Disconnect servers you’re not using.</strong> Every connected MCP server loads its full schema at session boot, whether or not a single tool is called. Disabling idle servers is the single most direct way to reduce upfront context overhead.</li><li><strong>Keep sessions focused.</strong> Because the full conversation history is re-sent on every turn, the cost of a session is cumulative. A single focused session for a bounded task is significantly cheaper than an open-ended session that drifts across multiple concerns.</li><li><strong>Be specific about scope in tool-heavy tasks.</strong> The model selects tools and constructs inputs based on what you describe. Vague instructions produce verbose tool results; specific ones produce compact, targeted ones — and a large tool result sits in context for the rest of the session.</li><li><strong>Watch for compaction.</strong> As context fills across a long session, Cursor begins compacting earlier messages. Once this happens, the model loses fidelity on earlier tool results — which can cause it to re-call tools it already invoked, or draw on stale context. Starting a new session at natural task boundaries is often more efficient than running a single session to its limit.</li></ul><h3>The Bigger Picture</h3><p>Cursor feels like a smart IDE. Under the hood, it’s an LLM orchestration engine. The model you’ve selected doesn’t just respond — it reads your entire development context, plans a sequence of tool instructions, and hands each one to Cursor to execute. Cursor routes the call, collects the result, appends it to the conversation, and feeds it all back. The model never leaves its context window. Everything it knows about your ticket, your branch, your design, and your live UI arrives as structured text in that window — and it reasons across all of it to produce a response.</p><p>That synthesis is genuinely powerful. It’s also where errors can slip in. The model is drawing inferences across multiple systems simultaneously — a spacing value of 16 could be 16px or 16rem; a component name in Figma might not map cleanly to a branch name in GitHub. The model will make a call either way. For anything where precision matters, verify the raw tool output alongside the model&#39;s interpretation rather than taking the synthesised response at face value.</p><p>That’s what’s happening every time Cursor quietly does something that feels like it shouldn’t be possible from a text editor. The orchestration isn’t magic — it’s a feedback loop between a model that decides and a runtime that executes, with your MCP servers as the reach that makes the loop useful.</p><p>The more clearly you see that loop, the better you understand what Cursor is actually doing — and where the boundaries of that synthesis are.</p><p>The magic doesn’t disappear when you understand it. You learn to use it with intention.</p><p><em>If you found this useful, follow for more deep dives into AI-assisted UI development — covering MCP patterns, model behavior, and what these tools actually do when you’re not watching.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=703d28745fe2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why We Stopped Trusting navigator.onLine]]></title>
            <link>https://medium.com/@adnansait74/why-we-stopped-trusting-navigator-online-fc77e3bb22e5?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc77e3bb22e5</guid>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Fri, 20 Mar 2026 05:39:07 GMT</pubDate>
            <atom:updated>2026-03-20T05:47:00.661Z</atom:updated>
            <content:encoded><![CDATA[<h4>Browser/Navigator</h4><h3>Why we stopped trusting navigator.online</h3><h4><em>How a single Chrome bug locked a user out of our app</em></h4><figure><img alt="A split screen view with a user on a video chat on the left and on the right a “You are offline” screen. The left is labeled as Reality and the right as “navigator.online”" src="https://cdn-images-1.medium.com/max/1024/1*JWQqxkMwP0XX5NPF6civ7Q.png" /><figcaption>A poor check can break your app</figcaption></figure><p>It started with a support ping. One of my colleagues had just logged into our app and was immediately greeted by an error page. The browser console had one message: <strong>“Network is offline.”</strong></p><p>The strange part? He was on a Slack Huddle with us as this was happening. He was very much online!</p><p>The Network tab in DevTools told an even stranger story. The page had loaded fine — HTML, JS, and CSS were all there. But every API call was missing entirely. They weren’t failing. They weren’t pending. They simply weren’t being made.</p><h3>The Investigation</h3><p>Our first instinct was the classic culprit: a rogue browser extension or an adblocker. We spent a good ten minutes disabling extensions one by one, tried Incognito mode — nothing changed. The error persisted.</p><p>Then someone suggested trying Safari. It worked immediately.</p><p>Back to Chrome. Since we don’t have source maps in Prod or Dev, debugging the minified bundle was an adventure. We set a breakpoint directly in the minified code, stepped through it, and finally saw the smoking gun:</p><pre>navigator.onLine // false</pre><p>Chrome was convinced the tab was offline. Every API call in our app was being silently dropped. The user couldn’t do a single thing.</p><h3>The Root Cause</h3><p>We had an Axios interceptor that checked navigator.onLine before allowing any request through. The intention was good: if the user is offline, don&#39;t even bother making the call — it&#39;ll fail, generate noise in our Observability logs, and then come back as a flood of errors once connectivity is restored.</p><p>The interceptor looked something like this:</p><pre>axios.interceptors.request.use((config) =&gt; {<br>  if (!navigator.onLine) {<br>    return Promise.reject(new Error(&#39;Network is offline&#39;));<br>  }<br>  return config;<br>});</pre><p>Sensible logic. Wrong foundation.</p><p>It turned out my colleague was running <strong>Chrome 144.0.7559.133 on macOS</strong> — a version where navigator.onLine was intermittently returning false despite the network being fully operational. We were never able to reliably replicate it ourselves, and plenty of other users were on the same Chrome version without ever hitting this issue.</p><p>Why it happened for this specific user remains unclear — it&#39;s possible the OS-level network state had gotten into a bad state and a browser restart would have resolved it on its own. In any case, all API requests would have succeeded if they&#39;d been allowed through. But our interceptor never gave them the chance.</p><p>After updating Chrome, the issue went away.</p><h3>Understanding navigator.onLine: What It Actually Checks</h3><p>This is where most developers get tripped up. navigator.onLine sounds like it checks your internet connection. It does not.</p><p>As MDN’s documentation explains:</p><blockquote>“Browsers and operating systems leverage different heuristics to determine whether the device is online. In general, connection to a LAN is considered online, even though the LAN may not have Internet access.<br>…<br>Therefore, this property is inherently unreliable, and you should not disable features based on the online status, only provide hints when the user may seem offline.”</blockquote><p>The property is answering a much simpler question: <strong>does the OS think there’s a network interface active?</strong> It’s not pinging Google. It’s not making a real request. It’s asking the operating system’s network stack whether a connection <em>appears</em> to exist — and on macOS, Chrome delegates this to Apple’s SCNetworkReachability API. If that API returns a stale or incorrect value (as it did in Chrome 144), navigator.onLine faithfully relays the wrong answer.</p><p>This is a property designed to give you a hint, not a verdict.</p><h3>We’re Not the Only One Who Got Burned By This</h3><p>The navigator.onLine-as-gatekeeper pattern is widespread enough that <strong>TanStack Query (React Query)</strong> hit the same wall and made a deliberate architectural decision to move away from it.</p><p>In previous versions, React Query used navigator.onLine to decide whether to pause queries when it thought the browser was offline. This led to real production incidents — users silently stuck in a loading state with no visible error, queries paused indefinitely because Chrome had misreported the network state.</p><p>In their v5 migration, the TanStack team documented the change explicitly:</p><blockquote>“In previous versions, navigator.onLine was used to determine the network status. However, it doesn&#39;t work well in Chromium based browsers. There are a lot of issues around false negatives, which lead to Queries being wrongfully marked as offline. To circumvent this, we now always start with online: true and only listen to online and offline events to update the status.&quot;</blockquote><p>They went from a synchronous property check to an event-driven model — and defaulted to assuming online until told otherwise. That’s a meaningful shift in philosophy: <strong>treat connectivity as optimistic until a real failure proves otherwise.</strong></p><p>The <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=678075">Chromium bug tracker</a> has multiple reported issues around navigator.onLine returning false for connected users — this isn&#39;t an edge case or a theoretical concern.</p><h3>So Why Did We Add the Check in the First Place?</h3><p>Our use case had a legitimate problem worth solving.</p><p>We have a <strong>permissions polling system</strong> — it calls our backend every 5 minutes to keep user permissions fresh. Users would often leave the app open overnight. When their network dropped, the polling requests would immediately fail and get pushed into our Observability buffer. Since the Observability requests were also failing (no network), the buffer was never flushed. When connectivity was restored, the buffer would flush all at once — suddenly our app logs would be flooded with permission failures, making it hard to distinguish real issues from stale noise.</p><p>Suppressing the requests while offline was a reasonable solution. The mistake was using navigator.onLine as an absolute gate rather than a soft hint.</p><h3>The Fix: Activity-Based Smart Polling</h3><p>After the incident, we rethought the system. The real question was never “is the internet connected?” — it was <strong>“is this user actually active right now?”</strong> An overnight idle tab doesn’t need to poll. An active user does.</p><p>We replaced the navigator.onLine gate with an activity-based polling hook that tracks the user&#39;s last interaction — clicks, keydowns, scrolls, and tab visibility changes. The poll only fires if the user has been active within the last polling interval.</p><h3>The Broader Lesson</h3><p>navigator.onLine belongs in your UI layer — it&#39;s useful for showing a soft connectivity warning banner. It was never meant to be a hard gate that suppresses requests.</p><p>Browsers lie. OS APIs return stale state. When you block on navigator.onLine === false, you are one browser bug away from a complete lockout. Let requests reach the network, let them fail naturally, and handle failures at the right layer — not by silently swallowing them before they&#39;re ever sent.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc77e3bb22e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cypress Code Coverage for Ejected CRA Apps]]></title>
            <link>https://blog.stackademic.com/cypress-code-coverage-for-ejected-cra-apps-996a4bd8ff3?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/996a4bd8ff3</guid>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[code-coverage]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Sun, 27 Aug 2023 18:03:39 GMT</pubDate>
            <atom:updated>2023-08-27T20:20:05.493Z</atom:updated>
            <content:encoded><![CDATA[<h4>Cypress/Code Coverage — React</h4><h4>Concise configuration to generate insightful coverage reports for your ejected React App</h4><figure><img alt="Logos of Cypress and React on a blue backrgound" src="https://cdn-images-1.medium.com/max/1024/1*tNBRbhy7fErU8TcpsLR4MQ.jpeg" /><figcaption>Cypress Code Coverage in React</figcaption></figure><p>This article builds upon my previous guide on setting up Code Coverage using Cypress in a Create-React-App (CRA) application. If you’re new to this topic, I recommend reading the initial post before proceeding:</p><p><a href="https://blog.stackademic.com/code-coverage-with-cypress-cra-2c7946d5f6b9">Code Coverage with Cypress-CRA</a></p><p>In this article, we’ll explore how to configure Code Coverage reports for Cypress end-to-end (E2E) tests in an ejected Create-React-App application. To follow along, you can use the starter code available in the repository’s starter_code branch.</p><p><a href="https://github.com/Adnan-Sait/coverage-ejected-cra/tree/starter_code">GitHub - Adnan-Sait/coverage-ejected-cra at starter_code</a></p><h3>Instrumenting Ejected Create-React-App:</h3><p><a href="https://create-react-app.dev/">Create-React-App</a> is an excellent starting point for projects, as it internally handles and abstracts general configuration and boilerplate code. However, in scenarios where more advanced configurations or tweaks are required, you might choose to eject the app. Ejecting provides access to all configurations while maintaining the application’s functionality. In our case, we needed to create Development Builds for lower environments, which isn’t natively supported by CRA due to security considerations. Hence, we opted to eject our application.</p><p>When we eject a Create-React-App project, we get access to and control over all configurations including Code Coverage setup. Now we are responsible for adding the relevant configuration to Instrument our code when Coverage Reports need to be generated.</p><h3>Configuration Steps:</h3><p>To set up Code Coverage for your ejected Create-React-App, follow these steps:</p><p>1. Install the babel-plugin-istanbul library using this command:</p><pre>npm install -D babel-plugin-istanbul</pre><p>2. In the webpack.config.js file, include the babel-plugin-istanbul plugin to enable instrumentation during transpilation.</p><p>3. For more control, you can conditionally enable the instrumentation process. Add a flag, such as --coverage, to the command line arguments. This avoids unnecessary overhead and potential performance issues.</p><p>We will be adding these 2 lines</p><pre>const isCoverageEnabled = process.argv.includes(&quot;--coverage&quot;);<br><br>isCoverageEnabled &amp;&amp; require.resolve(&quot;babel-plugin-istanbul&quot;)</pre><pre>// Line 99<br>const isCoverageEnabled = process.argv.includes(&quot;--coverage&quot;);<br>...<br>// Line 408<br>{<br>  test: /\.(js|mjs|jsx|ts|tsx)$/,<br>  include: paths.appSrc,<br>  loader: require.resolve(&#39;babel-loader&#39;),<br>  options: {<br>    customize: require.resolve(<br>      &#39;babel-preset-react-app/webpack-overrides&#39;<br>    ),<br>    presets: [<br>      [<br>        require.resolve(&#39;babel-preset-react-app&#39;),<br>        {<br>          runtime: hasJsxRuntime ? &#39;automatic&#39; : &#39;classic&#39;,<br>        },<br>      ],<br>    ],<br>    <br>    plugins: [<br>      isEnvDevelopment &amp;&amp;<br>        shouldUseReactRefresh &amp;&amp;<br>        require.resolve(&#39;react-refresh/babel&#39;),<br>        isCoverageEnabled &amp;&amp; require.resolve(&quot;babel-plugin-istanbul&quot;),<br>    ].filter(Boolean),<br>    // This is a feature of `babel-loader` for webpack (not Babel itself).<br>    // It enables caching results in ./node_modules/.cache/babel-loader/<br>    // directory for faster rebuilds.<br>    cacheDirectory: true,<br>    // See #6846 for context on why cacheCompression is disabled<br>    cacheCompression: false,<br>    compact: isEnvProduction,<br>  },<br>},<br>...</pre><p>The required code changes in the `webpack.config.js` file can be found in this <a href="https://gist.github.com/Adnan-Sait/025f303c9aaec7eb3ce9c838d60ff439#file-webpack-config-js">Gist</a>.</p><p>4. Update your `package.json` start script to include the coverage flag:</p><pre>&quot;start&quot;: node scripts/start.js --coverage</pre><p>With these steps completed, your React application will be instrumented whenever the --coverage flag is passed. This instrumented code can be used in testing to generated Code Coverage reports.</p><figure><img alt="Screenshot of the web application running on a browser, with instrumented object shown in the console" src="https://cdn-images-1.medium.com/max/975/1*ZGz23Y4h7vKtl9Gc-7k4fQ.png" /><figcaption>Instrumented code running on local</figcaption></figure><p>You can access the latest code in the repository’s master branch:</p><p><a href="https://github.com/Adnan-Sait/coverage-ejected-cra">GitHub - Adnan-Sait/coverage-ejected-cra</a></p><p>Thank you for reading this article on extending Code Coverage to ejected Create-React-App applications. If you have any questions or comments, please feel free to leave them below.</p><p><em>Thank you for reading until the end. Please consider following the writer and this publication. Visit </em><a href="https://stackademic.com/"><em>Stackademic</em></a><em> to find out more about how we are democratizing free programming education around the world.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=996a4bd8ff3" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/cypress-code-coverage-for-ejected-cra-apps-996a4bd8ff3">Cypress Code Coverage for Ejected CRA Apps</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Coverage with Cypress-CRA]]></title>
            <link>https://blog.stackademic.com/code-coverage-with-cypress-cra-2c7946d5f6b9?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c7946d5f6b9</guid>
            <category><![CDATA[ui-testing]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[code-coverage]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Wed, 16 Aug 2023 16:33:55 GMT</pubDate>
            <atom:updated>2023-09-27T16:30:18.499Z</atom:updated>
            <content:encoded><![CDATA[<h4>Cypress/Code Coverage — React</h4><h4>Generate insightful coverage reports for your CRA React App</h4><figure><img alt="Graphic with Cypress and React Logo" src="https://cdn-images-1.medium.com/max/1024/1*x-UP-4S8KlqK5M_on9OuwQ.jpeg" /><figcaption>Cypress Code Coverage in React</figcaption></figure><p><a href="https://www.cypress.io/">Cypress</a> is a next-generation UI testing framework that internalizes common testing pain points and allows you to focus on testing your core functionality. From test creation to debugging, Cypress offers a streamlined journey that promises faster, more reliable tests.</p><p>One of the best features of Cypress is its wide and robust ecosystem. Cypress is rich with plugins and supporting libraries that enrich your tests. One such feature is the <strong>Code Coverage reports</strong>. Code Coverage is an important part of testing. It allows us to gauge how well-tested our application is. It’s akin to a spotlight that exposes untested code areas, uncharted logic branches, and hidden corners of application logic. This is the magic of Code Coverage.</p><p>In this post, we will explore the process of configuring Code Coverage reports for our Cypress E2E tests. We will be covering the configuration for an unejected <a href="https://create-react-app.dev/">Create-React-App</a> application. The Code Coverage Configuration involves 2 parts — <strong>Code Instrumentation</strong>, and <strong>Code Coverage Data Collection and Report Generation</strong>. We will be covering this in the following sections.</p><p>If you are looking for the configuration for an ejected CRA application, refer to this guide,</p><p><a href="https://blog.stackademic.com/cypress-code-coverage-for-ejected-cra-apps-996a4bd8ff3">Cypress Code Coverage for Ejected CRA Apps</a></p><h3>Project</h3><p>We will set up Code Coverage on a simple counter application built using Create-React-App — <a href="https://arnab-datta.github.io/counter-app/"><em>https://arnab-datta.github.io/counter-app/</em></a></p><p>If you want to follow along, you can use the starter code present from this repository. The starter code is present in the `<em>starter_code</em>` branch. To set up the project follow the instructions in the README.md file.</p><p><a href="https://github.com/Adnan-Sait/counter-app-cypress-cra/tree/starter_code">GitHub - Adnan-Sait/counter-app-cypress-cra at starter_code</a></p><h3>Setting up Code Coverage</h3><p>For setting up code coverage, we will be using the “<em>@cypress/code-coverage”</em> plugin. This plugin allows us to easily save coverage information and generate reports.</p><p>Install the plugin using npm.</p><pre>npm install -D @cypress/code-coverage</pre><p>Now we will configure this plugin to be used in E2E tests.</p><p>Import the plugin into the “<em>cypress/support/e2e.js”</em> file,</p><pre>import &quot;@cypress/code-coverage/support&quot;;</pre><p>Next, we need to add the plugin into the “<em>cypress.config.js”</em> file. We will be adding this plugin to the e2e configuration under setupNodeEvents function,</p><pre>setupNodeEvents(on, config) {<br>  // implement node event listeners here<br>  require(&quot;@cypress/code-coverage/task&quot;)(on, config);<br><br>  return config;<br>}</pre><p>With this, the Code Coverage plugin is configured.</p><p>Let us run a test and see if the coverage information is being recorded.</p><p>Start the application</p><pre>npm start</pre><p>In another terminal window, open the Cypress Test Runner</p><pre>npm run cypress:open</pre><p>Select <em>E2E Testing</em> in the Cypress Window,</p><figure><img alt="Cypress Main window" src="https://cdn-images-1.medium.com/max/598/1*JeDZWIw4cQJM5dqLp3hjjg.png" /><figcaption>Cypress Window</figcaption></figure><p>Select your preferred browser in the next window. I will use Chrome,</p><figure><img alt="Cypress — Select Browser Window" src="https://cdn-images-1.medium.com/max/659/1*THzuEGE7Pj9xpsrSiISmvQ.png" /><figcaption>Browser Selection</figcaption></figure><p>Let us run the cartOperations spec file.</p><figure><img alt="Cypress — Choose Spec file screen" src="https://cdn-images-1.medium.com/max/975/1*PNWUgqn1qXT2hEdS1FVMfg.png" /><figcaption>Spec File Selection</figcaption></figure><p>Once the tests run, you can expand one of the tests to check if the coverage information is saved. But as you can see here, we get a warning that coverage information was not present.</p><figure><img alt="Cypress — Test Runner screen with error message" src="https://cdn-images-1.medium.com/max/458/1*PXcq54Yy6hq3O07JbzrtNA.png" /><figcaption>Cypress Test Runner Screenshot</figcaption></figure><p>Cypress also gives us a clue that we may have missed the instrumentation configuration. And that is exactly what happened. As mentioned, we must instrument our code before we can collect the coverage information.</p><h3>Instrumentation</h3><p>Coverage Information can be collected only from instrumented source code. The instrumented source code will have counters to track how many times each line of code was run. This step of adding counters to the source code is called <strong>Instrumentation</strong>.</p><p>We will have to ensure that our source code is instrumented, and the instrumented code is run. This generally requires a change to the build configuration. Fortunately for us, the Cypress team has created a module that can be readily used to instrument Create-React-App applications — <a href="https://github.com/cypress-io/instrument-cra">@cypress/instrument-cra</a>.</p><p>Install the module,</p><pre>npm i @cypress/instrument-cra</pre><p>Modify the start script to use this module before starting the dev server. Make this change in the “<em>package.json”</em> file,</p><pre>&quot;start&quot;: &quot;react-scripts -r @cypress/instrument-cra start&quot;</pre><p>Restart the dev server (<em>npm start</em>).</p><p>Let’s run the test again and see if the coverage report is generated. This time the coverage report has been generated.</p><figure><img alt="Cypress — Test Runner showing that coverage report has been generated" src="https://cdn-images-1.medium.com/max/569/1*2COA8eJaM4ZCHUWbWeezHw.png" /><figcaption>Cypress Test Runner Screenshot</figcaption></figure><h3>Coverage Report</h3><p>he coverage report is created in a new folder <em>“coverage”.</em> Let us open the <em>“coverage/lcov-report/index.html”</em> to see the coverage report. Here we get the coverage details of our tests.</p><p>We can also navigate through the report and see the coverage of individual files/components.</p><figure><img alt="Cypress Coverage Report Overview" src="https://cdn-images-1.medium.com/max/555/1*M_mscaDGl2FDEYOVFR3XQQ.png" /><figcaption>Coverage Report Overview</figcaption></figure><figure><img alt="Cypress Coverage Report for Counter component" src="https://cdn-images-1.medium.com/max/511/1*d21etFilpRuoXLGlf1Ybvg.png" /><figcaption>Coverage Report — Counter component</figcaption></figure><p>The coverage report gives us an overview of the comprehensiveness of our tests. It allows us to quickly determine which logic/branches need to be tested.</p><h3>Additional Configuration</h3><p>From the coverage report, we see that this one spec file has covered 86% of statements in our application. But on a closer look, we realize that this number is not true. Our coverage is in fact a lot less. Additionally, this coverage report is missing a few files. In this coverage report, we only see the files that were loaded by our spec file, and no other components. We do not see the <strong>order.jsx</strong> file under the components folder.</p><p>By default, the Instrumentation is only done for the files loaded by the test suite. But we want all files in the application to be listed in the coverage report.</p><p>For this, we will add an Instrumentation configuration file.</p><p>The instrumentation library (IstanbulJS) loads its configuration from the “<em>.nycrc”</em> file.</p><p>Create a <strong><em>“.nycrc”</em></strong> file in the project root. Add this configuration to the file.</p><pre>{<br>  &quot;all&quot;: true,<br>  &quot;excludeAfterRemap&quot;: true,<br>  &quot;include&quot;: [&quot;src/**/*.js&quot;, &quot;src/**/*.jsx&quot;],<br>  &quot;exclude&quot;: [<br>    &quot;cypress/**/*.js&quot;,<br>    &quot;src/**/*.cy.js&quot;,<br>    &quot;src/**/*.cy.jsx&quot;,<br>    &quot;src/**/*.test.js&quot;,<br>    &quot;src/**/*.test.jsx&quot;<br>  ]<br>}</pre><p>In this file, we are configuring all files to be instrumented, and also explicitly defining the files to be instrumented and files to be excluded.</p><p>With this change when we run the test again, we can see all files listed in the report, even the ones not loaded by the spec file.</p><figure><img alt="Cypress Coverage Report Overview" src="https://cdn-images-1.medium.com/max/738/1*Kc-gBYhe82xR1TufYwFjkg.png" /><figcaption>Coverage Report — Components folder</figcaption></figure><p>Finally, let’s run all the E2E spec files and see the coverage report.</p><p>Ensure that your dev server is running (npm start), now run this command,</p><pre>npm run cypress-e2e</pre><figure><img alt="Cypress Coverage Overview" src="https://cdn-images-1.medium.com/max/729/1*LooddPG56ZhPiMLBji7nVA.png" /><figcaption>Coverage Overview</figcaption></figure><p>Here we get the comprehensive coverage report for all the E2E tests in the application. As shown in the report our test cases have achieved 100% coverage in the application.</p><p>With this, our exploration of Cypress and Code Coverage comes to a close, you are now armed with the tools to set up comprehensive coverage reports for your E2E tests. These reports serve as an invaluable asset, swiftly validating the extent of your tests and establishing foundational confidence in their quality. They allow you to establish standards and thresholds that enhance the quality and reliability of your application.</p><p>This post is meant to be an introduction to Code Coverage in Cypress and barely scratches the surface of the usage and benefits of Code Coverage. But let’s take it further and enrich it. Your experiences with Code Coverage hold immense value — do you have standout use cases or best practices to share? I invite you to join the conversation in the comments below, as we embark on an exploration of this world together.</p><p>The latest code is available in this repo on the “<em>master</em>” branch.</p><p><em>Thank you for reading until the end. Please consider following the writer and this publication. Visit </em><a href="https://stackademic.com/"><em>Stackademic</em></a><em> to find out more about how we are democratizing free programming education around the world.</em></p><p><a href="https://github.com/Adnan-Sait/counter-app-cypress-cra">GitHub - Adnan-Sait/counter-app-cypress-cra: This tiny application is like adding,removing,deleting, resetting products which reflects in the total number of products into our shopping cart.</a></p><h3>References</h3><ol><li>Cypress Documentation: <a href="https://docs.cypress.io/guides/tooling/code-coverage">https://docs.cypress.io/guides/tooling/code-coverage</a></li><li>Blog: <a href="https://www.cypress.io/blog/2019/09/05/cypress-code-coverage-for-create-react-app-v3/">https://www.cypress.io/blog/2019/09/05/cypress-code-coverage-for-create-react-app-v3/</a></li></ol><h3>Further Reading</h3><p><a href="https://blog.stackademic.com/cypress-code-coverage-for-ejected-cra-apps-996a4bd8ff3">Cypress Code Coverage for Ejected CRA Apps</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c7946d5f6b9" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/code-coverage-with-cypress-cra-2c7946d5f6b9">Code Coverage with Cypress-CRA</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Backend to Frontend: My Transition and its Far-Reaching Influence]]></title>
            <link>https://medium.com/@adnansait74/from-backend-to-frontend-my-transition-and-its-far-reaching-influence-7f186ba019fc?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f186ba019fc</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ui-development]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Sat, 08 Jul 2023 08:58:49 GMT</pubDate>
            <atom:updated>2023-07-08T08:58:49.592Z</atom:updated>
            <content:encoded><![CDATA[<h4>Reflection</h4><h4>My Reflection on the Transition, Discovering its Impact, and Charting the Future</h4><figure><img alt="A backend graphic on the left with representation of a server, along with an arrow pointing to a UI graphic on the right" src="https://cdn-images-1.medium.com/max/1024/1*scNf2mgTrejZ4Sfv5BRxnA.png" /><figcaption>Transition from Backend to Frontend Web Development (Source: <a href="https://undraw.co/">unDraw</a>)</figcaption></figure><p>In 2021, I switched to UI Development after working as a Backend Developer for 3.5 years. It’s been 1.5 years since and, in this article, I would like to share my experience and learnings from this transition. I will delve into the challenges I faced early in the role, the significant changes, and the overall impact on my career.</p><p>I wasn’t really looking for a UI role at that point, but an enticing offer came my way, and I decided to take it up. I saw it as an opportunity to broaden my skill set and strive towards becoming a full-stack developer. The plan was to develop my UI skills while maintaining my backend knowledge and expertise.</p><h3>Early Challenges in the Role</h3><p>I stepped into the role of an experienced UI developer, so I had to quickly develop the necessary skills and align myself with the rest of the team. The project primarily revolved around HTML, CSS, and JavaScript with basic features of VueJS framework. I had a little bit of UI experience in the past and had worked with JavaScript, so I was able to learn the necessary skills quickly. However, it took some time to familiarize myself with the overall application, and the development workflow, and establish effective collaboration with the team.</p><p>One of the significant challenges I encountered in the early days was the noticeable skill gap between myself and the rest of the team. While I could build UI components and recreate designs, there were other areas where my contribution was limited. Creating designs, reviewing, and enhancing them were part of our core operations, but it was one area where I struggled. In the initial days, I was a silent listener in our collaboration sessions, trying to absorb the knowledge being shared. Even today designing remains an area of work that I dread.</p><h3>Becoming a UI Developer</h3><p>In this role, I have learned a lot more about the various aspects of Web Applications, including core elements of user experience, accessible designs, web browsers, and security. Frontend development significantly differs from backend development, particularly in terms of focus areas, approach, architecture, and data flow.</p><p>Here are a few aspects of Frontend Development that I particularly enjoy,</p><ol><li><strong>Core Focus:</strong> The focused nature of front-end development is a breath of fresh air. With a single environment (the browser) and the primary goal of delivering an exceptional user experience — the simplicity and core focus allowed us to deliver more value with fewer maintenance/housekeeping tasks.</li><li><strong>Tools:</strong> Frontend development is supported by a wide variety of tools that greatly facilitate designing, building, testing, and debugging UI components. These tools, along with the browser devtools empowered me to analyze and test scenarios even on the production site. Some of my favorite browser extensions are <a href="https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en">React Developer Tools</a>, <a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en">Redux DevTools</a>, and <a href="https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf?hl=en">Allow CORS</a>.</li><li><strong>JavaScript:</strong> JavaScript is the key to front-end development. Its wide usage makes it the one scripting language you need to know to master the Web.</li></ol><p>While I thoroughly enjoy frontend development, there are certain aspects of backend development that I do miss — working with external systems, databases, and cloud environments. Furthermore, I miss the emphasis on system design and effective coding practices that are more prevalent in the backend realm.</p><p>Initially, I had intended to keep working on my backend development skills to maintain a balance between both domains. However, any time I had was better spent developing my UI skills and keeping up with the project requirements. As a result, my involvement with backend development has been limited since the transition.</p><h3>Impact of the Transition</h3><p>This transition has been the most pivotal moment of my career. While I anticipated that this decision would have a significant impact, I couldn’t have foreseen just how transformative it would be. It has opened new opportunities in my career in the areas of Full-Stack Development, UI Development, Web Analytics, and to some extent, Web Designing.</p><p>However, there have also been some <strong>negative impacts</strong> to consider.</p><p>Taking up this role has <strong>split my experience</strong>. I have 5 years of experience in Web Application Development, with 3.5 years in backend and 1.5 years in frontend. This split experience has undoubtedly broadened my overall understanding and knowledge of Web Development. However, I haven’t yet become a specialist in any particular domain. This generalization of my skills has posed challenges for my immediate career opportunities since most job openings tend to focus on candidates with specific areas of specialization. Many positions require a minimum years of experience in specific languages or frameworks, such as Java (3 years) or React (3 years). Unfortunately, due to the split experience, I often do not meet these specific criteria.</p><p>Overall, embarking on this transition has proven to be an incredibly valuable decision. It not only allowed me to immerse myself in the exciting world of UI development but also brought about significant personal growth. I have tackled challenges head-on, acquiring new skills and expanding my understanding of Web Development as a whole. The negative impacts of the transition do exist, but I’m confident that with upskilling and a little more time, they will fade away.</p><p>As I look to the future, I am committed to further honing my expertise in UI development and embracing new opportunities within this domain. I am eager to take on exciting projects, delve into cutting-edge technologies, and continue delivering exceptional value as a UI developer.</p><p>This has been an experience that I treasure. I hope my experience helps other developers in a similar boat who are pondering the same decision.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f186ba019fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guide to your first Open-Source Contribution]]></title>
            <link>https://medium.com/@adnansait74/guide-to-your-first-open-source-contribution-b87894aee63a?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b87894aee63a</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[hacktoberfest]]></category>
            <category><![CDATA[open-source-contribution]]></category>
            <category><![CDATA[hacktoberfest2022]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Wed, 12 Oct 2022 19:06:47 GMT</pubDate>
            <atom:updated>2022-10-12T19:06:47.704Z</atom:updated>
            <content:encoded><![CDATA[<h4>Your first step to influencing and shaping your favorite software</h4><figure><img alt="A laptop screen with code seen through eyeglasses" src="https://cdn-images-1.medium.com/max/1024/1*U5AZSs0DjG8aGnHyE5ecqw.jpeg" /><figcaption>Source: <a href="https://www.pexels.com/@kevin-ku-92347/">Kevin Ku</a> from <a href="https://www.pexels.com/">Pexels.com</a></figcaption></figure><p>The Open-Source Community is one of the best things in the Software Engineering world. It is one of the most collaborative and supportive communities united in the goal to provide better tools and services to people across the globe. Any software or tool you use is almost guaranteed to use open-source libraries. It is a brilliant practice that is home to widely used software like React, Tensorflow, Flask, Elasticsearch, etc.</p><p>For the past 3 years, it has been my goal to contribute a small part to the Open-Source community. But I did not know where and how to begin. All online resources directed me to websites like <a href="https://goodfirstissues.com/">Good First Issues</a>, <a href="https://www.codetriage.com/">CodeTriage</a>, and <a href="https://up-for-grabs.net/">Up For Grabs</a>. These sites list active issues that can be worked on, but they do not provide any help when it comes to choosing a project and guiding you through the contribution.</p><p>This year, with a tweak in my approach, my goal was accomplished. Within a week I was able to contribute to 5 projects (albeit simple contributions), and it was rather effortless. In this article, I would like to share the steps that helped me in my first contributions.</p><p>I hope you find this guide useful!</p><h4>Step 0: Familiarize yourself with the contribution workflow</h4><p>There is a standard contribution workflow on GitHub. You can go through the <a href="https://github.com/firstcontributions/first-contributions">First Contributions</a> project — it guides you through every step of the workflow, as you make your first contribution to the same project.</p><h4>Step 1: Choose a Project</h4><p>This is the most important step for your initial contributions. You may be tempted to pick a popular open-source project, but I would advise against it. The challenge with such projects is that the codebase is massive, and contributions are expected to be of the highest quality. For the first few contributions, I would recommend looking out for simple projects that are easy to understand and make changes to.</p><p>Here are a few things you need to keep in mind while selecting a project,</p><ol><li>Pick a language you are comfortable contributing in.</li><li>Ensure the project is actively managed. Check for maintainer activities in recent weeks and ensure Pull Requests (PR) are being merged.</li><li>Read the project documentation, especially the <strong>Contribution Guidelines </strong>and <strong>Local Setup</strong> documents.</li><li>Pick projects with Open Issues.</li><li>Projects with a running environment are preferable. It gives you an environment to explore the project.</li></ol><h4><strong>Step 2: Choose an issue to work on</strong></h4><ol><li>Look into the open issues in the project.</li><li>Filter the issues using labels. Here are a few labels to look out for,<br>– Issues with the label “<em>good first issue</em>” would be simple and easy to resolve.<br>– Issues with the label “<em>help wanted</em>” are likely to be prioritized.<br>– “<em>bugs</em>” are generally easier to contribute to than “<em>enhancements</em>” or “<em>features</em>”.</li><li>Replicate the bug either on the production site or on your local system (look at Step 3).</li><li>Ideate a possible fix for the issue and make a note of the files that need to be changed.</li><li>(<em>If required</em>) Share your planned solution to the issue and get feedback from the maintainers/contributors.</li><li>Request the maintainers to assign the issue to you. <strong>Do not start working on the issue before it is assigned to you</strong>.</li></ol><h4><strong>Step 3: Familiarize yourself with the project practices</strong></h4><p>Before you contribute to a project it is important, and often essential to understand what the project does and how it works. Take some time to explore the project and its functionalities.</p><ol><li>(<em>If possible</em>) Get the project running on your local system. The steps should be available in the README file or the Wiki.</li><li>Run the necessary checks on the project — test cases, linters, formatting, etc. This will familiarize you with the tests that should be run after the changes are made. The checks would be listed in the Contributing Guide, README, or Wiki.</li><li>Read the Contribution Guidelines before you start coding.</li><li>Go through a few closed PRs to get an understanding of what is expected from the PRs. This would help pick up on undocumented practices.</li></ol><h4><strong>Step 4: Make the changes and raise the PR</strong></h4><ol><li>Make the necessary changes and test them.</li><li>Run the required tests on the project — test cases, linters, etc.</li><li>Ensure your changes do not break any other functionality.</li><li>Push the changes to your repository and raise a pull request.</li><li>The pull request should contain all the required details. Use the PR template, if any, and follow the steps in the Contributing Guidelines.</li></ol><p>If you find yourself confused or stuck somewhere, do not hesitate to ask for help. In my experience, contributors and maintainers have been patient and supportive to beginner contributors.</p><p>Congratulations 🥳!!! With this, you are equipped to complete your first Open-Source Contribution. If you are looking to contribute, <a href="https://hacktoberfest.com/">Hacktoberfest</a> is a perfect time to get your initial contributions. At this time a lot of projects are available for contributions and maintainers actively look for fixes and enhancements on their projects. A ton of resources are available, along with lively communities to help you through your contributions.</p><h4><strong>Next Steps:</strong></h4><p>With the initial contributions, you should now shift your focus to more established projects. They provide an opportunity to learn and implement advanced functionalities and best practices. These projects might be used by thousands of developers and the joy of seeing your contributions used by such a broad community would be immeasurable.</p><ol><li>Follow the open-source repository you want to contribute to.</li><li>Read the documentation and learn about the project.</li><li>Go through the created issues and the conversations around them.</li><li>Pick simple issues and shadow resolve them (work on them without getting them assigned to you).</li><li>When you’re ready, volunteer to work on an active issue.</li></ol><p><em>Thanks for reading this article! Leave a comment below if you have any questions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b87894aee63a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I prepared for the AWS Certified Cloud Practitioner exam]]></title>
            <link>https://medium.com/@adnansait74/how-i-prepared-for-the-aws-certified-cloud-practitioner-exam-c2775433b750?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2775433b750</guid>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[aws-ccp]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Tue, 14 Sep 2021 16:09:58 GMT</pubDate>
            <atom:updated>2021-09-14T16:14:51.090Z</atom:updated>
            <content:encoded><![CDATA[<h4>Preparation Guide</h4><h4>The AWS Cloud Practitioner Certification is the Foundational certification of AWS. It is a recommended certification if you are just starting with AWS and would like to get an overall high-level knowledge of the AWS Cloud.</h4><p>After spending 3 years as a web application developer, I finally decided to take the first step into cloud computing. Starting with very little knowledge of AWS, I spent 80 hours preparing for the certification. And I was able to clear the AWS Certified Cloud Practitioner (AWS CCP) Exam, scoring 934 out of 1000. The experience was rewarding, and this being my first certification, I look back on it quite fondly.</p><figure><img alt="AWS Certified Cloud Practitioner" src="https://cdn-images-1.medium.com/max/1024/1*vnyJa7x-geKCmIjxZvfhUA.jpeg" /></figure><p>In this article, I would like to share with you how I prepared for the AWS CCP exam and the resources I used. My goal is to help guide individuals who want to take up the certification but aren’t sure how to get started or aren’t sure if they are ready to take up the certification.</p><p><strong>Target Audience:</strong> Anyone who plans to take up the AWS CCP exam.</p><h3>Preparation</h3><p>I found it best to follow a dedicated course for the certification, as it covers all the required topics in a structured manner. Once I finished the course, I used practice exams to gauge my preparedness.</p><ol><li>I followed <a href="https://www.udemy.com/course/aws-certified-cloud-practitioner-new/">Stephane Maarek’s course on Udemy</a>. I highly recommend it for beginners as well as for anyone who needs a refresher on AWS. The content is simple, with hands-on to get better knowledge, and the pacing keeps the course fresh and engaging.</li><li>I prepared detailed notes as I went through the course. I noted a one-line description of the AWS services and other notable details.</li><li>After completing the course, I revised my notes. To recollect what I had learned and to identify any gaps/missing information in the content.</li></ol><h3>Getting ready for the certification exam</h3><p>This being my first certification, I wanted to be confident that I could clear the exam before I booked the slot. The practice exams were the key for this. I purchased <a href="https://www.udemy.com/course/practice-exams-aws-certified-cloud-practitioner/">Stephane Maarek’s practice tests</a> from Udemy.</p><ol><li>I would do 2 practice tests, and then analyze the questions that I wasn’t sure of. The practice exams provided detailed explanations for the correct, as well as the incorrect options. This helped me become familiar with the exam format and fortify the concepts I learned.</li><li>I particularly struggled with remembering lists and peculiar features of certain services. The savior here was creating and using flashcards. I created flashcards for topics that I wanted to learn and memorize, especially lists, and repeated them daily. I used <a href="https://apps.ankiweb.net/">Anki</a> for this.</li></ol><p>Given my cautious nature, I only booked the exam after I was able to consistently score more than 85% in the practice tests through understanding, and not memorizing the answers.</p><p>Before the exam I reviewed challenging practice tests, they gave a good boost of confidence.</p><p>It took me about 4 months, to prepare and complete the certification. Although relatively longer than most other candidates that attempt the exam, I am happy with my effort. I went ahead at my own pace, with cheat days here and there. This allowed me to enjoy much of the process of preparation, attempting the practice exams, and the final certification.</p><p>I highly recommend that you set your own timelines to complete the certification. A timeline that will allow you to enjoy exploring AWS and allow you to truly appreciate the ocean of services that AWS has to offer.</p><p>I hope my experience helps guide your approach to the AWS CCP exam. If this article has helped you, please applaud, it would feel good to know that I could help. If you have some tips on preparing for the certification or resources, please feel free to share them in the comments.</p><p>If you would like to share your experience or have any suggestions, please drop them in the comments.</p><p>The resources I used in my preparation are listed below.</p><h3>Resources</h3><ul><li>Course: <a href="https://www.udemy.com/course/aws-certified-cloud-practitioner-new/">https://www.udemy.com/course/aws-certified-cloud-practitioner-new/</a></li><li>Practice Tests: <a href="https://www.udemy.com/course/practice-exams-aws-certified-cloud-practitioner/">https://www.udemy.com/course/practice-exams-aws-certified-cloud-practitioner/</a></li><li>Anki Cards: <a href="https://ankiweb.net/shared/info/449552125">https://ankiweb.net/shared/info/449552125</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2775433b750" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic API Test Suite in Postman]]></title>
            <link>https://medium.com/@adnansait74/dynamic-api-test-suite-in-postman-93bf07caf6ff?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/93bf07caf6ff</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[postman-collections]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Wed, 04 Aug 2021 14:54:21 GMT</pubDate>
            <atom:updated>2021-08-04T15:22:02.081Z</atom:updated>
            <content:encoded><![CDATA[<p>More than just a REST client, an extensive API management tool.</p><p>Test Cases and suites are a vital part of software, something that has become essential in any deliverable application. In our case, we realized the importance of test cases when we had a web application in production with no test cases.</p><p>Due to code access constraints, we had to create an external test suite. Having been familiar with Postman as a REST client, we tried leveraging Postman to create the test suite. We were able to quickly create a test suite that could test the APIs with all their flows and responses. Today the test suite has been operating flawlessly for over a year and we haven’t looked back since.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvEQZ_LXRarOtR5IVyBjXQ.jpeg" /><figcaption>Postman Logo</figcaption></figure><p>In this article, we will <strong>create a test suite with dynamic requests</strong> using the features provided by Postman. The goal is to create a reusable test suite that can quickly perform unit tests, end-to-end tests, and regression tests on the APIs.</p><p><strong>Note:</strong> A Postman test suite is not a substitute for having test cases in an application. Test cases built into the code are more flexible and offer more comprehensive coverage. In case test cases are not available in the code, a Postman test suite can provide a quick mechanism to test the APIs.</p><p>We will create a Postman test suite to test the APIs of a User Entity. The User Entity has 5 APIs for CRUD operations,</p><ol><li>Create User</li><li>Get All Users</li><li>Find User by Username</li><li>Update User by User ID</li><li>Delete User by User ID</li></ol><h3>Step 1: Create a Postman Collection</h3><p>A Postman Collection is a group of saved requests. Collections can be created based on projects/features, whichever is more convenient. The requests can be ordered and organized into folders within the collection.</p><p>We will create a Postman collection with the name “Test Suite Demo”.</p><figure><img alt="Postman collection screenshot" src="https://cdn-images-1.medium.com/max/602/1*9Dn775XYO3rlmlCf4cUjDQ.png" /><figcaption>Postman Collection screenshot</figcaption></figure><h3>Step 2: Create Static Requests within the collection</h3><p>We will create Postman requests within this collection for the 5 APIs. We will hardcode the values — URL, data, etc., into the requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*jacttNCfyUDlfC_Lx3tdag.png" /><figcaption>Static Requests screenshot</figcaption></figure><h3>Drawbacks of Static Requests</h3><p>Static requests are easy to create but are difficult to reuse and maintain. The use of hardcoded data in the requests has significant drawbacks when any data needs to be updated.</p><ol><li>Common values like URL will have to be updated in every single request. This becomes extremely tedious if there are many requests.</li><li>The data will have to be changed manually in each request if the application state or behavior changes.</li><li>It is difficult to configure and run the requests as a single unit to test workflows in the applications.</li></ol><p>To counter these drawbacks, we will create dynamic requests. Dynamic requests will use <strong>variables</strong> to store common values, <strong>generate random data</strong> for certain fields, and <strong>work in sync with other requests</strong> in the collection.</p><h3>Step 3: Create variables for common values and values that change often</h3><p>Postman variables allow us to store and reuse values in requests. Postman has 4 <a href="https://learning.postman.com/docs/sending-requests/variables/#variable-scopes">variable scopes</a>. Here are the general recommendations on the use of each variable scope.</p><p>We will make the following changes,</p><ol><li>Create an environment, like “TestSuiteDemo-LocalEnv”.</li><li>Add “url” as an environment variable in this environment.</li><li>Use the Postman Dynamic variables (for random values) to generate a random name in the request body.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*rAqaAevSNfRX2G3qLkZKpA.png" /><figcaption>Variables screenshot</figcaption></figure><h3>Step 4: Setup Pre-request scripts for more elaborate request customizations</h3><p>Pre-request scripts allow greater customization of the request parameters in requests. They are commonly used to modify the request body or headers before the request is sent. It executes JavaScript code.</p><p>We will use the pre-request script to save the name of the user in a variable before the request is sent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*f4JajZzXkStXayxuLuR9Lw.png" /><figcaption>Pre-request Script screenshot</figcaption></figure><h3>Step 5: Add Test Cases to test the response and perform post request operations</h3><p>Test Cases in the requests can be used to validate the response of an API. These tests are highlighted when the collection or requests are run, so they provide a visual representation of the API health on the application.</p><p>The tests run after the response has been received, so they can also be used to perform post-request operations.</p><p>In this example, we will check if the response code of the API is 200 and 1 additional test case per request. And we will also store the user ID in a variable when a user is created.</p><h3>Step 6: Run the Test Suite using the Postman Runner</h3><p>The postman runner can run all the requests in the collection. The Postman Runner provides a quick visual of the test cases run on the API responses.</p><p>A successful response would connote that all APIs are working as required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*FsTvRpDAeeQEraqyAoKObA.png" /><figcaption>Success Run Screenshot</figcaption></figure><p>Any test case failure would point to some issue in the system, prompting further exploration. In this example, we can see that there was a failed test case in the <em>Get user by User Name</em> API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*tVSlsa6DmD369ziByjgT6A.png" /><figcaption>Failed Run Screenshot</figcaption></figure><p>Such a test suite can be leveraged to quickly gauge the health of the APIs. More requests can be added to test suites to validate the failure cases of APIs as well making them more comprehensive.</p><h3>Conclusion</h3><p>We have been using this system to test our APIs for the past year. We have 12 APIs exposed and 54 requests in the collection checking every success and failure response of the APIs. It has become our go-to testing methodology for Regression Testing and has helped us greatly ensuring that new changes do not impact existing functionality.</p><h3>Caution</h3><p>This testing methodology sends random data to APIs which may get persisted in the database. For our use case, it was acceptable to have this fake data in the database. Please take this into consideration and if fake data being inserted is unacceptable, run the test suite on a test or a non-production environment.</p><p>All resources used in this article are available on <a href="https://github.com/Adnan-Sait/postman-dynamic-test-suite">GitHub</a>. The setup steps are present in the README file.</p><p>If you’re looking to delve into Postman the <a href="https://learning.postman.com/docs/getting-started/introduction/">official docs</a> are a good starting point.</p><p>If you have any queries, you can put them in the comments below. If you found this article helpful, please appluad, it would feel good to know that this article has helped someone 😊.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93bf07caf6ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing database schema in different environments using Liquibase]]></title>
            <link>https://medium.com/@adnansait74/managing-database-schema-in-different-environments-using-liquibase-4f16b0d2b2f1?source=rss-bc4d29631d3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f16b0d2b2f1</guid>
            <category><![CDATA[liquibase]]></category>
            <category><![CDATA[dbms]]></category>
            <dc:creator><![CDATA[Adnan Arif Sait]]></dc:creator>
            <pubDate>Sun, 30 Aug 2020 09:49:47 GMT</pubDate>
            <atom:updated>2020-08-30T14:35:55.343Z</atom:updated>
            <content:encoded><![CDATA[<p>Large applications are maintained in different environments — development, production, staging and test. These environments require different application configuration, server configuration and in most cases, also require variations in the database schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*dQzlDjTqujEdyCytfu0eoA.png" /></figure><p>Managing separate scripts for these different environments can be a troubling task. This task can be eased using a database migration tool like <strong>Liquibase</strong>.</p><p>Liquibase is an open-source database-independent library for managing, tracking and applying changes to a database. Liquibase can also be used to automate the database deployment process. With more such functionalities, Liquibase provides a suite of features to manage the database schema.</p><p>In this post we will explore how Liquibase can be used to manage the database schema in different environments.</p><h3>Target Audience</h3><p>This post is targeted at developers who are already familiar with Liquibase and are looking to extend the usage of Liquibase to manage database schema.<br>If you are getting started with Liquibase, the Liquibase <a href="https://www.liquibase.org/get-started/how-liquibase-works">Get Started</a> guide provides a good starting point.</p><p>Liquibase uses 3 elements to control the execution of changes on a database — <strong>preconditions</strong>, <strong>contexts </strong>and <strong>labels</strong>. In this post we will detail where and how these elements can be used.</p><h3>Sample Application</h3><p>We will use the following application to explore the features of Liquibase.</p><figure><img alt="Sample application schema" src="https://cdn-images-1.medium.com/max/403/0*27VkETkm6kUlsEL2" /><figcaption>Sample Database Schema</figcaption></figure><p>The following constraints are enforced on the liquibase scripts,</p><ul><li><em>The scripts will run only on a </em>PostgreSQL <em>database.</em></li><li><em>The test data will not be populated if the tables already have data.</em></li></ul><p>This database schema will be applied to 3 environments with the following configuration,</p><ul><li><strong>Development environment</strong> — has database constraints.</li><li><strong>Test environment</strong> — has database constraints, has fake data.</li><li><strong>Production environment</strong> — does not have database constraints.</li></ul><p>All resources used in this post are available in this git repository.<br><a href="https://github.com/Adnan-Sait/liquibase-preconditions-contexts-labels">https://github.com/Adnan-Sait/liquibase-preconditions-contexts-labels</a></p><h3>Preconditions</h3><p>Preconditions control the execution of an update based on the state of the database. It can — halt the update, skip a changeset, mark a changeset as run or show a warning. If a precondition fails, one of the following actions can be carried out,</p><ul><li>HALT</li><li>SKIP</li><li>MARK_RAN</li><li>WARN</li></ul><p>Preconditions may be used in one of the following conditions,</p><ul><li>To enforce assumptions made by the changelog author while creating the changeset.</li><li>To check the state of the database before performing unrecoverable changes such as “DROP TABLE”.</li><li>Control which changeSets are run and not run based on the state of the database.</li></ul><p>In the case of our sample application, we use preconditions for 2 purposes,</p><ol><li>Enforce the assumptions made by the changelog author, by allowing the changelogs to run only on a PostgreSQL database. This precondition is set in the <em>master.changelog.xml </em>file, hence this precondition applies to all the changelogs used in the sample application.</li></ol><blockquote>&lt;preConditions&gt;<br> &lt;dbms type=”postgresql”/&gt;<br>&lt;/preConditions&gt;</blockquote><p>2. Check the presence of data in tables before inserting fake data for testing.</p><blockquote>&lt;changeSet id=”user_log-fake-data” author=”adnan.sait”&gt;<br>&lt;preConditions onFail=”CONTINUE”&gt;<br> &lt;sqlCheck expectedResult=”0&quot;&gt;Select count(*) from user_log&lt;/sqlCheck&gt;<br>&lt;/preConditions&gt;<br>&lt;loadData<br>…</blockquote><p>Similar precondition is applied in every changeset inserting fake data in a table. In this example, the <em>dbms</em> and <em>sqlCheck</em> preconditions have been used. There are several other preconditions like <em>changeSetExecuted</em>, <em>tableExists</em> and so on. The complete list of preconditions can be found <a href="https://docs.liquibase.com/concepts/advanced/preconditions.html">here</a>.</p><h3>Contexts</h3><p>Contexts can be applied to changeSets to control execution when they are run in different environments.<br>Contexts can be used to establish different behavior in different profiles like development, production and test.</p><p>In our example, we have used contexts to configure the schema to be used in different environments.</p><ol><li>The dummy data has been defined under the “test” context.</li></ol><blockquote>&lt;include file=”/changelogs/dummy_data.changelog.xml” relativeToChangelogFile=”true” context=”test”/&gt;</blockquote><p>2. The relations/foreign key constraints have been defined under “dev” and “test” context.</p><blockquote>&lt;include file=”/changelogs/user_relations.changelog.xml” relativeToChangelogFile=”true” context=”dev,test”/&gt;</blockquote><p>The context can be specified by the user during runtime by supplying a comma separated list of contexts.</p><blockquote>liquibase — contexts=dev,test update</blockquote><p>This command will run the changeSets with context — <em>dev or test</em>, along with the changeSets that do not have a context configured.</p><h3>Labels</h3><p>Labels are similar to contexts in that both allow you to choose a subset of changeSets to execute at runtime.<br>Where they differ is in who has the power to specify complex logic: the changeSet author or the deployment manager.</p><h4>Contexts Vs Labels</h4><figure><img alt="Differences between contexts and labels" src="https://cdn-images-1.medium.com/max/629/1*swWeIE--NJyw_V1Barye-w.png" /><figcaption>Differences between contexts and labels</figcaption></figure><p>Whether contexts or labels should be used comes down to whether the changeSet author or the liquibase executor best understands and/or needs most control over which changeSets to execute.<br>Here are a few guidelines to choosing between contexts and labels,</p><ul><li>If the changeSet author needs to be able to specify the complex logic for selection of changeSets, use <strong>contexts</strong>.</li><li>If the user executing the changeSets needs to specify the complex logic to choose the changeSets, use <strong>labels</strong>.</li><li>If there is no need for complex expression, there is no functional difference between them — either Context or Label can be used.</li></ul><p>When in doubt it is recommended to use Context over Labels, as it gives the option to the changelog author to handle the complex logic if needed.</p><p>Using preconditions, contexts and labels in liquibase allows the changelog author and the user to control the execution of changeSets. This is an effective strategy to enforce assumptions made while creating the changeSets and manage the database schema across different environments.</p><h3>Resources</h3><ol><li><a href="https://www.liquibase.org/get-started/core-usage">https://www.liquibase.org/get-started/core-usage</a></li><li><a href="https://www.liquibase.org/blog/contexts-vs-labels">https://www.liquibase.org/blog/contexts-vs-labels</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f16b0d2b2f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>