<?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 Kübra Sönmez on Medium]]></title>
        <description><![CDATA[Stories by Kübra Sönmez on Medium]]></description>
        <link>https://medium.com/@kubrasonmez9292?source=rss-b22c62acada0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*S4nx4i0y35pjvKiKzn-bYA.png</url>
            <title>Stories by Kübra Sönmez on Medium</title>
            <link>https://medium.com/@kubrasonmez9292?source=rss-b22c62acada0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 19:37:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kubrasonmez9292/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[The Difference Between an Average QA and a Great QA]]></title>
            <link>https://medium.com/@kubrasonmez9292/the-difference-between-an-average-qa-and-a-great-qa-d9d9e2285421?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9d9e2285421</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[backend-testing]]></category>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Thu, 07 May 2026 08:25:52 GMT</pubDate>
            <atom:updated>2026-05-07T08:38:52.005Z</atom:updated>
            <content:encoded><![CDATA[<h3>One Question That Changes Everything</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lOlVZeUmPolL8N6IUrvncA.png" /></figure><p>A feature gets developed.QA tests it.Everything works!</p><p>A few days later, a bug appears in production.</p><p>Sounds familiar? :)</p><p>This usually isn’t caused by a lack of testing. It’s caused by a <strong>lack of perspective</strong>.</p><p>Because the real difference between an average QA and a great QA is not tools, automation skills, or the number of test cases written.</p><p>It comes down to a single question:</p><p><strong>“What if…?”</strong></p><h3>Is Testing Enough?</h3><p>Most test processes look like this:</p><ul><li>Enter valid input → does it work?</li><li>Leave fields empty → does it show an error?</li><li>Follow the main flow → is everything OK?</li></ul><p>Everything looks correct.</p><p>But there’s a problem:</p><p><strong>Real users don’t behave correctly.</strong></p><h3>The Real World Is Not a Happy Path</h3><p>Users:</p><ul><li>Click buttons twice</li><li>Lose internet connection</li><li>Retry before a response arrives</li><li>Assume the system is frozen and try again</li></ul><p>Systems don’t break under correct usage.They break under <strong>unexpected behavior</strong>.</p><p>This is where <strong>“What if?”</strong> thinking begins.</p><h3>Same Feature, Two Different Mindsets</h3><p>Let’s take a money transfer API as an example.</p><h3>The Average Approach</h3><ul><li>Send 100 → success</li><li>Send 0 → error</li><li>Missing field → error</li></ul><p>Tests pass.</p><p>But is the system actually safe?</p><h3>The “What if?” Approach</h3><p>Now ask different questions:</p><ul><li>What if the same request is sent twice?</li><li>What if the user retries before the response arrives?</li><li>What if the backend is slow?</li><li>What if an unexpected currency is sent?</li></ul><p>Each of these represents a <strong>real production risk</strong>.</p><h3>Asking “What if?” Is Not Enough</h3><p>A great QA doesn’t just turn these into test cases.</p><p>They also ask:</p><blockquote><em>“How is this handled in the code?”</em></blockquote><p>Because some problems are not prevented by testing, they must be prevented by <strong>system design</strong>.</p><h3>1. What if the same request is sent twice?</h3><p>Double-clicks, retries, timeouts…</p><p>Double-clicking, mobile network problems, retrying after a timeout, or browser refreshing can cause the same request to reach the system twice.</p><p>This is a serious risk, especially in transactions such as money transfers, order creation, payment processing, and reservations.</p><p>In financial or transactional systems, this is critical.</p><h3>How to handle it in code</h3><p>The most common solution: <strong>Idempotency Keys</strong></p><p>The client generates a unique key for each critical operation and sends it in the request header. The backend checks this key:</p><pre>POST /transfer<br>Idempotency-Key: 123-abc</pre><pre>if key exists:<br>    return previous response<br>else:<br>    process request<br>    store key</pre><h3>Alternatives</h3><ul><li>Request hashing</li><li>Database unique constraints</li><li>Transaction reference IDs</li><li>Message queue deduplication</li><li>State management (PENDING / COMPLETED)</li></ul><h3>What should QA verify?</h3><ul><li>What happens when the same request is sent twice?</li><li>Does the system create duplicate records?</li><li>Does retry after timeout create duplicates?</li><li>Is the same response returned?</li><li>Is the data consistent?</li></ul><h3>2. What if the user retries before the response?</h3><p>Users don’t wait. They click again.</p><p>The user presses the button.<br>Loading begins.<br>But before a response arrives, they press it again.</p><p>This seems very simple, but it can start two processes simultaneously in the system.</p><h3>How to handle it in code</h3><p>Frontend: The first step on the frontend side is to disable the button.</p><pre>button.disabled = true</pre><p>But this alone is not enough. Because the user can send the request again from a different device, a different tab, or directly via the API.</p><p>Therefore, protection must also be in place on the backend side.</p><p>Backend:</p><pre>if status == PROCESSING:<br>    return 409 Conflict</pre><h3>Alternatives</h3><ul><li>Double-click prevention</li><li>Optimistic locking</li><li>Distributed locks</li><li>Queue-based processing</li></ul><h3>What should QA verify?</h3><ul><li>What happens with rapid clicks?</li><li>Are parallel requests handled correctly?</li><li>Is protection only in UI or also in API?</li><li>Does the system prevent duplicates?</li></ul><h3>3. What if the backend is slow?</h3><p>The backend doesn’t always respond quickly. The network might be slow, the service might be overloaded, or the downstream system might not respond.</p><p>In this case, what does the user see? Was the process actually completed?<br>Or was it left incomplete?</p><h3>How to handle it in code</h3><p>First, the timeout and retry strategy must be clear.</p><pre>if timeout:<br>    mark as PENDING<br>    return processing response</pre><p>Then:</p><pre>GET /transaction/status</pre><h3>Alternatives</h3><ul><li>Retry mechanisms</li><li>Circuit breaker</li><li>Async processing</li><li>Status polling</li><li>Outbox pattern</li></ul><h3>What should QA verify?</h3><ul><li>What does the UI show during delays?</li><li>Are users misled by incorrect success/failure?</li><li>Does retry create duplicate operations?</li><li>Does status tracking work correctly?</li></ul><h3>4. What if an unexpected currency is sent?</h3><p>Unexpected input is always a risk.</p><p>The system might only work with the expected currencies. However, unexpected currencies might appear due to client errors, outdated application versions, manual API calls, or integration problems.</p><p>For example, if the system only supports KZT:</p><h3>How to handle it in code</h3><pre>if currency not supported:<br>    return 400 Bad Request</pre><h3>Alternatives</h3><ul><li>Enum validation</li><li>Schema validation</li><li>Business rules</li><li>Feature flags</li></ul><h3>What should QA verify?</h3><ul><li>How does the system handle unsupported values?</li><li>What happens with null or invalid formats?</li><li>Are error messages consistent?</li><li>Is backward compatibility maintained?</li></ul><h3>This Is the Real Difference</h3><p>An average QA asks:</p><blockquote><em>“Does it work?”</em></blockquote><p>A great QA asks:</p><blockquote><em>“How can it break?”</em></blockquote><p>A great QA is not the one who writes more tests. Or knows more tools.</p><p>A great QA is the one who asks better questions.</p><p>And most expensive production bugs come from questions that were never asked.</p><p>Next time you test a feature, ask:</p><ul><li>How can this be misused?</li><li>What happens under stress?</li><li>What happens if things go wrong?</li></ul><p>Because sometimes, <strong>one question is more valuable than 100 test cases.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9d9e2285421" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Canary Testing: Lessons Learned from Launching 15 Food Delivery Brands Across 50+ Countries]]></title>
            <link>https://medium.com/@kubrasonmez9292/canary-testing-lessons-learned-from-launching-15-food-delivery-brands-across-50-countries-cc146587dd51?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc146587dd51</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 09:35:54 GMT</pubDate>
            <atom:updated>2025-08-08T09:35:54.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M5jOmvoCPcagTD2x" /></figure><p><strong>Wouldn’t it be great to quietly launch a feature without affecting all your users at once?</strong><br> That’s exactly what <strong>Canary Testing</strong> enables you to do.</p><p>Over the past year, I led the testing operations of a global food delivery platform that supports <strong>15 different brands in more than 50 countries</strong>. Each market had unique payment systems, backend integrations, and user behaviors. Traditional testing approaches simply weren’t enough.</p><p>That’s when <strong>Canary Testing</strong> became our go-to strategy.</p><h3>What is Canary Testing?</h3><p>Canary testing is a release strategy where a new feature or version is gradually rolled out to a small subset of users before making it available to everyone.</p><p>The term comes from the practice of sending canaries into coal mines , if the bird was affected, it was a sign of danger for miners. Similarly, in software, issues are first caught in a small user group, reducing the risk of mass outages.</p><h3>15 Brands, 50+ Countries: Why We Had No Choice but to Go Canary</h3><p>Each of our brands operated in a different market with custom business logic, APIs, and promotional structures.</p><p>A bug in one deployment could instantly ripple across continents, triggering user complaints and operational chaos.</p><p>Thanks to Canary Testing:</p><ul><li>We launched new features country by country.</li><li>Started with just one or two markets, then gradually expanded.</li><li>Monitored analytics, crashes, and user behavior before going wider.</li></ul><p>This strategy helped us avoid production-level disasters and maintain a high level of trust.</p><h3>My Canary Testing Strategy</h3><p>When dealing with a global-scale rollout, you need more than just manual testing or automation. I followed a hybrid strategy to support our canary releases effectively:</p><h4>1. Pre-Release Testing</h4><ul><li>Every new feature was regression tested in staging environments.</li><li>We extended automation suites to include flag-specific test cases.</li><li>Used WireMock to simulate production-like behaviors in API tests.</li></ul><h4>2. Initial Canary Launch</h4><ul><li>First, deployed to staging → then to a single market (e.g., iOS users in Türkiye).</li><li>We didn’t just test functionality — we observed real user behavior.</li></ul><h4>3. Monitoring &amp; Metrics</h4><ul><li>Tools like <strong>Datadog</strong> and <strong>Firebase</strong> helped us track real-time metrics.</li><li>We looked at crash reports, performance issues, and behavioral analytics.</li></ul><h4>4. Gradual Rollout</h4><ul><li>If everything looked good, we expanded to 5, then 10 countries.</li><li>If something broke, we simply flipped the feature flag off. No need for hotfixes.</li></ul><h3>My Experience with Fun With Flags (Internal Feature Flag Tool)</h3><p>We used an in-house tool called <strong>Fun With Flags</strong> to manage all our feature toggles.</p><p>With it, we could:</p><ul><li>Control rollouts based on country, platform, user ID, etc.</li><li>Roll back instantly with full audit trails.</li><li>Empower testers to experiment in production without dev intervention.</li></ul><p>Since this was a proprietary tool, not everyone has access to it.<br> But don’t worry — there are plenty of great third-party tools out there that serve the same purpose.</p><h3>Tools You Can Use for Canary Testing</h3><p>If you’re looking to implement Canary Testing, here are some solid tools worth exploring:</p><p><strong>LaunchDarkly — — →</strong>Rich SDKs and targeting capabilities. Ideal for large-scale gradual rollouts.</p><p><strong>Split.io — — →</strong>Great for experimentation, A/B testing, and behavioral insights.</p><p><strong>Flagsmith — — — -&gt;</strong>Open-source and self-hostable. Perfect for small to mid-sized teams.</p><p><strong>ConfigCat — — — -&gt;</strong>Simple UI, quick setup. Non-technical users can manage flags easily.</p><p><strong>Unleash — — — -&gt;</strong>Flexible and customizable open-source solution. Works well with microservices.</p><h3>Why Canary Testing Is a Culture, Not Just a Technique</h3><p>Canary Testing isn’t just about toggles or rollouts, it’s about <strong>building a culture of safe delivery</strong>.<br> From QA engineers to product managers, from backend teams to DevOps, everyone must embrace the mindset.</p><p>It helps:</p><ul><li>Reduce production bugs.</li><li>Improve rollback speed.</li><li>Build developer confidence.</li><li>Protect user experience.</li></ul><p>In distributed systems with multi-brand, multi-country deployments, a single risky release can cost you dearly.</p><p>Canary Testing saved us from countless headaches while scaling our product globally.<br> It gave us confidence to release, experiment, and iterate — without risking the user experience.</p><p>If you’re working in a multi-region, multi-brand setup like we were, I highly recommend building Canary Testing into your release pipeline starting <strong>today</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc146587dd51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Test Cases Without Writing Them? An Introduction to Model-Based Testing]]></title>
            <link>https://medium.com/@kubrasonmez9292/automating-test-cases-without-writing-them-an-introduction-to-model-based-testing-05dbd817b44e?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/05dbd817b44e</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 16:20:05 GMT</pubDate>
            <atom:updated>2025-07-26T16:20:05.361Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-9CdqdptO4z7XVwU" /></figure><p>In complex software systems, writing test cases manually can be time-consuming and prone to inconsistency, especially when dealing with user flows and state transitions. One increasingly popular solution to this challenge is <strong>Model-Based Testing (MBT)</strong>, a method that automates test generation using system models.</p><p>This article walks through the basics of MBT, its benefits, a sample model, and what kind of test cases can be derived from it.</p><h3>What Is Model-Based Testing?</h3><p>Model-Based Testing is a testing technique where tests are automatically generated from a <strong>model that represents the expected behavior of the system</strong> under test. These models are usually represented as:</p><ul><li><strong>State diagrams</strong></li><li><strong>Flowcharts</strong></li><li><strong>Transition graphs</strong></li></ul><p>Each node in the model represents a state, and the arrows (transitions) define how the system moves between states based on user actions or events.</p><blockquote><em>In simple terms: “Define how the system behaves , let the model generate the test paths.”</em></blockquote><h3>Why Use MBT?</h3><p>Some key advantages of this approach include:</p><ul><li><strong>Broad test coverage</strong> :It ensures all possible transitions and scenarios are considered.</li><li><strong>Reduced manual effort:</strong>No need to write individual test cases by hand.</li><li><strong>Lower maintenance cost:</strong>Update the model and regenerate tests automatically.</li><li><strong>Scalability</strong> :As the system grows, so can your test suite — without growing complexity.</li></ul><h3>Common Tools</h3><p>There are several tools available for implementing MBT. In many real-world projects, <strong>GraphWalker</strong> is a popular open-source tool that supports model execution and path generation. For drawing the models, tools like <strong>yEd Graph Editor</strong> are often used due to their visual simplicity.</p><p>Lets do a sample!</p><p>I give you a login model i created by yEd that represents like this :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwtOfJDU9gKuCkArZNxUQA.png" /></figure><p>You can download this model by link below <a href="https://github.com/kssonmezz/LoginGraphml">https://github.com/kssonmezz/LoginGraphml</a></p><h3>Sample Scenario: Login Flow</h3><p>Let’s take a simplified login process and model it with basic states and transitions:</p><p><strong>Requirements:</strong></p><p>On a user’s login screen:</p><p>1-You can log in with a valid username and password. (Goes Homepage)<br>2-An error message will appear if the username or password is incorrect. (Invalid Login)<br>3-If the field is left blank, a warning message will appear. <br>4-If the login is successful, the homepage will open.</p><p>This model includes:</p><p><strong>States:</strong></p><p>Start (Başlangıç ekranı)</p><ul><li>LoginPage</li><li>LoginSuccess</li><li>LoginError</li><li>EmptyFieldsWarning</li></ul><p><strong>Transitions like:</strong></p><p>OpenLoginPage()</p><ul><li>EnterValidCredentials()</li><li>EnterInvalidCredentials()</li><li>SubmitEmptyForm()</li><li>ClickLoginButton()</li></ul><p><strong>Example Json Model:</strong></p><pre>{<br>  &quot;name&quot;: &quot;LoginModel&quot;,<br>  &quot;states&quot;: [<br>    {&quot;name&quot;: &quot;Start&quot;},<br>    {&quot;name&quot;: &quot;LoginPage&quot;},<br>    {&quot;name&quot;: &quot;LoginSuccess&quot;},<br>    {&quot;name&quot;: &quot;LoginError&quot;},<br>    {&quot;name&quot;: &quot;EmptyFieldsWarning&quot;}<br>  ],<br>  &quot;transitions&quot;: [<br>    {&quot;from&quot;: &quot;Start&quot;, &quot;to&quot;: &quot;LoginPage&quot;, &quot;name&quot;: &quot;OpenLoginPage()&quot;},<br>    {&quot;from&quot;: &quot;LoginPage&quot;, &quot;to&quot;: &quot;LoginSuccess&quot;, &quot;name&quot;: &quot;EnterValidCredentials()&quot;},<br>    {&quot;from&quot;: &quot;LoginPage&quot;, &quot;to&quot;: &quot;LoginError&quot;, &quot;name&quot;: &quot;EnterInvalidCredentials()&quot;},<br>    {&quot;from&quot;: &quot;LoginPage&quot;, &quot;to&quot;: &quot;EmptyFieldsWarning&quot;, &quot;name&quot;: &quot;SubmitEmptyForm()&quot;},<br>    {&quot;from&quot;: &quot;LoginError&quot;, &quot;to&quot;: &quot;LoginPage&quot;, &quot;name&quot;: &quot;ClickLoginButton()&quot;},<br>    {&quot;from&quot;: &quot;EmptyFieldsWarning&quot;, &quot;to&quot;: &quot;LoginPage&quot;, &quot;name&quot;: &quot;ClickLoginButton()&quot;},<br>    {&quot;from&quot;: &quot;LoginSuccess&quot;, &quot;to&quot;: &quot;LoginPage&quot;, &quot;name&quot;: &quot;Logout()&quot;}<br>  ]<br>}</pre><p>The JSON model we provided is a test execution model for GraphWalker. GraphWalker uses this model to generate test cases (test walks) based on the path generation strategy you specify.</p><p>When you run a sample command with the GraphWalker CLI based on the model you provided below (for example, edge_coverage 100%):</p><pre>graphwalker offline \<br>  --model login.json \<br>  --start-element &quot;Start&quot; \<br>  --pathgenerator &quot;random(edge_coverage(100))&quot;</pre><p>GraphWalker Test Outputs:</p><pre>Model: Login<br>Strategy: random(edge_coverage(100))<br><br>START: LoginPage  <br>ACTION: EnterInvalidCredentials → LoginError  <br>ACTION: ClickLoginButton → LoginPage  <br>ACTION: SubmitEmptyForm → EmptyFieldsWarning  <br>ACTION: ClickLoginButton → LoginPage  <br>ACTION: EnterValidCredentials → LoginSuccess  <br>ACTION: Logout → LoginPage  <br>END: LoginPage</pre><p>It travels through all transitions at least once (edge coverage(100))</p><h3>Where Is MBT Useful?</h3><p>MBT is especially effective in domains like:</p><ul><li>Complex business workflows (e.g., banking systems)</li><li>Mobile apps with dynamic screen transitions</li><li>Regression testing where flows are reused frequently</li><li>Risk-based testing strategies requiring broad path coverage</li></ul><h3>Consequently,</h3><p>Model-Based Testing offers a scalable and systematic way to automate test generation ,without needing to manually define each case. While it requires some initial modeling effort, the long-term gains in test coverage, maintainability, and consistency are substantial.</p><p>For QA teams aiming to shift from case-by-case manual writing toward smarter, model-driven automation, MBT is a technique worth considering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05dbd817b44e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rethinking Software Testing: What Is Shift Right Testing?]]></title>
            <link>https://medium.com/@kubrasonmez9292/rethinking-software-testing-what-is-shift-right-testing-61ee8d183ab2?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/61ee8d183ab2</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Tue, 08 Jul 2025 09:32:00 GMT</pubDate>
            <atom:updated>2025-07-08T09:32:00.565Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xWM41Z05lHotS8Rv" /></figure><p>For as long as I can remember, the software testing world has emphasized one thing: <strong>start testing early</strong>. That’s where concepts like <em>Shift Left</em> testing come from. But recently, I came across another approach that made me pause: <strong>Shift Right Testing</strong>.</p><p>At first, it felt counterintuitive. Aren’t we always told to test <em>before</em> things go live? But the more I dug into it, the more I realized that <strong>some problems only reveal themselves in the real world</strong>, with real users and real data.</p><h3>What Is Shift Right Testing?</h3><p>In simple terms, Shift Right Testing means <strong>testing later in the software development lifecycle</strong>, closer to (or within) the production environment.</p><p>Rather than just checking if your code works in a controlled environment, Shift Right focuses on <strong>how it behaves in the wild ,</strong>under real-world conditions, traffic, and user behavior.</p><h3>When and Why Is It Used?</h3><p>This approach is especially useful in scenarios like:</p><ul><li>Releasing a new feature gradually to a small user group</li><li>Observing how users interact with a new flow</li><li>Catching rare, edge-case issues that don’t appear in staging</li><li>Measuring system performance during peak times (think Black Friday)</li></ul><p>The idea is to <strong>gain insights from real usage</strong>, not just theoretical test scenarios.</p><h3>What Kinds of Tests Fall Under Shift Right?</h3><p>It’s not about one type of test. Shift Right includes a range of methods, such as:</p><ul><li><strong>A/B Testing</strong>: Comparing two versions of a feature or flow</li><li><strong>Feature Toggles</strong>: Releasing features gradually</li><li><strong>Monitoring and Observability</strong>: Tracking metrics and logs in production</li><li><strong>Chaos Testing</strong>: Intentionally breaking parts of the system to test resilience</li><li><strong>User Behavior Analysis</strong>: Watching heatmaps, click paths, and scroll depth via tools</li></ul><p>One of my favorite techniques is enabling a new feature for a limited group of users and tracking how they interact with it. It lowers the risk and provides real-time feedback.</p><h3>Shift Left vs. Shift Right: Which One?</h3><p>This isn’t a binary choice ,the two approaches complement each other:</p><ul><li><strong>Shift Left</strong>: Prevent bugs early, reduce cost</li><li><strong>Shift Right</strong>: Learn from real users, catch production issues faster</li></ul><p>A strong QA strategy should incorporate both. What you miss in one, the other might catch.</p><p>Software testing today is no longer just about writing test cases and hoping for green checks. It’s about understanding real users, anticipating unexpected behavior, and preparing for the unpredictable.</p><p>If you’ve ever found yourself constantly firefighting after a release, it might be time to move some of your testing… a little to the right. 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61ee8d183ab2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Risk Models Are Dead: Embracing Risk-Based Testing 2.0]]></title>
            <link>https://medium.com/@kubrasonmez9292/static-risk-models-are-dead-embracing-risk-based-testing-2-0-66d770045006?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/66d770045006</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Wed, 21 May 2025 06:20:12 GMT</pubDate>
            <atom:updated>2025-05-21T06:20:12.142Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s fast-paced product cycles, where releases are frequent and feedback loops are short, sticking with static test strategies is a recipe for wasted effort.</p><p>Most test teams are familiar with <strong>Risk-Based Testing (RBT) </strong>prioritizing test efforts based on the impact and likelihood of risks. While this approach has served us well in traditional settings, its limitations become painfully clear in modern, agile workflows.</p><p>That’s where <strong>Risk-Based Testing 2.0</strong> comes in not as a rebranding, but as a meaningful evolution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UoxpMJNmQ63iBwL8" /></figure><h3>What’s Wrong With Traditional RBT?</h3><p>In the classic RBT approach:</p><ul><li>Risk analysis is performed once at the beginning of the project.</li><li>Test priorities remain fixed throughout the cycle.</li><li>Risk evaluation heavily depends on human estimation.</li></ul><p>In static or waterfall environments, this made sense. But in agile teams working with short sprints, constant code changes, and evolving requirements, this static model often becomes outdated before the test execution even begins.</p><h3>What Makes RBT 2.0 Different?</h3><p><strong>Risk-Based Testing 2.0</strong> introduces <strong>dynamism and data-awareness</strong> into your test process.</p><p>Here’s how:</p><p>1. Continuous Risk Assessment</p><p>Risk isn’t something you define once and forget. With RBT 2.0, risk scores evolve sprint by sprint — reflecting code churn, feature changes, and real-time usage data.</p><p>2. Data-Informed Prioritization</p><p>Instead of relying only on intuition, RBT 2.0 brings in insights from:</p><ul><li>Code metrics (ex: complexity, churn, coverage gaps)</li><li>Defect patterns</li><li>User analytics (heatmaps, session recordings)</li><li>Business impact (critical workflows, payment paths)</li></ul><p>3. Smarter Test Coverage</p><p>Testing is no longer just about covering features. it’s about covering <strong>what matters most, right now</strong>. Test coverage becomes risk-weighted.</p><h3>But What About AI?</h3><p>Some organizations are going one step further , using machine learning models to <strong>predict risky areas</strong> based on historical defect trends and deployment logs.</p><p>While RBT 2.0 doesn’t require AI to be effective, it’s highly compatible with AI-driven platforms that surface hotspots dynamically (tools like Launchable, Sealights, or Testim, for example).</p><h3>Building Your RBT 2.0 Workflow</h3><p>Implementing Risk-Based Testing 2.0 can start simple:</p><ol><li><strong>Create a Living Risk Matrix</strong><br> Keep a central list of potential risks. Update their scores as the project evolves.</li><li><strong>Visualize Risk with Dashboards</strong><br> Use tools like Jira, Allure, or even Excel to track how risk scores change over time.</li><li><strong>Adapt Test Strategy to Risk Level</strong></li></ol><ul><li>High risk = deep test coverage + automation</li><li>Medium risk = focused test cases</li><li>Low risk = smoke/sanity checks</li></ul><p><strong>4. Review and Retrospect</strong><br> Make risk updates a part of your sprint rituals — refine as you learn.</p><h3>Conclusion:</h3><p><strong>Risk-Based Testing 2.0</strong> isn’t a buzzword.<br> It’s a practical mindset shift: from “test everything equally” to “test what matters most, dynamically.”</p><p>In an era where <strong>speed and quality</strong> must coexist, having a living, risk-aware test strategy is no longer optional! it’s essential.</p><p>Whether you’re a QA lead, a test automation engineer, or a product owner who cares about what gets shipped, this is the time to rethink how your team uses risk.</p><p>And if you’re still relying on that old spreadsheet from the kick-off meeting, maybe it’s time to let it go.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66d770045006" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visual Regression Testing for Design-Heavy Projects: Automating UI Consistency with Percy]]></title>
            <link>https://medium.com/@kubrasonmez9292/visual-regression-testing-for-design-heavy-projects-automating-ui-consistency-with-percy-0bb7eca5e014?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bb7eca5e014</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Thu, 24 Apr 2025 11:28:49 GMT</pubDate>
            <atom:updated>2025-04-24T13:18:52.179Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of software development, <strong>UI changes are inevitable</strong>. Especially in fast-paced, design-heavy projects, every minor visual update brings the risk of <strong>regression bugs</strong>. This often results in a significant increase in manual UI testing efforts. So how can teams reduce that burden?</p><p>The answer: <strong>Automated visual regression testing</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*x39_-lWsFTda03A8OMdSxQ.png" /></figure><p><strong>What Is Visual Regression Testing?</strong></p><p>Visual regression testing compares snapshots of an application’s UI across different versions to detect <strong>unintended visual changes</strong>. It focuses on pixel-perfect accuracy and helps catch subtle design issues that traditional functional tests often miss.</p><p>With visual regression testing:</p><ul><li>Undetected layout or style issues are surfaced early.</li><li>Miscommunications between designers and developers are spotted faster.</li><li>User experience consistency is preserved across releases.</li></ul><p><strong>The Cost of Manual UI Regression Testing</strong></p><p>For projects with frequent design changes, manually verifying the UI before each release is:</p><ul><li><strong>Time-consuming</strong>: Screens must be checked one-by-one, with visual comparisons made manually.</li><li><strong>Error-prone</strong>: Minor visual differences can be missed.</li><li><strong>Repetitive</strong>: Testers often find the process tedious and demotivating.</li></ul><p>All of this increases test effort and slows down release cycles.</p><p><strong>Automating UI Testing with Percy</strong></p><p><a href="https://percy.io/">Percy</a> is a modern, automated visual regression tool that integrates seamlessly with popular test frameworks like <strong>Playwright</strong>, <strong>Cypress</strong>, and <strong>Selenium</strong>. It’s especially powerful for teams looking to monitor UI consistency without manual visual QA.</p><h4>How Percy Works:</h4><ol><li>Captures screenshots during test runs.</li><li>Compares them with previously approved baselines.</li><li>Highlights visual differences with side-by-side comparisons.</li><li>Integrates with your CI/CD pipeline to approve or block builds based on visual changes.</li></ol><h4>Key Advantages:</h4><ul><li>Works independently of test code — focuses on the UI.</li><li>Pixel-perfect comparisons for reliable accuracy.</li><li>Easy-to-review visual dashboards.</li><li>Enables collaborative UI reviews between testers, developers, and designers.</li></ul><h3>When Is Visual Testing a Must?</h3><p>Percy and tools like it are critical in scenarios such as:</p><ul><li>Projects with <strong>frequent UI/UX updates</strong>.</li><li>Applications with <strong>large or complex component libraries</strong>.</li><li>Brands requiring <strong>strict visual consistency</strong>.</li><li>Design-system-driven teams that rely on reusable UI components.</li></ul><h3>Now let’s create a simple web project and take a closer look at how it works. If you want, you can also create a mobile application, the process is very similar. You can find the entire project on my Github.(<a href="https://github.com/kssonmezz/percy_pegasus_test">https://github.com/kssonmezz/percy_pegasus_tes</a>t)</h3><p>First, we go to <a href="https://percy.io/">https://percy.io/</a> and create a free user.</p><p>You create a new project with the Create new Project button. All you have to do is determine your project type (web-mobile) and project name.</p><p>When you create a project in Percy, Percy will give you a project token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V4KYwilZYIx7MI8L7J5jsQ.png" /></figure><p>Now we can move on to writing code. We create a folder and open the u folder in VS Code. We open the VS Code Terminal and run the following commands in order.</p><pre>npm init -y // create nodejs project</pre><pre>npm install -D @playwright/test<br>npx playwright install // install playwright</pre><pre>npm install --save-dev @percy/cli @percy/playwright  // install percy CLI ve SDK</pre><p>Now we export the token that Percy gave us in the terminal.</p><pre>export PERCY_TOKEN=your_token</pre><p>You can apply the folder structure by looking at my project. Now we will write our test code. This code will go to Pegasus’ website and take a screenshot on the home page.</p><pre>// @ts-check<br>import { test, expect } from &#39;@playwright/test&#39;;<br>import percySnapshot from &quot;@percy/playwright&quot;<br><br>test(&#39;Example.com visual test&#39;, async ({ page }) =&gt; {<br><br>  await page.goto(&#39;https://web.flypgs.com/booking?gclsrc=aw.ds&amp;ds_rl=1256634&amp;ds_rl=1263092&amp;gad_source=1&#39;, {<br>    waitUntil: &#39;domcontentloaded&#39;,<br>    timeout: 60000, // 60 saniye<br>  });<br><br>  const cookieAccept = page.locator(&#39;[data-name=&quot;Accept Button&quot;]&#39;);<br><br>  if (await cookieAccept.isVisible()) {<br>    await cookieAccept.click();<br>    await page.waitForTimeout(3000);<br>  }<br><br>  <br>  //await expect(page).toHaveTitle(/Example Domain/);<br><br>  // Percy snapshot al<br>  await percySnapshot(page, &#39;Example.com Ekran Görüntüsü&#39;);<br>});</pre><p>We are running our project.</p><pre>npx percy exec -- npx playwright test tests/visual.test.js</pre><p>When we first run the project, our first build will appear in the Builds tab in the Percy interface. Since there is no other image to compare it to, the screen will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9iRifJARlHqJvOZw5cEOVw.png" /></figure><p>We don’t have any comparison data yet. I just approved our SS.</p><p>I’m running the project again now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2a9by6_s4Ur28_Fuxd4TGA.png" /></figure><p>In the last run of the results, there was no visual change on the site, so 0% diff was seen and the Percy build detail screen appeared as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A7ji08AVRYZmaFEa3Ums9w.png" /></figure><p>If there were any changes, Percy would show us this: with the diff ratio and highlighting the changed areas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3h-Di01PBLtlmMduBgS62g.png" /></figure><p>If this change is a known change, you can ignore it with the “Approve Build” button.</p><p>I hope this practical example gave you a general idea. And remember that,</p><p>“Visual regression testing isn’t just about finding bugs — it’s about <strong>protecting the user experience</strong>. By automating this process with tools like Percy, teams can reduce manual testing costs, detect visual issues early, and ship confidently.A stable, functional UI <strong>must also look right</strong> — every time. With the right tool, that becomes scalable and automated.”</p><p>Hope to see you in the next article :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bb7eca5e014" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smarter Risk-Based Testing with Smartlook]]></title>
            <link>https://medium.com/@kubrasonmez9292/smarter-risk-based-testing-with-smartlook-6b5a0c48ee97?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b5a0c48ee97</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Wed, 09 Apr 2025 12:17:25 GMT</pubDate>
            <atom:updated>2025-04-11T08:25:59.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xJE6rCSq7kefHL1M" /></figure><h4>Let Your Users Guide Your Tests! :)</h4><p>Are your users clicking where you expect? Which areas of your site go completely unnoticed? Do the bugs happen where you think they do?</p><p>Traditional testing often can’t answer these questions clearly. This is where <strong>Smartlook</strong> comes in — giving testers real user behavior insights to make testing smarter and more effective.</p><h3>What is Smartlook?</h3><p><strong>Smartlook</strong> is a user behavior analytics tool for web and mobile applications. It helps you see exactly how users interact with your app:</p><ul><li><strong>Session replays</strong> (watch user journeys like a video)</li><li><strong>Click and scroll heatmaps</strong></li><li><strong>Event tracking</strong> (e.g., button clicks, form interactions)</li><li><strong>Funnels</strong> (analyze step-by-step drop-offs)</li></ul><p>These insights help QA engineers not only understand what’s broken — but <strong>why</strong> it’s breaking.</p><h3>What is Risk-Based Testing?</h3><p><strong>Risk-Based Testing (RBT)</strong> is a strategy where you prioritize and test <strong>the most critical and risky areas</strong> of your application first.</p><p>In other words: don’t try to test everything — focus where things are <strong>most likely to fail</strong> and <strong>matter the most</strong>.</p><h3>Why Smartlook + Risk-Based Testing = A Perfect Match</h3><h3>1. Identify Risky Areas With Real Data</h3><p>Smartlook shows you:</p><ul><li>Which pages users spend most time on</li><li>Where they drop off</li><li>Where they click (and don’t click)</li></ul><p>👉 Example: 60% of users drop off at the checkout form<br> → This is clearly a <strong>high-risk zone</strong> for testing.</p><h3>2. Prioritize What to Test</h3><p>Smartlook helps turn usage patterns into test priorities:</p><p>Smartlook InsightWhat It Tells YouWhat to TestUsers don’t scroll past 50% of formUI issue or bad layout<strong>Responsive design test</strong>Button is visible but never clickedLow visibility or label issue<strong>A/B test or UI audit</strong>Users click “submit” but nothing happensValidation or backend issue<strong>Form + API test</strong></p><h3>3. Use Heatmaps to Uncover UI Risks</h3><p>Click and scroll heatmaps reveal:</p><ul><li>Which buttons or sections are ignored</li><li>Which parts get attention</li><li>What’s below the average fold</li></ul><p>This can guide tests like:</p><ul><li><strong>CTA visibility testing</strong></li><li><strong>Layout and responsive checks</strong></li><li><strong>Dead zones detection</strong></li></ul><p><strong>Let’s try something! :)</strong></p><p>First, go to <a href="https://app.smartlook.com/org">https://app.smartlook.com/org</a> and create a user.</p><p>When you create a user and log in, you will be asked to choose the application type. I chose Web because I will be testing on my website.</p><p>Then you will be directed to the Dashboard page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*WfCfmuBXwfPPuie9BieJGg.png" /></figure><p>The id I have drawn is your project API Key and this code block will allow your code to be tracked by Smartlook.</p><p>Now let’s create a web project and add this code block to our code.</p><pre>&lt;!-- Ana Sayfa - index.html --&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;tr&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;Demo Shop - Ana Sayfa&lt;/title&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; margin: 0; padding: 0; }<br>    header { background-color: #222; color: #fff; padding: 1rem; text-align: center; }<br>    .product-list { display: flex; flex-wrap: wrap; justify-content: center; padding: 2rem; gap: 2rem; }<br>    .card { width: 200px; border: 1px solid #ccc; border-radius: 8px; padding: 1rem; text-align: center; box-shadow: 0 0 5px rgba(0,0,0,0.1); }<br>    .card img { width: 100%; height: auto; border-radius: 4px; }<br>    .card a { display: inline-block; margin-top: 1rem; background: #007bff; color: white; padding: 0.5rem 1rem; text-decoration: none; border-radius: 4px; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;header&gt;<br>    &lt;h1&gt;Demo Shop&lt;/h1&gt;<br>  &lt;/header&gt;<br>  &lt;section class=&quot;product-list&quot;&gt;<br>    &lt;div class=&quot;card&quot;&gt;<br>      &lt;img src=&quot;https://via.placeholder.com/200x150&quot; alt=&quot;Ürün 1&quot;&gt;<br>      &lt;h3&gt;Ürün 1&lt;/h3&gt;<br>      &lt;p&gt;₺99,00&lt;/p&gt;<br>      &lt;a href=&quot;product.html&quot;&gt;İncele&lt;/a&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;card&quot;&gt;<br>      &lt;img src=&quot;https://via.placeholder.com/200x150&quot; alt=&quot;Ürün 2&quot;&gt;<br>      &lt;h3&gt;Ürün 2&lt;/h3&gt;<br>      &lt;p&gt;₺149,00&lt;/p&gt;<br>      &lt;a href=&quot;product.html&quot;&gt;İncele&lt;/a&gt;<br>    &lt;/div&gt;<br>  &lt;/section&gt;<br><br>&lt;!-- Smartlook code begins --&gt;<br><br>  &lt;script type=&quot;text/javascript&quot;&gt;<br>    window.smartlook||(function(d) {<br>      var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName(&#39;head&#39;)[0];<br>      var c=d.createElement(&#39;script&#39;);o.api=new Array();c.async=true;c.type=&#39;text/javascript&#39;;<br>      c.charset=&#39;utf-8&#39;;c.src=&#39;https://web-sdk.smartlook.com/recorder.js&#39;;h.appendChild(c);<br>    })(document);<br>    smartlook(&#39;init&#39;, &#39;YOUR_PROJECT_KEY&#39;);<br>  &lt;/script&gt;<br><br>&lt;!-- Smartlook code ends --&gt;<br><br><br>&lt;/body&gt;<br>&lt;/html&gt;<br><br>&lt;!-- Ürün Sayfası - product.html --&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;tr&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;Demo Shop - Ürün&lt;/title&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; padding: 2rem; }<br>    .product { max-width: 600px; margin: auto; }<br>    img { width: 100%; height: auto; border-radius: 4px; }<br>    button { background: green; color: white; padding: 1rem 2rem; border: none; border-radius: 4px; font-size: 1rem; margin-top: 1rem; cursor: pointer; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;product&quot;&gt;<br>    &lt;h1&gt;Ürün 1&lt;/h1&gt;<br>    &lt;img src=&quot;https://via.placeholder.com/600x400&quot; alt=&quot;Ürün&quot;&gt;<br>    &lt;p&gt;Bu demo ürün açıklamasıdır. Smartlook izleme için bu sayfada tıklamalar kaydedilir.&lt;/p&gt;<br>    &lt;button onclick=&quot;window.location.href=&#39;cart.html&#39;&quot;&gt;Sepete Ekle&lt;/button&gt;<br>  &lt;/div&gt;<br><br>  &lt;script type=&quot;text/javascript&quot;&gt;<br>    window.smartlook||(function(d) {<br>      var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName(&#39;head&#39;)[0];<br>      var c=d.createElement(&#39;script&#39;);o.api=new Array();c.async=true;c.type=&#39;text/javascript&#39;;<br>      c.charset=&#39;utf-8&#39;;c.src=&#39;https://web-sdk.smartlook.com/recorder.js&#39;;h.appendChild(c);<br>    })(document);<br>    smartlook(&#39;init&#39;, &#39;YOUR_PROJECT_KEY&#39;);<br>  &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><br>&lt;!-- Sepet Sayfası - cart.html --&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;tr&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;Demo Shop - Sepet&lt;/title&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; padding: 2rem; }<br>    .cart { max-width: 600px; margin: auto; }<br>    button { background: orange; color: white; padding: 1rem 2rem; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;cart&quot;&gt;<br>    &lt;h1&gt;Sepet&lt;/h1&gt;<br>    &lt;p&gt;1 x Ürün 1 - ₺99,00&lt;/p&gt;<br>    &lt;button onclick=&quot;window.location.href=&#39;checkout.html&#39;&quot;&gt;Siparişi Tamamla&lt;/button&gt;<br>  &lt;/div&gt;<br><br>  &lt;script type=&quot;text/javascript&quot;&gt;<br>    window.smartlook||(function(d) {<br>      var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName(&#39;head&#39;)[0];<br>      var c=d.createElement(&#39;script&#39;);o.api=new Array();c.async=true;c.type=&#39;text/javascript&#39;;<br>      c.charset=&#39;utf-8&#39;;c.src=&#39;https://web-sdk.smartlook.com/recorder.js&#39;;h.appendChild(c);<br>    })(document);<br>    smartlook(&#39;init&#39;, &#39;YOUR_PROJECT_KEY&#39;);<br>  &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><br>&lt;!-- Sipariş Sayfası - checkout.html --&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;tr&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;Demo Shop - Sipariş&lt;/title&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; padding: 2rem; }<br>    form { max-width: 400px; margin: auto; display: flex; flex-direction: column; gap: 1rem; }<br>    input, button { padding: 1rem; font-size: 1rem; border-radius: 4px; border: 1px solid #ccc; }<br>    button { background: purple; color: white; border: none; cursor: pointer; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt;Sipariş Formu&lt;/h1&gt;<br>  &lt;form onsubmit=&quot;event.preventDefault(); window.location.href=&#39;thanks.html&#39;&quot;&gt;<br>    &lt;input type=&quot;text&quot; placeholder=&quot;Ad Soyad&quot; required&gt;<br>    &lt;input type=&quot;text&quot; placeholder=&quot;Adres&quot; required&gt;<br>    &lt;input type=&quot;email&quot; placeholder=&quot;E-posta&quot; required&gt;<br>    &lt;button type=&quot;submit&quot;&gt;Gönder&lt;/button&gt;<br>  &lt;/form&gt;<br><br>  &lt;script type=&quot;text/javascript&quot;&gt;<br>    window.smartlook||(function(d) {<br>      var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName(&#39;head&#39;)[0];<br>      var c=d.createElement(&#39;script&#39;);o.api=new Array();c.async=true;c.type=&#39;text/javascript&#39;;<br>      c.charset=&#39;utf-8&#39;;c.src=&#39;https://web-sdk.smartlook.com/recorder.js&#39;;h.appendChild(c);<br>    })(document);<br>    smartlook(&#39;init&#39;, &#39;YOUR_PROJECT_KEY&#39;);<br>  &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><br>&lt;!-- Teşekkür Sayfası - thanks.html --&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;tr&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;Demo Shop - Teşekkürler&lt;/title&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; padding: 2rem; text-align: center; }<br>    a { color: #007bff; text-decoration: none; margin-top: 2rem; display: inline-block; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt;Teşekkürler!&lt;/h1&gt;<br>  &lt;p&gt;Siparişiniz alınmıştır. Sizi tekrar bekleriz 😊&lt;/p&gt;<br>  &lt;a href=&quot;index.html&quot;&gt;Ana Sayfaya Dön&lt;/a&gt;<br><br>  &lt;script type=&quot;text/javascript&quot;&gt;<br>    window.smartlook||(function(d) {<br>      var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName(&#39;head&#39;)[0];<br>      var c=d.createElement(&#39;script&#39;);o.api=new Array();c.async=true;c.type=&#39;text/javascript&#39;;<br>      c.charset=&#39;utf-8&#39;;c.src=&#39;https://web-sdk.smartlook.com/recorder.js&#39;;h.appendChild(c);<br>    })(document);<br>    smartlook(&#39;init&#39;, &#39;YOUR_PROJECT_KEY&#39;);<br>  &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>I leave the entire project on github, you can download it from here.( <a href="https://github.com/kssonmezz/smartlook_demo">https://github.com/kssonmezz/smartlook_demo</a>)</p><p>My site that I published on Github is now ready :) <a href="https://kssonmezz.github.io/smartlook_demo/">https://kssonmezz.github.io/smartlook_demo/</a></p><p>Now I can monitor my project via Smartlook and prioritize my test cases according to user behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6tauMUHiPEkbxDTvWdCmnw.png" /></figure><p>You can see the logins to your site from the Session menu. When you press the Play button, you can watch the recorded version of user activities.</p><p>You can also see the activities on your site with graphs and charts from the Dashboard area. Here are some useful ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5HVUihIcSRFD9FFQRdmHcQ.png" /></figure><p>The Heatmap area shows the areas where users reacted in color. However, it is worth remembering that your site must be visited at least 30 times in different sessions for a Heatmap to be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6artHHRc1ZJTnm8DWq7c7Q.png" /></figure><p>When you interpret it according to the available data, it seems like it would be good if I gave high priority to the first product click function on the home page :)</p><p>As a conclusion; Smartlook isn’t just a UX tool — it’s a <strong>QA and testing ally</strong>. By combining user analytics with risk-based test planning, you can <strong>reduce testing blind spots</strong> and focus on what truly matters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b5a0c48ee97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unmasking Bugs: The Untold Psychology Behind Software Testing]]></title>
            <link>https://medium.com/@kubrasonmez9292/unmasking-bugs-the-untold-psychology-behind-software-testing-0815c423767e?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/0815c423767e</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Thu, 28 Nov 2024 10:11:48 GMT</pubDate>
            <atom:updated>2024-11-28T10:11:48.473Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi folks!<br>I’ve been reading a lot of psychological books these days and I’ve become obsessed with developing this side of mine :)<br>I can’t help but think. So what should a test engineer’s psychological approach to her/his job be like? Here you go…</p><h4>Introduction: The Hidden Side of Testing</h4><p>Software testing is often associated with technical precision, automation tools, and structured methodologies. However, there’s an underappreciated dimension to testing — the psychology behind it. The journey of discovering bugs is not just about technical expertise; it’s about thinking critically, empathizing with users, and adopting a detective’s mindset.</p><p>In this article, we’ll explore the psychological nuances that define a tester’s craft and how combining art with science can elevate the bug-hunting process to new heights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*0CO2i3I2tgyJgOH53ygp2w.png" /></figure><h4>1. The Tester’s Mind: Thinking Beyond the Code</h4><p>A good tester does not merely validate functionality; they challenge assumptions. They ask the unconventional questions and think beyond the intended use cases of a product.</p><p><strong>The Essential Traits of a Tester:</strong></p><ul><li><strong>Skepticism:</strong> Instead of asking, “Does this feature work?” they probe deeper: “Under what circumstances could this fail?”</li><li><strong>Empathy:</strong> They step into the user’s shoes, understanding that the “intuitive design” for a developer might confuse an end user.</li><li><strong>Persistence:</strong> If one path doesn’t uncover issues, they explore others, refusing to accept surface-level assurances.</li></ul><p><strong>Example:</strong><br>Imagine a music streaming app. A creative tester might ask:</p><ul><li>“What happens if I rapidly skip songs 100 times in a row?”</li><li>“How does the app behave if my internet speed fluctuates every second?”</li></ul><p>Such questions uncover flaws that standard tests might overlook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*e9LCN85Jn1ZWBdkvQG2JsA.png" /></figure><h4>2. The Role of Psychology in Real-World Scenarios</h4><p>Users are unpredictable. They interact with software in ways developers often don’t anticipate. A tester must predict and replicate these behaviors.</p><p><strong>Unpredictable User Patterns:</strong></p><ul><li>A user might repeatedly press a button thinking it’s unresponsive.</li><li>Someone might try logging in with an empty password field or a long string of emojis.</li><li>A child might tap on random areas of the screen to see what happens.</li></ul><p><strong>Example in Practice:</strong><br>A tester working on a mobile payment app once discovered a flaw where entering invalid card details froze the app. Why? Because they tested with randomly generated numbers that the developers hadn’t anticipated.</p><h4>3. Psychological Pitfalls in Testing</h4><p>Testers themselves are not immune to cognitive biases. Recognizing and overcoming these biases can make the difference between a missed bug and a successful launch.</p><ul><li><strong>Assumption Bias:</strong><br>Believing a feature works because “it always has” leads to blind spots.<br><strong>Solution:</strong> Treat every test as if it’s the first time you’re testing that feature.</li><li><strong>Tunnel Vision:</strong><br>Focusing only on critical paths may ignore edge cases.<br><strong>Solution:</strong> Create exploratory sessions where you intentionally deviate from predefined test cases.</li><li><strong>Routine Fatigue:</strong><br>Repeatedly testing the same scenarios can dull creativity.<br><strong>Solution:</strong> Rotate test areas among team members or take breaks to refresh your perspective.</li></ul><h4>4. Testing Is a Game of Risk and Reward</h4><p>Effective testers understand that they can’t test everything, so they focus on high-risk areas first.</p><p><strong>Risk-Based Testing:</strong></p><ul><li>Prioritize functionalities that, if broken, would cause the most damage (e.g., payment gateways in e-commerce).</li><li>Use data to identify areas users interact with most frequently or report the most issues.</li></ul><p><strong>Visualizing Risk:</strong><br>One tester created a “bug heat map,” identifying the modules with the highest failure rates. This visual approach allowed the team to focus their efforts and reduce post-release defects significantly.</p><h4>5. Creativity in Testing: Breaking the Norms</h4><p>Testing isn’t just a science — it’s an art that thrives on creativity. Sometimes, the most unconventional ideas uncover the most critical bugs.</p><p><strong>An Unorthodox Example:</strong><br>While testing a gaming app, a tester decided to hold down every button simultaneously while rapidly shaking the device. This bizarre action revealed a memory leak that caused the app to crash.</p><p>Such creative approaches highlight the importance of thinking outside the box.</p><h4>6. A Tester’s Superpower: Storytelling</h4><p>Communicating bugs effectively is as important as finding them. A good bug report doesn’t just describe what went wrong; it tells the story of why it matters.</p><p><strong>Crafting a Narrative:</strong><br>Instead of saying, “The login button doesn’t work,” explain:</p><ul><li><strong>What:</strong> “The login button fails to respond after multiple clicks.”</li><li><strong>Impact:</strong> “This could frustrate users and lead to drop-offs during account creation.”</li><li><strong>Reproduction:</strong> “Steps to replicate include rapidly clicking the button on a slow connection.”</li></ul><p>Storytelling ensures that bugs are taken seriously and resolved promptly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*AA9nzNAUuuC1XUba_wUVGw.png" /></figure><h4>Conclusion: The Human Element in Testing</h4><p>The best testers bring more than technical skills to the table. They combine curiosity, empathy, creativity, and a scientific mindset to uncover issues that others miss. In a world increasingly driven by automation, the human element remains irreplaceable.</p><p><strong>Your Turn:</strong> What unconventional strategies will you try in your next testing session? Remember, every bug is a story waiting to be uncovered — make it a good one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0815c423767e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mocking with WireMock: A Comprehensive Guide]]></title>
            <link>https://medium.com/@kubrasonmez9292/mocking-with-wiremock-a-comprehensive-guide-78634b5e6a50?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/78634b5e6a50</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Wed, 24 Jul 2024 09:53:01 GMT</pubDate>
            <atom:updated>2024-07-24T09:53:01.720Z</atom:updated>
            <content:encoded><![CDATA[<p>Greetings, today I am here with a topic that I think may be useful :)</p><p>Mocking is a crucial aspect of modern software development, especially when dealing with complex systems and integrations. One powerful tool that simplifies this process is WireMock. In this article, we’ll dive into how WireMock can help you efficiently simulate and test your APIs.</p><h3>What is WireMock?</h3><p>WireMock is a flexible and powerful library used to mock HTTP services. It allows you to create a stub server that mimics the behavior of a real HTTP service, which is essential for testing and development purposes. By using WireMock, developers can simulate various server responses without the need to rely on actual external services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*OcUnw4lJahuj0c9ey8uKug.png" /></figure><p>Key Features:</p><ul><li>HTTP response stubbing, matchable on URL, header and body content patterns</li><li>Request verification</li><li>Runs in unit tests, as a standalone process or as a WAR app</li><li>Record/playback of stubs</li><li>Configurable response delays and Fault injection</li><li>Per-request conditional proxying</li><li>Browser proxying for request inspection and replacement</li><li>Stateful behaviour simulation</li></ul><p>All the features are configurable via a fluent Java API and JSON files, or via JSON over HTTP for the standalone service.</p><p>Let’s leave the encyclopedic information aside and make an example. To get started with WireMock, you first need to set up your environment. This includes adding WireMock as a dependency and configuring it for your project. Here’s a step-by-step guide to setting up WireMock in a Java project:</p><p>Create a Java Maven project and,</p><p><strong>1- Add WireMock Dependency</strong></p><pre>&lt;dependency&gt;<br>            &lt;groupId&gt;org.wiremock&lt;/groupId&gt;<br>            &lt;artifactId&gt;wiremock&lt;/artifactId&gt;<br>            &lt;version&gt;3.3.1&lt;/version&gt;<br>            &lt;scope&gt;test&lt;/scope&gt;<br>        &lt;/dependency&gt;</pre><p><strong>2- Add OKHTTP Dependency (</strong>This library will allow us to send requests to our mock API.)</p><pre>    &lt;dependency&gt;<br>            &lt;groupId&gt;com.squareup.okhttp3&lt;/groupId&gt;<br>            &lt;artifactId&gt;okhttp&lt;/artifactId&gt;<br>            &lt;version&gt;4.12.0&lt;/version&gt;<br>        &lt;/dependency&gt;</pre><p><strong>3- Add Junit Dependency (We will write our tests bu using Junit)</strong></p><pre>&lt;dependency&gt;<br>            &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;<br>            &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;<br>            &lt;version&gt;5.10.2&lt;/version&gt;<br>            &lt;scope&gt;test&lt;/scope&gt;<br>        &lt;/dependency&gt;</pre><p>We create a class named wireMockTest and,</p><p><strong>4- </strong>Configure WireMock</p><pre> WireMockServer wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().port(8080));<br> wireMockServer.start();</pre><p><strong>5- </strong>Creating Stubs and Mocks</p><p>Once WireMock is up and running, you can start creating stubs for your API endpoints. This allows you to define how WireMock should respond to various HTTP requests.</p><pre> private void configurestubFor() {<br>        configureFor(&quot;localhost&quot;, 8080);<br>        stubFor(get(urlEqualTo(&quot;/getAllUsers&quot;))<br>                .willReturn(aResponse()<br>                        .withHeader(&quot;Content-Type&quot;, &quot;text/plain&quot;)<br>                        .withBody(&quot;{ \&quot;id\&quot;: 1,\n&quot; +<br>                                &quot;      \&quot;firstName\&quot;: \&quot;Emily\&quot;,\n&quot; +<br>                                &quot;      \&quot;lastName\&quot;: \&quot;Johnson\&quot;,\n&quot; + &quot;}&quot;)));<br><br>    }</pre><p>In the code above, we mapped a mock API named <a href="http://localhost:8080/getAllUsers">http://localhost:8080/getAllUsers</a>. This api accepts the get method and when called,</p><pre>{ &quot;id&quot;: 1,<br>      &quot;firstName&quot;: &quot;Emily&quot;,<br>      &quot;lastName&quot;: &quot;Johnson&quot;,<br>}</pre><p>response body is returning.<br>If we call this mock API from postmande, we can see it more clearly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmKlEDNWMHF2TfgIxSxB0Q.png" /></figure><p>Let’s also map a new API. Let’s say this is a post API, let’s send the firstname and last name fields in the request body. When we call the API, the result should be 201 (created).</p><pre>private void configurestubForPost() {<br>        configureFor(&quot;localhost&quot;, 8080);<br>        stubFor(post(urlEqualTo(&quot;/createUser&quot;))<br>                .withRequestBody(matchingJsonPath(&quot;$.firstName&quot;, matching(&quot;.*&quot;)))<br>                .withRequestBody(matchingJsonPath(&quot;$.lastName&quot;, matching(&quot;.*&quot;)))<br>                .withRequestBody(notMatching(&quot;$.extraField&quot;)) // Ekstra alanlara izin verilmez<br>                .willReturn(created()<br>                .withBody(&quot;User Created&quot;)<br>                .withHeader(&quot;content-type&quot;,&quot;application/plain&quot;)));<br><br><br>    }</pre><p>When we call this mock api in Postman, we will see this result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CpFPke6hAVCBgCBfjTnemQ.png" /></figure><p>WithRequestBody(notMatching(“$.extraField”)) we ensure that the request is made to our mock api with correct modeling. So if we added an extra field and made our request that way we will get 404 error.</p><p><strong>6- Testing with WireMock</strong></p><p>Testing with WireMock is straightforward. You can use it to simulate various scenarios and test how your application handles them. Here’s an example of how you can test a mocked endpoint using JUnit:</p><pre>  @Test<br>  public void wiremock_ruler_test() throws IOException {<br><br>        //create a get request<br>        Request request = new Request<br>                .Builder()<br>                .url(https://medium.com/&quot;http://localhost:8080/getAllUsers&quot;)<br>                .method(&quot;GET&quot;,null)<br>                .build();<br>        Response response= client.newCall(request).execute();<br><br>        //Assert this request&#39; response<br>        Assertions.assertEquals(200, response.code());<br>        ResponseBody responseBody = response.body();<br>        String responseBodyString = responseBody != null ? responseBody.string() : null;<br>        Assertions.assertEquals(&quot;{ \&quot;id\&quot;: 1,\n&quot; +<br>                &quot;      \&quot;firstName\&quot;: \&quot;Emily\&quot;,\n&quot; +<br>                &quot;      \&quot;lastName\&quot;: \&quot;Johnson\&quot;,\n&quot; + &quot;}&quot;, responseBodyString);<br><br>        //set the body used for post request<br>        MediaType JSON = MediaType.get(&quot;application/json; charset=utf-8&quot;);<br>        String json = &quot;{ \&quot;firstName\&quot;: \&quot;,Kubra\&quot;, \&quot;lastName\&quot;: \&quot;Sonmez\&quot; }&quot;;<br>        RequestBody body = RequestBody.create(json, JSON);<br><br>        //create a test post request<br>        Request request2 = new Request<br>                .Builder()<br>                .url(https://medium.com/&quot;http://localhost:8080/createUser&quot;)<br>                .method(&quot;POST&quot;,body)<br>                .build();<br>        Response response2= client.newCall(request2).execute();<br><br>        //Assert this request&#39; response<br>        System.out.println(response2.body());<br>        Assertions.assertEquals(201, response2.code());<br><br><br>    }</pre><p>You can see all code above.</p><pre>Request request = new Request<br>                .Builder()<br>                .url(https://medium.com/&quot;http://localhost:8080/getAllUsers&quot;)<br>                .method(&quot;GET&quot;,null)<br>                .build();<br>        Response response= client.newCall(request).execute();</pre><p>We create a sample get api request with this part. And set response field this response.</p><pre>//Assert this request&#39; response<br>        Assertions.assertEquals(200, response.code());<br>        ResponseBody responseBody = response.body();<br>        String responseBodyString = responseBody != null ? responseBody.string() : null;<br>        Assertions.assertEquals(&quot;{ \&quot;id\&quot;: 1,\n&quot; +<br>                &quot;      \&quot;firstName\&quot;: \&quot;Emily\&quot;,\n&quot; +<br>                &quot;      \&quot;lastName\&quot;: \&quot;Johnson\&quot;,\n&quot; + &quot;}&quot;, responseBodyString);</pre><p>And assert this response code and response body equals with our mapped.</p><p>Yes, in this way, you can create your own mock APIs and write tests for the validation of these APIs. :)</p><p><strong>If you don’t want to write code</strong>, wiremock offers other options. You can use the record feature or postman your mapping.</p><ul><li>Download the Wiremock <strong>server jar file</strong> for this.<br><a href="https://wiremock.org/docs/download-and-installation/"><strong>https://wiremock.org/docs/download-and-installation/</strong></a></li><li>Start the server from your computer’s terminal<br><strong>java -jar wiremock-standalone-3.9.0.jar</strong></li><li>Make a POST request by specifying the request and response structure of the mock API in the body, which you will map to <a href="http://localhost:8080/__admin/mappings"><strong>http://localhost:8080/__admin/mappings</strong></a><strong> </strong>in Postman. The content type in the header will be application/json.<br>When you call the request, your API will be created with a uuid.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atYXsbo3kCbEj0PbQEgcdw.png" /></figure><p>Now you can use get/user/1 mock api for your tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*og5CqGp7fZ_cWSPm8dUqkg.png" /></figure><p>That’s all for this article :) I hope it was useful. You can access the entire code from the github link below. Please reach me for any question.</p><p>Have a nice day!</p><p><a href="https://github.com/kssonmezz/mockApiTestwithWiremock">https://github.com/kssonmezz/mockApiTestwithWiremock</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78634b5e6a50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing GraphQL Endpoints with Rest Assured]]></title>
            <link>https://medium.com/@kubrasonmez9292/testing-graphql-endpoints-with-rest-assured-9a97a19cf6d7?source=rss-b22c62acada0------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a97a19cf6d7</guid>
            <dc:creator><![CDATA[Kübra Sönmez]]></dc:creator>
            <pubDate>Thu, 11 Jan 2024 14:04:58 GMT</pubDate>
            <atom:updated>2024-01-11T14:04:58.694Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey folks! I know I’ve gone a bit further, but I hope to make up for it by coming back with a very useful topic :)</p><p>I think there is no one in the testing industry who hasn’t heard of API automation. So how do we use test automation in Graphql endpoints?</p><p>Let’s start.</p><h3>What is GraphQL and Why?</h3><p>GraphQL is a query language for APIs and a runtime for executing those queries. It developed by Facebook in 2012 and publicly released in 2015. It allows clients to request only the data they need and enables a more efficient and flexible way to interact with APIs compared to traditional REST APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*UE2jSidDHjS9QgEXVzZl_A.png" /></figure><p>The logic of its operation is simply as follows:</p><p>Clients fetch data from GraphQL server using GraphQL Query. GraphQL fetches this data from databases, legacy systems or rest apis by using GraphQL queries.</p><p>Developers find GraphQL advantageous because it allows them to fetch only the necessary data, reducing network overhead and improving performance. It also empowers front-end developers by giving them control over the data they receive, allowing for easier iteration on user interfaces and reducing dependencies on backend changes.</p><p>Overall, GraphQL has gained popularity for its flexibility, efficiency, and ability to address some of the challenges present in traditional RESTful API architectures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*0bVQ74yMpa9eSPRyTQdRnw.png" /></figure><p>Now that we have basic knowledge about GraphQL, let’s examine some examples and start slowly moving on to the coding part. You can visit <a href="https://graphql.org/learn/">https://graphql.org/learn/</a> to learn more details.</p><pre>query ExampleQuery($personId: ID) {<br> <br>  person(id: $personId) {<br>    name<br>    gender<br>    height<br>  }<br>}<br>-----------------------------------------------------------<br>Variables<br>{<br>  &quot;personId&quot;: &quot;cGVvcGxlOjE=&quot;<br>}</pre><p><strong>name </strong>, <strong>gender </strong>and<strong> height</strong> are the <strong>fields</strong> we want to return as a result of our query. In this query, our values will be returned as string type. However, do not forget that we can also shoot an object in this area.</p><p>You see that the personId field is also called with a <strong>variable</strong>. Please note that in order to use the external variable in the query, it must be preceded by a “<strong>$</strong>”.</p><p>The <strong>operation type</strong> is either query, mutation, or subscription and describes what type of operation you’re intending to do. We can see a query operation type for this example. And query type provides to get data. And mutation type provides to update the data.</p><p>ExampleQuery is the <strong>operation name</strong>.The operation name is a meaningful and explicit name for your operation. It is only required in multi-operation documents, but its use is encouraged because it is very helpful for debugging and server-side logging.</p><p>As an example, I used the public Starwars API and Apollographql’s server explorer link. Server Explorer Link can be thought of as Graphql’s interface. The link is below so that your cat can enter and try it out.</p><p><a href="https://studio.apollographql.com/public/star-wars-swapi/variant/current/explorer">Star Wars&#39;s Graph | GraphOS Studio</a></p><p>When you run from the Explorer link, you can see the response code and response data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*pCS1v9ddrDCk7gyfgcLp_w.png" /></figure><p>In summary, this query basically returns the name, gender and length of people whose personId value is cGVvcGxlOjE.</p><p>If we get to know GraphQL simply, let’s talk about automating it with Rest-Assured.<br>My project is to get the PeopleType in the StarWars API, get the first personid, query the Person Type with this id as above, and check whether the name field is Luke Skywalker. Because we love :) <br>If it is Luke Skywalker, it means our test will be successful.<br>Some of the codes I wrote may seem unnecessarily long to you. I tried to implement as many API test automation practices as possible.</p><p>First of all, make sure that Java is installed on your computer. Create a Maven project and add the necessary libraries to the dependencies field of the pom.xml file. I used the TestNG library for my test run.</p><pre> &lt;dependencies&gt;<br>        &lt;!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured --&gt;<br>        &lt;dependency&gt;<br>            &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;<br>            &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;<br>            &lt;version&gt;5.3.2&lt;/version&gt;<br>            &lt;scope&gt;test&lt;/scope&gt;<br>        &lt;/dependency&gt;<br>        &lt;!-- https://mvnrepository.com/artifact/org.testng/testng --&gt;<br>        &lt;dependency&gt;<br>            &lt;groupId&gt;org.testng&lt;/groupId&gt;<br>            &lt;artifactId&gt;testng&lt;/artifactId&gt;<br>            &lt;version&gt;7.9.0&lt;/version&gt;<br>            &lt;scope&gt;test&lt;/scope&gt;<br>        &lt;/dependency&gt;<br><br>        &lt;!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest --&gt;<br>        &lt;dependency&gt;<br>            &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;<br>            &lt;artifactId&gt;hamcrest&lt;/artifactId&gt;<br>            &lt;version&gt;2.2&lt;/version&gt;<br>            &lt;scope&gt;test&lt;/scope&gt;<br>        &lt;/dependency&gt;<br>        &lt;!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --&gt;<br>        &lt;dependency&gt;<br>            &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;<br>            &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;<br>            &lt;version&gt;2.16.0&lt;/version&gt;<br>        &lt;/dependency&gt;<br>    &lt;/dependencies&gt;</pre><p>To make it easier to read and maintain the code, I created 2 packages named models and tests under the test-java folder.<br>In Models, there will be modeling of my Request Payload and Response Bodies. I will serialize and de-serialize my payload and bodies according to these models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*IQNHwtFPQtlYFpsq80FsFg.png" /></figure><p>First, we said we would get the allpeople type. I want to use the name and id fields. In this case, my query will be as follows.</p><pre>query ExampleQuery {<br>  allPeople {<br>    people {<br>      id<br>      name<br>    }<br>  }<br>}</pre><p>When we run this query, I access my payload from the network tab.</p><p>{“query”:”query ExampleQuery {\n allPeople {\n people {\n id\n name\n }\n }\n}\n”,”variables”:{},”operationName”:”ExampleQuery”}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wA-91yaRGaSWW0mmBiVgfQ.png" /></figure><p>According to this payload, I think the fields I will use in my model class will be query, variables and operationName. Let’s not forget that the properties in my class must be the same as those in my API. If you have difficulty finding such fields in the API, you can use json beautifier.</p><p>In this case my payloadBodyModel is;</p><pre>    String query;<br>    Map&lt;String,String&gt; variables;<br>    String operationName;<br><br>    public Map&lt;String, String&gt; getVariables() {<br>        return variables;<br>    }<br><br>    public void setVariables(Map&lt;String, String&gt; variables) {<br>        this.variables = variables;<br>    }<br><br>    public String getQuery() {<br>        return query;<br>    }<br><br>    public void setQuery(String query) {<br>        this.query = query;<br>    }<br><br><br>    public String getOperationName() {<br>        return operationName;<br>    }<br><br>    public void setOperationName(String operationName) {<br>        this.operationName = operationName;<br>    }</pre><p>I want to keep the response from my query in a java class. My response is here.</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;allPeople&quot;: {<br>      &quot;people&quot;: [<br>        {<br>          &quot;id&quot;: &quot;cGVvcGxlOjE=&quot;,<br>          &quot;name&quot;: &quot;Luke Skywalker&quot;<br>        },<br>        {<br>          &quot;id&quot;: &quot;cGVvcGxlOjI=&quot;,<br>          &quot;name&quot;: &quot;C-3PO&quot;<br>        },<br>        .<br>        .<br>        .<br>        {<br>          &quot;id&quot;: &quot;cGVvcGxlOjgz&quot;,<br>          &quot;name&quot;: &quot;Tion Medon&quot;<br>        }<br>      ]<br>    }<br>  }<br>}</pre><p>I will take the result of this query and objectify it in another java class.</p><p>As seen in my response, there are multiple objects inside each other. And inside, the people object is located in an array. This will be a bit challenging.</p><p>data&gt; allpeople&gt; people</p><pre>package models;<br><br>public class people {<br>    String id;<br>    String name;<br><br>    public String getId() {<br>        return id;<br>    }<br><br>    public void setId(String id) {<br>        this.id = id;<br>    }<br><br>    public String getName() {<br>        return name;<br>    }<br><br>    public void setName(String name) {<br>        this.name = name;<br>    }<br>}</pre><pre>package models;<br>import java.util.List;<br><br>public class allPeople {<br>    public List&lt;people&gt; people;<br><br>    public List&lt;people&gt; getPeople() {<br>        return people;<br>    }<br><br>    public void setPeople(List&lt;people&gt; people) {<br>        this.people = people;<br>    }<br>}</pre><pre>package models;<br><br>public class data {<br>    public allPeople  allPeople;<br>    public allPeople getAllPeople() {<br>        return allPeople;<br>    }<br><br>    public void setAllPeople(models.allPeople allPeople) {<br>        this.allPeople = allPeople;<br>    }<br>    <br>}</pre><p>My final response model class is;</p><pre>package models;<br><br>public class allPeopleResponseModel {<br><br>    public data data;<br><br>    public data getData() {<br>        return data;<br>    }<br><br>    public void setData(models.data data) {<br>        this.data = data;<br>    }<br>}</pre><p>Now that my Payload and Response body classes are ready, I can start writing my test.<br>I specify common variables at the beginning of my test class. (Such as common base url and content type)</p><pre>RequestSpecification req  =new RequestSpecBuilder().setBaseUri(&quot;https://swapi-graphql.netlify.app&quot;)<br>        .setContentType(ContentType.JSON)<br>        .build();</pre><p>I create a new object from my payloadModel class and push the fields in my query to class properties. (Since there is no variable, I will send an empty value.) Thus, my payload is ready and I make a post call with this payload. Please note that all graphql queries will be made with the <strong>post</strong> method.<br>“/.netlify/functions/index” is my path parameter. And I assign this response result to my response object that I derived from my allPeopleResponseModel class.</p><pre>payloadBodyModel payload = new payloadBodyModel();<br>payload.setQuery(&quot;query ExampleQuery {\n \n  allPeople {\n    people {\n      id\n      name\n    }\n  }\n}\n&quot;);<br>Map&lt;String, String&gt; emptyMap =new HashMap&lt;&gt;();<br>payload.setVariables(emptyMap);<br>payload.setOperationName(&quot;ExampleQuery&quot;);<br><br>allPeopleResponseModel response =given().spec(req).body(payload)<br>        .when().post(&quot;/.netlify/functions/index&quot;)<br>        .then().extract().response().as(allPeopleResponseModel.class);</pre><p>The next thing to do is to convert the response that comes in model.obje type into string, bring the values next to the ids and get the first one.</p><pre>ObjectMapper objectMapper = new ObjectMapper();<br>String jsonString = objectMapper.writeValueAsString(response.getData());<br>System.out.println(&quot;JSON String: &quot; + jsonString);<br><br>Pattern pattern = Pattern.compile(&quot;\&quot;id\&quot;:\\s*\&quot;([^\&quot;]+)\&quot;&quot;);<br><br>Matcher matcher = pattern.matcher(jsonString);<br>List&lt;String&gt; ids = new ArrayList&lt;&gt;();<br><br>// Find values near the &quot;id&quot; attribute using regular expression matching<br>while (matcher.find()) {<br>   String idValue = matcher.group(1);<br>   ids.add(idValue);<br>}<br><br>return ids.get(0);</pre><p>I reached the id of my first person. And I will use the id in another query and see if the relevant person is Luke :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKZ9up2UgCQ_AP8lR5nzQQ.png" /></figure><p>{“query”:”query ExampleQuery($personId: ID) {\n \n person(id: $personId) {\n name\n }\n}\n\n”,”variables”:{“personId”:”cGVvcGxlOjE=”},”operationName”:”ExampleQuery”}</p><p>This time I have a variable. So, when creating the new payload, this time we do not send the variable part empty but set the id we received before.</p><pre>payloadBodyModel payload2 = new payloadBodyModel();<br>payload2.setQuery(&quot;query ExampleQuery($personId: ID) {\n \n  person(id: $personId) {\n    name\n  }\n}\n&quot;);<br>Map&lt;String, String&gt; variables = new HashMap&lt;&gt;();<br>variables.put(&quot;personId&quot;, getaAllPeople()); // Assuming &quot;personId&quot; is the key and getaAllPeople returns it<br>payload2.setVariables(variables);<br>payload2.setOperationName(&quot;ExampleQuery&quot;);</pre><p>After creating my response, the rest is easy, I extract the name field and check if this value is equal to Luke Skywalker and voila!</p><pre>String responseperson = given().spec(req).body(payload2)<br>        .when().post(&quot;/.netlify/functions/index&quot;)<br>        .then().extract().response().asString();<br><br><br>JsonPath js =new JsonPath(responseperson);<br>String name =js.getString(&quot;data.person.name&quot;);<br>MatcherAssert.assertThat(&quot;Name is equal to &#39;Luke&#39;&quot;, name, equalTo(&quot;Luke Skywalker&quot;));</pre><p>Yes, friends, by preparing such a simple project, I hope I have been able to provide some guidance to my friends who are curious about this subject. You can access the entire project <a href="https://github.com/kssonmezz/StarWars_GraphQL_Test_Automation"><em>here</em></a>. Please feel free to give feedback.<br>Take care, see you later.<br>May the force be with you :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a97a19cf6d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>