<?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 Rahul Kumar on Medium]]></title>
        <description><![CDATA[Stories by Rahul Kumar on Medium]]></description>
        <link>https://medium.com/@rahul.kumar.sdet?source=rss-be413ee260fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mLWiON5_fBE8Pt_PGgEDEg.png</url>
            <title>Stories by Rahul Kumar on Medium</title>
            <link>https://medium.com/@rahul.kumar.sdet?source=rss-be413ee260fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:27:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rahul.kumar.sdet/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[Blindly Using AI in Quality? You’re Building a House of Cards]]></title>
            <link>https://medium.com/@rahul.kumar.sdet/blindly-using-ai-in-quality-youre-building-a-house-of-cards-fd42c0181375?source=rss-be413ee260fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd42c0181375</guid>
            <dc:creator><![CDATA[Rahul Kumar]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 13:31:03 GMT</pubDate>
            <atom:updated>2025-09-02T13:31:03.364Z</atom:updated>
            <content:encoded><![CDATA[<h4>Checks, balances, and the human touch that keeps testing resilient.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MgVhGfoJ-u1gZ1kNy5tjjg.png" /></figure><h3><strong><em>Imagine this:</em></strong></h3><p>A QA team in a futuristic testing team decides to put their new GenAI assistant to the test. They feed it a simple request: <em>“Generate test cases for our login module.”</em></p><p>Within minutes, the AI proudly delivers a staggering <strong>500+ test cases</strong>. It feels almost magical — what normally takes weeks of effort has been compressed into a single night’s output.</p><p>But as the team scrolls through the results, the magic begins to fade:</p><ul><li>Dozens of the cases are <strong>near-identical duplicates</strong>, just worded differently.</li><li>Crucial paths — like <em>multi-factor authentication</em> and <em>account lockouts</em> — are nowhere to be found.</li><li>Some scenarios are so far-fetched (“user logs in with a 200-character emoji password”) that they add no real value.</li></ul><p>In the end, the team realises the truth: <strong>AI gave them speed, but not trust.</strong> And in QA, trust is everything.</p><h3>The Problem with Blind AI Adoption</h3><p>The story isn’t far-fetched. Many teams are rushing to adopt <strong>AI in Quality Assurance and test automation</strong>, but without oversight, the results can be misleading or even dangerous.</p><ul><li><strong>False Confidence</strong> — More test cases ≠ better coverage.</li><li><strong>Context Blindness</strong> — AI doesn’t understand your business rules or compliance needs.</li><li><strong>Maintenance Overhead</strong> — Auto-generated code often breaks your framework conventions.</li><li><strong>Bias and Gaps</strong> — If training data never covered accessibility or security, AI won’t either.</li></ul><blockquote>It’s like adding thousands of locks to your house, but forgetting to secure the front door.</blockquote><h3>How to Use AI Responsibly in QA and Test Automation ?</h3><h3>1. AI as a Peer QA, Humans as Mentors</h3><p>Treat AI like a new teammate: energetic, fast, but inexperienced. Let it draft test cases or automation scripts — but validate them with human expertise.</p><p>💡 <em>Example with GitHub Copilot in test automation</em>:<br> When writing a Selenium test, Copilot may auto-suggest:</p><pre># AI-suggested code from Copilot<br>driver.find_element(By.ID, &quot;username&quot;).send_keys(&quot;testuser&quot;)<br>driver.find_element(By.ID, &quot;password&quot;).send_keys(&quot;password123&quot;)<br>driver.find_element(By.ID, &quot;login&quot;).click()</pre><p>At first glance, this works. But:</p><ul><li>It uses <strong>hardcoded credentials</strong>.</li><li>It misses validations (e.g., assert login success, error messages).</li><li>It doesn’t handle edge cases (blank username, SQL injection attempt).</li></ul><blockquote>A responsible tester would modify this into:</blockquote><pre># Human-reviewed, production-ready version<br>username = os.getenv(&quot;TEST_USERNAME&quot;, &quot;testuser&quot;)<br>password = os.getenv(&quot;TEST_PASSWORD&quot;, &quot;password123&quot;)</pre><pre>driver.find_element(By.ID, &quot;username&quot;).send_keys(username)<br>driver.find_element(By.ID, &quot;password&quot;).send_keys(password)<br>driver.find_element(By.ID, &quot;login&quot;).click()</pre><pre># Validation<br>assert &quot;Welcome&quot; in driver.page_source or &quot;Dashboard&quot; in driver.current_url</pre><p>Here, <strong>human oversight</strong> adds security (no hardcoded secrets) and meaningful validation.</p><h3>2. Quality Gates in Automation Frameworks</h3><p>AI can help scaffold automation frameworks, but guardrails are non-negotiable.</p><p>💡 <em>Example with Page Object in Playwright</em>:<br> Copilot might generate:</p><pre>class LoginPage:<br>    def __init__(self, driver):<br>        self.driver = driver</pre><pre>    def login(self, username, password):<br>        self.driver.find_element(By.ID, &quot;username&quot;).send_keys(username)<br>        self.driver.find_element(By.ID, &quot;password&quot;).send_keys(password)<br>        self.driver.find_element(By.ID, &quot;login&quot;).click()</pre><p>This works, but it violates maintainability. Human reviewers would improve it:</p><pre>class LoginPage:<br>    def __init__(self, driver):<br>        self.driver = driver<br>        self.username_input = (By.ID, &quot;username&quot;)<br>        self.password_input = (By.ID, &quot;password&quot;)<br>        self.login_button = (By.ID, &quot;login&quot;)</pre><pre>    def login(self, username, password):<br>        self.driver.find_element(*self.username_input).send_keys(username)<br>        self.driver.find_element(*self.password_input).send_keys(password)<br>        self.driver.find_element(*self.login_button).click()</pre><p>This aligns with <strong>best practices in test automation</strong>: centralising locators, avoiding magic strings, and making the code maintainable.</p><h3>3. Domain Guardrails</h3><blockquote>Feed AI the context it lacks.</blockquote><p><em>Examples</em>:</p><ul><li>In <strong>fintech</strong>, ensure AI-generated test cases validate <em>KYC checks</em> and <em>transaction rollbacks</em>.</li><li>In <strong>healthcare</strong>, enforce <em>data privacy</em> and <em>masking rules</em>.</li><li>In <strong>e-commerce</strong>, include promotions, coupon expiry, and stock-out flows.</li></ul><p>Without domain-specific prompts, <strong>AI in test automation</strong> remains shallow.</p><h3>4. Human Oversight Without Bottlenecks</h3><p>The trick is to supervise without slowing down.</p><ul><li><strong>Shift Left</strong> — Validate AI’s test ideas during sprint planning.</li><li><strong>Tiered Reviews</strong> — Humans review high-risk flows; AI handles low-risk cases with light checks.</li><li><strong>Meta-Automation</strong> — Use pipelines that auto-flag flaky or duplicate tests.</li></ul><blockquote>This way, humans stay <strong>quality guardians</strong>, not bottlenecks.</blockquote><h3>Practical Applications of Responsible AI in QA</h3><ul><li><strong>Test Case Generation</strong>: AI drafts 20 login scenarios → Human ensures coverage includes edge cases like expired password or multiple device logins.</li><li><strong>Automation Framework</strong>: AI scaffolds Playwright + Python → Human enforces Page Object pattern and CI/CD hooks.</li><li><strong>Data Creation</strong>: AI generates datasets → Human validates realism (no users aged 200).</li><li><strong>Exploratory Testing</strong>: AI suggests weird inputs → Human filters meaningful ones, discards noise.</li><li><strong>GitHub Copilot in Test Automation</strong>: AI writes boilerplate → Human adds validations, security, and maintainability.</li></ul><blockquote>The result? AI brings <strong>speed</strong>, humans bring <strong>judgment</strong>.</blockquote><h3>Best Practices Checklist: Responsible AI in QA</h3><ol><li>Use <strong>AI in QA as an assistant</strong>, not the owner.</li><li>Apply <strong>human-in-the-loop reviews</strong> to validate AI outputs.</li><li>Enforce <strong>quality gates</strong> (linting, code style, CI/CD checks).</li><li>Feed AI with <strong>domain-specific guardrails</strong> for better context.</li><li>Automate oversight to avoid bottlenecks (e.g., detect flaky/duplicate tests automatically).</li></ol><h3>The Balanced Future</h3><p>The future of QA isn’t AI replacing testers — it’s <strong>AI empowering testers</strong>.</p><ul><li><strong>AI for scale</strong>: regression variations, data generation, exploratory prompts.</li><li><strong>Humans for sense-making</strong>: business context, risk prioritisation, long-term maintainability.</li></ul><blockquote>When done right, testers move from being “script writers” to <strong>strategic curators of quality</strong>.</blockquote><h3>Closing Thought</h3><blockquote>AI in QA is like cruise control in a car. It makes the ride smoother, but you still need a driver to steer, brake, and make judgment calls.</blockquote><p>The imaginary team from our opening story learned this lesson quickly. They didn’t abandon AI. Instead, they added checks, guardrails, and human validation. Today, their framework is leaner, smarter, and faster — powered by AI, trusted by humans.</p><p>And that’s the balance we should all aim for.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd42c0181375" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating your collections from Postman to Insomnia]]></title>
            <link>https://medium.com/@rahul.kumar.sdet/migrating-your-collections-from-postman-to-insomnia-e9ae449be17f?source=rss-be413ee260fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9ae449be17f</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[api-testing]]></category>
            <dc:creator><![CDATA[Rahul Kumar]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 05:06:17 GMT</pubDate>
            <atom:updated>2024-02-17T19:12:09.580Z</atom:updated>
            <content:encoded><![CDATA[<h4>Everything you need to know and do</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*C6c9DVhMubQSP1KAZb7fzA.jpeg" /></figure><p>API development and testing have become integral parts of modern software development. <strong><em>Postman</em></strong> has long been the go-to choice for developers when it comes to testing APIs. However, in recent years, <a href="https://insomnia.rest/">Insomnia</a> has gained popularity for its rich feature set, user-friendly interface, and enhanced collaboration capabilities. If you’re considering making the switch, this blog post will guide you through the step-by-step process of migrating from <strong>Postman</strong> to <a href="https://insomnia.rest/"><strong>Insomnia</strong></a>.</p><h3>Why Consider Migrating?</h3><p>Before we delve into the migration process, let’s explore why you might want to consider switching from Postman to Insomnia:</p><ol><li><strong>Support for local vault/storage: </strong>With the latest <a href="https://github.com/Kong/insomnia/releases/tag/core%408.3.0">version 8.3</a>, Insomnia has brought back <strong><em>100% local storage with no cloud synchronization</em></strong> for your projects which is the most important driving factor for us to choose this tool over Postman which has ended local scratchpad support and had forced everyone to sync data to their cloud-based workspace.</li><li><strong>Improved Collaboration</strong>: Insomnia offers better team collaboration features, allowing for easier sharing of API workspaces and seamless integration with version control systems like Git.</li><li><strong>Modern User Interface</strong>: Insomnia’s user-friendly and modern interface provides a smooth user experience, making it easier to work with APIs.</li><li><strong>Advanced Functionality</strong>: Insomnia provides advanced features like GraphQL support, dynamic environments, and workspace-level variables, making it a compelling choice for API development and testing.</li><li><strong>Extensibility</strong>: Insomnia’s extensive plugin system allows you to extend its capabilities to fit your specific requirements.</li><li><strong>Cost-Efficiency</strong>: While Postman offers a free tier, its Pro features come at a cost. Insomnia, on the other hand, offers a free and open-source version along with a paid plan, potentially reducing your tooling expenses.</li></ol><h3>Step-by-Step Migration Guide</h3><p>Now, let’s go through the steps to migrate from <strong>Postman</strong> to <strong>Insomnia</strong>.</p><h4>1. Install Insomnia</h4><p>If you haven’t already, download and install Insomnia from the <a href="https://insomnia.rest/download">official website</a>. Install it and run the application. You have two options while opening to use the Insomnia. Either you can use a lightweight scratch pad and work locally or create an account and you will be syncing the data to Insomnia Cloud. The choice is yours. The cloud-based process allows you to save and access your collections anywhere by logging into the client login. While the scratch pad does not require you to sync data</p><h4>2. Export Data from Postman</h4><ol><li>Open <em>Postman</em>.</li><li>Click on the “<em>Collections</em>” tab on the left sidebar.</li><li>Select the collection you want to export.</li><li>Click the three dots (options menu) and choose <em>“Export.”</em></li><li>Choose the format in which you want to export (Insomnia supports importing Postman v2 format).</li><li>Save the exported file to your computer.</li></ol><h4>3. Import Data into Insomnia</h4><ol><li>Open <em>Insomnia</em>.</li><li>Go to <strong><em>“File” &gt; “Import Data” &gt; “From File.”</em></strong></li><li>Select the Postman export file you saved earlier.</li><li>Insomnia will prompt you to confirm the import. Click <em>“Import”</em> to proceed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UxjlN2S8rwCupLLd7I5gGQ.png" /><figcaption>Import Button in Insomnia</figcaption></figure><h4>4. Review and Refine</h4><p>After importing your data, reviewing your endpoints, requests, and collections in Insomnia is essential. You may find that some elements require minor adjustments to work optimally in the new environment. Insomnia’s user-friendly interface makes this process relatively straightforward.</p><h4>5. Workspace Creation</h4><p>Insomnia uses the concept of workspaces to organize your API requests and environments. Consider creating workspaces and moving your imported collections into appropriate workspaces for better organization.</p><h4>6. Set Up Environments</h4><p>Insomnia allows you to manage environments more effectively than Postman. Create and configure environments in Insomnia to handle different API endpoints, such as development, testing, and production. Utilize dynamic variables and workspace-level variables to streamline your workflow.</p><h4>7. Test and Refine</h4><p>Take the time to test your API requests thoroughly within Insomnia. This step is crucial to ensure that everything functions as expected. If you encounter issues, make the necessary adjustments to your requests or environments.</p><h4>8. Explore Plugins</h4><p>Insomnia offers a range of plugins that can enhance your API testing and development capabilities. Explore the available plugins and integrate them as needed to meet your requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q_bttyfWYvEzh3oXey3Q3Q.png" /><figcaption><strong>Insomnia Plugin Hub</strong></figcaption></figure><p>As per the need and use we can install plugins. Below are simple steps that can be helpful:</p><ol><li>First of all, explore the plugin <a href="https://insomnia.rest/plugins.">hub</a> on the Insomnia website for plugins that may interest you.</li><li>Then navigate to <strong><em>Insomnia Preferences → Plugins </em></strong>on the app.</li><li>Search for the Plugin which needs to be added and click the <strong>Install Plugin </strong>button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1urVyTtTiCgmTOqiZHn7Wg.png" /><figcaption>Insomnia Preferences</figcaption></figure><p>There are a few useful links in the same Preferences section that can be handy as well:</p><ol><li><strong>Reveal Plugins Folder</strong> — that can open the local folder containing all the relevant npm packages for installed plugins.</li><li><strong>Browse Plugin Hub</strong> — that directly opens the Insomnia Plugin <a href="https://insomnia.rest/plugins">Hub</a>.</li><li><strong>Generate New Plugin — </strong>that can generate the base npm package for any plugin you may want to create.</li></ol><h3>Conclusion</h3><p>Migrating from <strong><em>Postman</em></strong> to <a href="https://insomnia.rest/"><strong><em>Insomnia</em></strong></a> is a strategic move that offers improved collaboration, a modern user interface, advanced functionality, extensibility, and cost-efficiency. Following the steps outlined in this guide, you can seamlessly transition to Insomnia while retaining your existing API assets and workflows. As you explore the features and capabilities of Insomnia, you’ll likely find that it’s a powerful tool for API development and testing, contributing to a more efficient and productive development process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9ae449be17f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agile Testing 101]]></title>
            <link>https://medium.com/@rahul.kumar.sdet/agile-testing-38b83d3b985a?source=rss-be413ee260fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/38b83d3b985a</guid>
            <category><![CDATA[agile-testing]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[agile-methodology]]></category>
            <category><![CDATA[agile]]></category>
            <dc:creator><![CDATA[Rahul Kumar]]></dc:creator>
            <pubDate>Wed, 29 Mar 2023 09:28:03 GMT</pubDate>
            <atom:updated>2024-03-18T07:21:44.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>Agile Testing — A concise take on it</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SSIHErrASKI4J6WhlhPBeg.jpeg" /></figure><h4>What is Agile Testing?</h4><p>In simple words, Agile testing is nothing but the test practices that follow the principle of agile software development. Agile development is iterative and incremental in nature hence the testing is required and is done on an incremental build as soon as it is available. In addition to this, the activities of agile development happen over shorter time frames and hence the test approaches also need to be adapted accordingly.</p><h4>Traditional vs. Agile Testing</h4><p>Agile testing differs from traditional ways of testing in several ways. For a better understanding I have tried to summarise them below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rexuLtEvRHZXU1O51GH5Wg.png" /><figcaption>Traditional vs. Agile Testing</figcaption></figure><h4>Benefits of agile testing</h4><p>Agile testing is an integral part of the Agile development process, which emphasises collaboration, flexibility, and continuous improvement. A question comes to our mind why do we even need to have agile testing and what benefits it has for us? To answer this let&#39;s look at some of its benefits:</p><ul><li><strong>Faster Time-to-Market</strong>: Agile testing ensures that testing is performed continuously throughout the development process, which helps to identify defects early and reduce the time required to release the software.</li><li><strong>Improved Collaboration</strong>: It involves close collaboration between testers, developers, and business stakeholders. This leads to better communication, increased transparency, and a shared understanding of the software requirements and objectives.</li><li><strong>Increased Flexibility</strong>: It allows changes in software requirements and priorities to be accommodated quickly and efficiently. This flexibility ensures that the software remains relevant and aligned with business goals.</li><li><strong>Better Quality</strong>: Agile testing ensures that quality is built into the software from the start. By testing continuously, defects are identified and fixed quickly, leading to a higher-quality end product.</li><li><strong>Enhanced Customer Satisfaction</strong>: It ensures that the software meets customer expectations and requirements. By involving customers in the testing process, their feedback can be incorporated into the software, leading to a more satisfying user experience.</li><li><strong>Reduced Costs</strong>: It reduces the overall cost of testing by identifying and fixing defects early in the development process. This reduces the cost of rework and ensures that the software meets the requirements on the first attempt.</li></ul><p>In summary, Agile testing helps to improve the overall quality of software, reduce time-to-market, increase customer satisfaction, and reduce costs.</p><h4>Agile testing techniques</h4><p>Agile testing techniques are testing practices that are used in Agile software development methodologies to ensure that the software being developed meets the business requirements and is of high quality. Here are some Agile testing techniques:</p><ol><li><strong>Test-driven development (TDD)</strong>: TDD is a software development technique that involves writing test cases before writing the code. The test cases are used to validate the code and ensure that it meets the requirements.</li><li><strong>Behaviour-driven development (BDD)</strong>: BDD is a software development technique that involves defining the behaviour of the software in a structured format that can be understood by both technical and non-technical stakeholders. BDD involves creating executable specifications that can be used to verify that the software meets the business requirements.</li><li><strong>Acceptance Test-Driven Development (ATDD)</strong>: ATDD is a software development technique that involves creating acceptance tests that can be used to validate that the software meets the business requirements. These tests are created collaboratively with stakeholders and developers and are used to ensure that the software meets the needs of the business.</li><li><strong>Exploratory testing</strong>: Exploratory testing is a testing technique that involves exploring the software to discover potential defects and issues that may not be covered by other types of testing. This technique is often used in Agile development because it can uncover defects early in the development process.</li><li><strong>Continuous integration (CI)</strong>: CI is a software development technique that involves integrating the code changes made by different developers into a central repository frequently. This allows teams to identify and fix defects early in the development process.</li><li><strong>Continuous testing (CT)</strong>: CT is a software development technique that involves automating testing activities throughout the development process. This allows teams to identify and fix defects early in the development process.</li><li><strong>Pair testing</strong>: Pair testing is a testing technique that involves two testers working together to test the same software. This technique can improve the quality of testing and help identify defects more quickly.</li></ol><p>These are just a few Agile testing techniques that can be used. The choice of techniques depends on the specific needs of the project, the team’s experience, and the business requirements.</p><h4>How to implement Agile testing effectively in our project?</h4><p>Implementing Agile testing effectively in a project requires a focused and disciplined approach. Here are some steps that can help:</p><ol><li><strong>Understand Agile First:</strong> Start with a clear understanding of the Agile methodology and its principles. The Agile Manifesto and its twelve principles should be well understood by the team.</li><li><strong>Have a proper Agile team:</strong> Form an Agile team that includes representatives from all stakeholders, including developers, testers, product owners, and customers. This team should work collaboratively throughout the project.</li><li><strong>Have defined requirements:</strong> Define a set of requirements that are concise, clear, and testable. This will help ensure that the team is working toward a common goal and that the testing process is effective.</li><li><strong>Plan Early:</strong> Planning the testing activities early in the project and integrating them with the development activities. The testing team should work closely with the development team to ensure that the product is tested as soon as possible.</li><li><strong>Use Automation tools:</strong> Use automated testing tools and techniques to increase efficiency and reduce errors. Test automation can help reduce testing time and improve accuracy.</li><li><strong>Continuous review: </strong>We must review and improve the testing process on regular basis to identify areas for improvement and make changes as necessary.</li><li><strong>Effective communication:</strong> Communicate effectively with all stakeholders, including customers, developers, and testers. Regular communication can help ensure that everyone is on the same page and working toward the same goal.</li></ol><h4>Conclusion</h4><p>Agile testing is indeed the need of the hour when we are working in the Agile way. The agile process is ever-evolving and we Testers as well need to adapt ourselves in terms of methods and ways of testing to deliver quality software over a short period. The views expressed here are based on my experience in working with Agile teams and some research I did online. It is a vast topic and I tried to summarise it in a short post. Feel free to drop a comment and share your opinions as well.</p><p>Happy Testing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38b83d3b985a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flakiness in Test Automation — A tester’s nightmare]]></title>
            <link>https://medium.com/@rahul.kumar.sdet/flakiness-in-test-automation-a-testers-nightmare-f21a934d7fc7?source=rss-be413ee260fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f21a934d7fc7</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[flakiness]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Rahul Kumar]]></dc:creator>
            <pubDate>Thu, 18 Aug 2022 12:19:59 GMT</pubDate>
            <atom:updated>2022-10-11T10:24:37.650Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flakiness in Test Automation — A tester’s nightmare</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4G_rqTu6ngtQgZ35LEtag.jpeg" /></figure><p>Hey Folks, Before we delve deep into the topic let me take you back to a childhood story to set the context.</p><h4><strong>A story down our memory lane.</strong></h4><p>We all have heard the story of the Boy Who Cried Wolf, let’s just revisit it. “<em>A shepherd-boy, who watched a flock of sheep near a village, brought out the villagers three or four times by crying out, “Wolf! Wolf!” and when his neighbours came to help him, laughed at them for their pains. The Wolf, however, did truly come at last. The Shepherd-boy, now really alarmed, shouted in an agony of terror: “Pray, do come and help me; the Wolf is killing the sheep”; but no one paid any heed to his cries, nor rendered any assistance. The Wolf, having no cause of fear, at his leisure lacerated or destroyed the whole flock. There is no believing a liar, even when he speaks the truth.</em>”</p><p>There is nothing worse than tests that “cry wolf.” Just like the boy in the story no one trusts flaky code. One of the most important things about test scripts is making sure their results are deterministic. Non-deterministic test results are unreliable too. There is no point in writing zillions of test scripts when a bug goes uncaught due to the flakiness in our automation code.</p><h4>What does flakiness actually mean ?</h4><p>In simple words Flaky tests pass or fail unexpectedly for reasons that appear random. So basically our tests are said to be flaky if we have variance in test results even when :</p><ul><li>The application under test is unchanged.</li><li>The test automation code is unchanged.</li><li>Environment is unchanged.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*DxJOplLZNORss_xRr5bnVA.png" /><figcaption><strong>Execution 1</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*F3DAmic9yFy_ydjSDTcZ6Q.png" /><figcaption><strong>Execution 2</strong></figcaption></figure><p>It’s quite evident from the above test results that they are misleading and eventually if this variance grows, we lose our confidence in our automation suite.</p><h4>How bad is it ?</h4><p>Flaky tests may grow in number if not identified and addressed properly as our test suite expands. Flakiness in test automation is a major roadblock in automation suite maintenance and eventually may lead to compromised build. All our efforts might go in vain if due to flakiness a valid defect seeps into upper environments.</p><p><strong><em>“Testing is the key to releasing high quality software and automating ensures that testing is repeatable, reliable and fast” </em></strong>— Alice Nodelman in GTAC (Google Test Automation Conference)</p><p>Each one of the merits mentioned above is obscured by these flaky tests. It is indeed a biggest hurdle in maintaining a reliable automation framework.</p><p><strong>Impacts of flakiness</strong></p><ul><li><strong>Nondeterministic test results -</strong>The test results which cannot help us determine the exact status of the build and their Pass/Fail/Skip percentage are really problematic and we lose confidence in our test framework.</li><li><strong>Non reliable </strong>— If results vary with random reasons and frequency , they cannot be reliable.</li><li><strong>Non repeatable </strong>— If we cannot rely on them, we cannot use them repeatedly and that defeats the purpose of automation.</li><li><strong>Delayed Build </strong>— Untrustworthy test results can lead to delayed builds as they keep on failing randomly for reasons that appear quite random and chaotic too.</li><li><strong>Bug leakage </strong>— If the test results are inconsistent and not giving a clear picture of the failures a valid defect may sneak-in into our test suite and can navigate across various environments and even to the production.</li></ul><h4>What makes tests flaky ?</h4><p>There can be number of reasons for tests to become flaky but I would like to focus on a few major ones viz:</p><ol><li><strong>Issues due to badly written test<br>-<em>Dependance on test order — </em></strong>These tests fail when run in isolation and only pass when the whole suite runs.<br>-<strong><em>Badly timed assertions — </em></strong>When we time our assertions when the application state is not in consistent state as expected, they fail.</li><li><strong>Issues due to parallel execution of tests<br>-<em>Grid nodes being unresponsive</em></strong> — This happens when our individual nodes in grid set up hangs due to a number of reasons and scheduled tests start failing due to resources unavailability. Maybe due to some network issues a lot of browser instances are left open clogging our grid machines to perform optimally.</li><li><strong>Having a huge number of end to end UI test cases<br>-<em>Locator issues</em></strong> — Using non-optimal locators is a major cause for UI tests failures. Using absolute XPath is yet another one of the reasons.<br>-<strong><em>Incompatible browser and driver version</em></strong> — The browser versions are released quite often, sometimes some driver capabilities are not compatible with the newer versions of the browser leading to failures.</li></ol><h4>Handling flakiness</h4><p>Now let us dive a bit into the solving this problem and explore a few of the many major ways of keeping flakiness at bay. I have tried to categorise them as per my understanding and approach.</p><p><strong>Test Case level handling</strong></p><ul><li><strong>Make tests independent</strong> — We should always try to write test cases which are independent from each other. Also they should not be dependent on their order of execution. Clearing the state before each test is a wonderful tip.</li><li><strong>Having consistent assertion timings</strong> — To address the flakiness due to inconsistent assertion timings we must have steps in place to fetch the current application status in a few intervals till the desired state and then assert.</li></ul><p><strong>Handling flakiness in parallel executions</strong></p><ul><li><strong>Remote grid nodes maintenance</strong> — Restarting node VMs once in while actually helps them run optimally. We can also have some pre suite clean up jobs to clear up the resources like open browsers and other applications.</li></ul><p><strong>Handling flakiness in UI test cases</strong></p><ul><li><strong>Have less UI test cases</strong> — Best way to avoid the flaky tests in our suite is having as much less UI test cases as possible. Reduce the number from 100 to 10 may be, the percentage of flakiness would also reduce significantly. Having said that I also do agree we cannot significantly decrease the UI test cases in some projects where we do have UI intensive interactions but we can surely reduce the counts if we try our best.</li><li><strong>Use optimal locators</strong> — Try to use relative locators instead of absolute ones. We should use the most optimal locators be it Xpath, Id , CSS locators etc. for every element and try to spend ample time in constructing the locators for elements in the script creation phase rather than to struggle when we are actually executing them and facing locator issues.</li><li><strong>Driver vs browser compatibility check</strong> <strong>on regular basis</strong> — We can develop a utility that runs on a sample suite containing the most common browser actions across various permutations and combinations of driver and browser versions that can ascertain the latest stable version combination. The stable version then can be used so that we have a stable and consistent test runs.</li></ul><h3>Conclusion</h3><p>Flakiness has been a very common problem in industry but often not paid proper heed. I have tried my best as per my personal experience to describe how flakiness can cascade into a nightmare and various ways in which we can mitigate them. There can be many other reasons for the flaky tests and various other mitigation ways as well. Feel free to drop your valuable feedbacks and comments.</p><p>Happy Automation !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f21a934d7fc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>