<?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 Alan Liew on Medium]]></title>
        <description><![CDATA[Stories by Alan Liew on Medium]]></description>
        <link>https://medium.com/@alanliew?source=rss-ec49619323a6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PQbwOV7IVkXLKdqSQ5koMA.jpeg</url>
            <title>Stories by Alan Liew on Medium</title>
            <link>https://medium.com/@alanliew?source=rss-ec49619323a6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:57:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alanliew/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[1000 timers in Jmeter, which one should I use it ? Precise.. Constant..]]></title>
            <link>https://alanliew.medium.com/1000-timers-in-jmeter-which-one-should-i-use-it-precise-constant-0108bebefc61?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0108bebefc61</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 14:14:52 GMT</pubDate>
            <atom:updated>2025-03-11T05:07:55.195Z</atom:updated>
            <content:encoded><![CDATA[<h3>1000 timers in Jmeter, which one should I use it ? Precise.. Constant..</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKYzN8PF6WfJ7CV4wDLiEw.png" /></figure><p>Sorry for the clickbait — there aren’t actually <strong>1000 timers</strong> in JMeter. But I can assure you that many QA engineers and developers might get confused between these two timers: <strong>Precise Throughput Timer</strong> and <strong>Constant Throughput Timer</strong>.</p><p>There are plenty of articles and tutorials about what Jmeter timers are. Even though JMeter offers a dozen different timers, I’ve found very few resources that explain <strong>when</strong> to use each timer in real-world scenarios.</p><p>Surprisingly , I have not seeing enough article explaining it, most of them were explaining what the timer is and rarely using that on testing an api endpoint. I believe knowing how to choose the right timer, so to accommodate your test objective is what matters the most.</p><p>Before diving into Constant Throughput timer and Precise Throughput timer, I want you to get a quick glance on what the Jmeter User manual about timer here : <a href="https://jmeter.apache.org/usermanual/test_plan.html#timers">Jmeter Official Documentation</a></p><p>However, the official documentation is quite limited, and there’s not much detailed information available online.</p><p>After multiple rounds of trial and error, I decided to write this article to share what I’ve learned from one of the projects I’m most proud of. (It was my first real experience with non-functional testing, and I learned a ton from it!)</p><h3>Lets get straight to the topic, I will start off with a case here, there is this api endpoint that returning crypto prices, and tech team want to further reduce the cache TTL (Time to live) from 60s to 30s.</h3><h3>What happens next?</h3><p>Reducing the cache duration means the server will receive <strong>2x the throughput</strong>, since cached responses expire faster, and more requests will hit the backend.</p><h3>Do we need a performance test?</h3><p><strong>Yes.</strong> We need to ensure the server can handle the increased load without degrading performance or crashing.</p><h3>How should we design the performance test?</h3><p>The goal is to verify the server can handle the increased throughput — or identify the breaking point.</p><p>Let’s assume the current production traffic is:</p><ul><li><strong>500 requests per minute</strong> with a <strong>60-second cache TTL</strong>.</li><li>Each user sends <strong>100 requests per minute</strong>.</li></ul><p>For the test scenario:</p><ul><li>We’ll simulate <strong>10 users</strong> hitting the endpoint.</li><li>Each user will send <strong>100 requests per minute</strong>.</li><li>Total: <strong>10 users × 100 requests = 1,000 requests per minute</strong> — <strong>2x the current production load</strong>.</li></ul><p>This setup mirrors the expected traffic increase after reducing the cache TTL and helps us assess server performance under the new conditions.</p><p><strong>In this scenario, how would you perform the test?</strong></p><p>We know that we will have to :</p><ol><li><strong>10 users</strong></li><li><strong>Sending 1k request per minute</strong></li><li><strong>Set the test duration (eg: 3 mins)</strong></li><li>Set the test metrics (Average response time, error rate, total requests, etc)</li><li>Choose the test visualisation method(View tree results, Aggregated report and etc)</li></ol><p>ps: I will only focus on the first 3 steps to explain the use case in this article.</p><p>To set this up in Jmeter, it will bring us to the next question, how do we ensure that the users are sending requests gradually, instead of sending 1000 requests at the 1st second of the test?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*FRmf5ZRdE0Dhl3oF" /><figcaption>I know you should have confused here.</figcaption></figure><p>Arguably, we can also have 1000 users and sending 1 request at the first second, but that’s not the ideal way to this situation. It will be sending 1000 requests at the 1st second of the 1st minute of the test, and followed by another 1000 requests at the 1st second of the 2nd minute…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*DqotUsLqhsIa4hBk2T9G4Q.png" /><figcaption>This is what happening if we have 1000 users triggering 1 request at the 1st second of the test.</figcaption></figure><p>However, in order to achieve our test objective, we will need 1000 requests per minute, which looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*HBW7q-WQRCcR92prTvjW-w.png" /><figcaption>Users triggering 1000 requests per minutes. because we want to know any abnormality will be surface when the server has 2X the throughput within a period of time.</figcaption></figure><p>To achieve this, we knew that we need to either</p><ol><li>To control the <strong>time interval between the each request</strong>, or:-</li><li>To control <strong>the number of requests being sent out within that period of time</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*Avi1GlcskTXW91rsZmy7iw.png" /><figcaption>There are different times of timer in Jmeter. We will be only focus on Precise Throughput Timer and Constant Throughput Timer in this article.</figcaption></figure><h3>Let’s look at how each of them look like in Jmeter,</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXkfDwZKgulTY4lcG3HcZA.png" /><figcaption>Constant Throughput Timer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUE6S9RAqQ1cUO5wa3GB3g.png" /><figcaption>Precise Throughput Timer</figcaption></figure><h3>They both looks similar isnt it ? Constant and Precise , what does it means?</h3><p>At first glance by reading the fields in the timer, both of them looks very similar and can achieve the same goals.</p><p>Let me explain both of them to you,</p><h3>🎯 Precise Throughput Timer</h3><ul><li><strong>Goal:</strong> Achieve the target throughput as accurately as possible, distributing requests at precise intervals.</li><li><strong>Precision:</strong> More accurate, especially at lower throughput levels.</li><li><strong>Mechanism:</strong> It calculates the exact delay needed between requests to hit the target rate.</li><li><strong>Use Case:</strong> When you need very consistent, evenly spaced requests (e.g., monitoring cache expiry or testing APIs with strict rate limits).</li></ul><blockquote><em>🔧 </em><strong><em>Example:</em></strong><em> You set 60 requests per minute → It sends exactly 1 request every second.</em></blockquote><h3>⚡ Constant Throughput Timer</h3><ul><li><strong>Goal:</strong> Maintain an approximate throughput over time, but with less precision.</li><li><strong>Precision:</strong> Can fluctuate slightly, especially for low request rates or in distributed testing.</li><li><strong>Mechanism:</strong> It adjusts the delay <strong>after</strong> requests are sent, so the throughput may vary slightly.</li><li><strong>Use Case:</strong> When you care about maintaining an average request rate over time rather than exact timing.</li></ul><blockquote><em>🔧 </em><strong><em>Example:</em></strong><em> You set 60 requests per minute → It aims for 1 request/second, but actual timing may vary.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*IEREDrTVP_fpvDQh.jpg" /><figcaption>At this point, you probably asking what’s the main difference here? Both of them are sending 1 request / second , in the example of 60 request per minute. I will explain it futher on below example.</figcaption></figure><h4>1. Now let’s implement <strong>Constant Throughput Timer</strong>,</h4><ul><li>10 users/threads</li><li>60 seconds test duration</li><li>1000 target throughputs per minute</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*ffxNEJN2k8lyxJtu-7_IXQ.gif" /><figcaption>From above GIF, You can see the user are able to achieve 1000 total requests in a minute.</figcaption></figure><h4>2. Next, let’s implement <strong>Precise Throughput Timer</strong>,</h4><ul><li>10 users/threads</li><li>60 seconds / test duration</li><li>1000 target throughputs per throughput period</li><li>60s for throughput period</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*_qGLQ2uODznAcG68DGAXrA.gif" /><figcaption>Ignore the extra 1 call in the samples because this is how precise throughput timer might send an extra request to “round up” to the exact throughput goal. For example, if you set <strong>60 requests per minute</strong>, it may send <strong>61 requests</strong> to ensure no request is missing.</figcaption></figure><p>It’s not hard to notice that the rate of increasing the request are slightly different between this two timer.</p><p>For <strong>Constant Throughput Timer</strong>, it is increasing by the multiplier of 10, where the <strong>Precise</strong> <strong>Throughput Timer</strong> is increasing at the rate of 20–30 calls per seconds. <strong>The question is why ? Can you relate it?</strong></p><p>Now let’s twist the users/thread counts for <strong>Constant Throughput Timer</strong>, and you will notice the secret here. Let’s change the users/threads count to 100, and the rest of the configuration stays the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*gdO1oSlR3ZAc4PZereJUMA.gif" /><figcaption>And you will noticed the calls are increase at the rate of 100, and we have exceeded 1000 calls per minute test requirements.</figcaption></figure><p>And we did the same to <strong>Precise Throughput Timer</strong>, we change the users/threads count to 100, the rest of the configuration stays the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*aKz4b0B0POqA25B4Ef1JPA.gif" /><figcaption>The calls increasing at the same rate at 20–30 requests per second, which contributed to 1000 request per minute (rpm) which hitting our test requirement.</figcaption></figure><h4>We are not giving up here ! We want to test if Constant Throughput Timer can do the same, let’s try it one more time.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yga2Nmwp_Q29jRv8DerKtA.png" /><figcaption>We configure the throughput calculation based on “All active threads in current thread group (shared)”, this way we can make sure that 100 thread users will only make 100 target throughput.</figcaption></figure><p>Now, let’s observe the test,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*2tkoQLfEX0UIR6UfAuNLbg.gif" /></figure><p>As you can see the <strong>Constant Throughput Timer</strong> triggered 100 calls at the first second, then increasing it to 1000 requests per minute, this is because<strong> Constant Throughput Timer</strong> is very sensitive with the number of the thread users.</p><p>We can try again with <strong>1000 users</strong> using <strong>Constant Throughput Timer.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*gSPT8YG9yQxMzzS-qSklYg.gif" /><figcaption>You can see the test are running wild again, it doesn&#39;t stick to 1000 request only (since we only running the test for 1 minute here for demo purpose) , the request exceeded our target throughput.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cuQe5XU30uCIaxwIzy6VWw.png" /><figcaption>Here is the conclusion I have after multiples trials and erorrs.</figcaption></figure><p><strong>In summary, we can concluded that Precise Throughput Timer is more appropriate in helping us to achieve the test objective, especially when we want a certain RPM in our test. We can probably achieve the same with Constant Throughput Timer here, but we have to ensure the number of threads are accurate (which in our case, we do not really care about number of users here.)</strong></p><p>Hope this helps you to have a better understanding of Constant and Precise Throughput Timer in JMeter. Thank you!</p><p>Ensure you follow me on <a href="https://www.linkedin.com/in/alan-liew/"><strong>LinkedIn</strong></a><strong> or </strong><a href="https://alanliew.medium.com/"><strong>Medium</strong></a><strong> to get notified about it!</strong></p><p>✅ MoreArticles:</p><ol><li><a href="https://medium.com/@alanliew/equivalence-partitioning-and-boundary-value-analysis-c940a0c120f5?source=your_stories_page--------------------------------------------">Equivalence Partitioning and Boundary Value Analysis</a></li><li><a href="https://alanliew.medium.com/graphql-sql-are-they-the-same-9e4a6ae362ce">“From REST to GraphQL” — Wait, GraphQL? SQL? Are they the same?</a></li><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50">AWS! The terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li><li><a href="https://keanoon03.medium.com/black-box-or-white-box-testing-how-many-boxes-do-you-need-3d6b2c0960a">Black Box or White Box Testing? (How many boxes do you need ?)</a></li></ol><h3>✅ ☎️👇🏻</h3><p><em>Or connect with me on </em><a href="https://www.linkedin.com/in/alan-liew/"><em>LinkedIn</em></a><em> to discuss this further!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0108bebefc61" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Equivalence Partitioning and Boundary Value Analysis]]></title>
            <link>https://alanliew.medium.com/equivalence-partitioning-and-boundary-value-analysis-c940a0c120f5?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c940a0c120f5</guid>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[istqb]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 09:40:52 GMT</pubDate>
            <atom:updated>2024-07-14T09:40:52.841Z</atom:updated>
            <content:encoded><![CDATA[<p>The easiest explanation you could find on the web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T_d9wqwoIcCLY3ZgiKAubg.png" /></figure><p>Both are black box testing techniques. Let’s start with an explanation of the Equivalence Partitioning technique.</p><h3>✅Equivalence Partitioning</h3><p>The steps should be as follows:</p><ol><li><strong>Divide the test conditions into groups or sets of partitions. All the elements under the same set of partitions are considered the same, and the system should handle them equivalently.</strong></li></ol><ul><li>A partition containing valid values is called a valid partition</li><li>A partition containing invalid values is called an invalid partition</li></ul><p><strong>For example, non-numeric example :</strong></p><ul><li><strong>If the fruits = apple, then print green</strong></li><li><strong>If the fruits = orange, then print the orange</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*USAFq0ZauK8EV5JL0OgL9w.png" /><figcaption>Non-numeric partitioning example</figcaption></figure><p>In the above example, Apple and Orange are valid partitions, while no invalid partition is specified; we assumed other fruits are invalid partitions.</p><p><strong>For example, numeric example :</strong></p><ul><li><strong>Users should be able to register when they are between ages 1 and 21</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNt7KdG9EYeMOxtzue4log.png" /><figcaption>Numeric Partitioning example</figcaption></figure><p>In the above example, an age between 1 and 21 is a valid partition(able to register), while an age less than 1 and more than 21 is an invalid partition(unable to register).</p><p><strong>2. When there are multiple sets of partitions or more than one input,</strong></p><ul><li><strong>The valid partition shall combined.</strong></li><li><strong>The invalid partition should be tested individually.</strong></li></ul><p><strong>Let’s take this as an example; the requirement is to register a user email with it hits the requirements below:</strong></p><ul><li><strong>It should be 6–30 characters long</strong></li><li><strong>Should be alphanumeric</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*xS-mHoY-udXlbUvUPV6tHg.png" /><figcaption>We should be able to come up with these valid and invalid partitions.</figcaption></figure><p>Following the No. 2 rules, we don&#39;t need to <strong>create 6 test cases</strong> for <strong><em>3 partitions belonging to (6–30 characters long)</em></strong> and <strong><em>2 partitions belonging to (should be alphanumeric).</em></strong></p><p>We shall combine the valid partition and come out with the test value (input) of</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*lHfj_bqZXo1FIx6533MAqw.png" /><figcaption>We can satisfy the valid partition with the value of “abc123”</figcaption></figure><p>then test the invalid partition individually,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*7Jth2iR0SoVAIkdGa-j0Dg.png" /><figcaption>A total of 4 test cases will be needed to cover all partitions.</figcaption></figure><p>In this example, 4 test cases are sufficient to test out all the combinations of partitions.</p><p><strong>The question may arise: why don&#39;t we combine the invalid partition?</strong></p><p>For example, we can combine less than 6 characters and not alphanumeric as one test,</p><p>If we test the <strong>invalid partition of &lt;6 characters</strong>, the error message “Sorry, your username must be between 6 and 30 characters long”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rk6auGPY3gnEoiZNZFWFBw.png" /></figure><p>However, when we test the<strong> invalid partition of &lt;6 characters</strong> and the <strong>invalid partition of not alphanumeric</strong>, the error message “Sorry, only letters (a-z), numbers (0–9), and periods (.) are allowed.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PzKo5agbnjfExoyKaTVqpQ.png" /></figure><p>It’s clear that when we combine two invalid partitions to test, it’s very easy to miss out on validating an <strong>invalid partition of &lt;6 characters</strong>. In this case, the tests are not well designed.</p><h3>✅ Boundary Value Analysis</h3><p>Boundary value analysis is related to equivalence partitioning. We can determine the boundary value by knowing the partition.</p><p><strong>We will use back the same numeric example :</strong></p><ul><li><strong>Users should be able to register when they are between ages 1 and 21</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNt7KdG9EYeMOxtzue4log.png" /></figure><p>And we know that</p><ul><li>age between 1 and 21 is a valid partition(able to register),</li><li>age less than 1 and more than 21 is an invalid partition(unable to register).</li></ul><p>To determine what is the boundary values:</p><ol><li><strong>The first rule of thumb of BVA is that the minimum and maximum values of the partition are called the partition&#39;s boundary values.</strong></li></ol><p>Hence, boundary values of 1 to 21 — — <strong>1 and 21</strong></p><h3><strong>Next, we can further determine its boundary value using the 2-value BVA or 3-value BVA method.</strong></h3><p>To find out what is the <strong>2 value BVA</strong>,</p><p><strong>2. This boundary value and its closest neighbor belonging to the adjacent partition</strong></p><p>Boundary values of 1 to 21 — — <strong>1 and 21</strong></p><p>(adjacent partition) Boundary values of 1 to 21 — — <strong>0 and 22</strong></p><p><strong>Hence, the 2-value boundary value of 1 to 21 is — — 0, 1, 21, 22</strong></p><p>To find out what is the 3<strong> value BVA</strong>,</p><p><strong>3. This boundary values and both its neighbors.</strong></p><p>Boundary values of 1 to 21 — — <strong>1 and 21</strong></p><p>(adjacent partition) Boundary values of 1 to 21 — — <strong>0 and 22</strong></p><p><strong>boundary values and both its neighbors of 1 to 21 — — 0, 1, 2, 20, 21, 22</strong></p><p><strong>boundary values and both its neighbors of 0 and 22 — — -1, 0, 1, 21, 22, 23</strong></p><p><strong>Hence, the 3 value BVA is -1, 0, 1, 2, 20, 21, 22, 23</strong></p><p>Now, you may wonder another question: when should we use 2-value BVA or 3-value BVA?</p><p>Let’s recap the requirements:</p><ul><li><strong>Users should be able to register when they are between ages 1 and 21</strong></li></ul><p>And somehow, developers make this mistake in the logic to be able to register when <strong>1 ≤</strong> <strong>age = 21</strong>.</p><p>We may have overlooked and missed this bug because a 2-value BVA only tests 21; however, a <strong>3-value BVA may be able to surface the issue because the value of 20 is tested</strong>.</p><p>Thank you!</p><p>Ensure you follow me on <a href="https://www.linkedin.com/in/alan-liew/"><strong>LinkedIn</strong></a><strong> or </strong><a href="https://alanliew.medium.com/"><strong>Medium</strong></a><strong> to get notified about it!</strong></p><p>✅ Related Articles:</p><ol><li><a href="https://alanliew.medium.com/graphql-sql-are-they-the-same-9e4a6ae362ce">“From REST to GraphQL” — Wait, GraphQL? SQL? Are they the same?</a></li><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50">AWS! The terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li><li><a href="https://keanoon03.medium.com/black-box-or-white-box-testing-how-many-boxes-do-you-need-3d6b2c0960a">Black Box or White Box Testing? (How many boxes do you need ?)</a></li></ol><h3>✅ ☎️👇🏻</h3><p><em>Or connect with me on LinkedIn to discuss this further!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c940a0c120f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My learning experience for CTFL – after scoring it at 90%]]></title>
            <link>https://alanliew.medium.com/my-learning-experience-for-ctfl-after-scoring-it-at-90-920881723d6e?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/920881723d6e</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[qa-testing]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sat, 08 Jun 2024 07:08:45 GMT</pubDate>
            <atom:updated>2024-06-08T07:28:59.426Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z9SDVsdJQc72-R_q75NmnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*slTqu7EVvhN3ZTaoFQ0fdQ.png" /><figcaption>Score 90% on my CTFL</figcaption></figure><p>Urgh. I have been in the QA industry for about {you filled in the number here} years, yet I’m still wondering if ISTQB-CTFL is worth getting.</p><p>Or was this just “another” typical exam after we graduated from university?</p><p><strong><em>You can see the difference before and after I got the CTFL by reading my older post talking about CTFL here: </em></strong><a href="https://alanliew.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163"><strong><em>Link</em></strong></a></p><blockquote>🤯 The WHY ? and this happens to almost all QA I have been through. <strong><em>“The syllabus does not apply to the real world; I studied it because it helped me to tick one of the Job Description Requirements, and “Perhaps” it helped me to negotiate for a better salary”</em></strong> almost every QA I asked.</blockquote><p>Well, I beg to differ that salary should be <em>different just because of having that certification, </em><strong>but I’m certain that learning should be self-focused, focusing on increasing self-skills, values, responsibilities, and your USP (Unique selling point) to provide more value in exchange for</strong> better compensation.</p><blockquote>This is similar to the question, we get what we want ? or what we want get us?</blockquote><p>I have no choice but to dive deep into it to discover the truth. And here’s why I wrote this article: not to show you what CTFL was about but to show you how it can help your career from another perspective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yDwEakj8cBvTgHT2.jpg" /></figure><p>Just another exam 😩? To answer this question,</p><blockquote>I don’t treat this as another “exam,” I took it as another opportunity to learn and correct myself if there’s any misconception about QA ,to learn and absorb as much as I can.</blockquote><p>Now, you may still wonder what exactly I’m referring to. Well, let me give you a few examples by asking a few questions. (If you’re a tester or QA)</p><ol><li>What is the testing principle you should hold as a tester when challenges come from end users and stakeholders saying that the software is hard to use, or not useful? despite having no defects during the test execution ?</li><li>What software testing process(es) are you involved in at your current company? And what SDLC approach are they implementing? What is the difference you should make as a tester if they were to change their company strategy? Or the choice of SDLC?</li><li>Why is testing context-based? and how context could change the testing process. What are some of the good testing practices, regardless of the context?</li><li>What should be included in the defects report? Should test cases be linked? And why? Why does traceability help? In which way?</li><li>What is the risk analysis and risk control process in which QA should be involved, and how would it help in your current SDLC cycle?</li></ol><p><em>and the list goes on.</em></p><p>You may start blurring out some answers, and you may not be able to answer all of them. You may start to wonder, “Is this part of QA?”</p><blockquote>Now, I will leave the question “Is CTFL applicable to your QA career?” to you.</blockquote><h3>What are some of the prepartion to get you ahead?</h3><blockquote>I will categorize this mainly into 3 parts :</blockquote><blockquote>1. Making a commitment</blockquote><blockquote>2. Time management</blockquote><blockquote>3. Learnings from the syllabus</blockquote><p><strong>Why is commitment on the list?</strong></p><ul><li>✅You have to make a commitment to attending an exam because there are too many “fallback” reasons not to get it.</li><li>✅If you don’t make the commitment and pursue it, everything, not only the exam, will fall apart.</li><li>✅You paid for the exam and it is relatively expensive, you wouldn’t want to failed the exam.</li><li>✅By committing to the exam, you have to be disciplined and squeeze out hours or minutes from your day-to-day to learn about the paper, which will bring us to the next point (Time management)</li></ul><p><strong>🤦🏻‍♂️ I know. I know. Time management sounds so overrated.</strong></p><blockquote>“I have personal life to live, work life to strive, family, friends and relationships that require my endless attention.”</blockquote><p>It reminds me of one quote from Grant Cardone, “You can either make excuses, or make money, but not both”</p><p>I will twist a bit, <strong>“You can either make excuses, or make it work, but not both”</strong></p><p>Action items :</p><ol><li>To come out with a proper time schedule for you to learn the syallabus</li><li>Try to “learn” it , not to finish it</li><li>Adjust your schedule to which work the best for you</li></ol><p>👍🏻 That is why making a commitment will be the first step, and time management will follow next. <strong><em>You will not be willing to spend hours and days studying the syllabus if you aren’t convinced.</em></strong></p><h4>Learning from the syllabus 💡:</h4><p>Well, I guess this is the part where most people would love to know more. I will write it in question form to make it as short as possible.</p><p>By answering these few questions, you will be able to see what insights you could gain from the learnings and how they can integrate into your career.</p><ol><li>What is testing, and why is testing necessary? (Formal answer, please, don’t tell me testing is to test lorr)</li><li>How does testing reduce the risk in particular? What are the risks associated with and how the risks can be mitigated ? By changing the testing techniques</li><li>Are you involved in different test levels in your current career, and how would it be different if you were? What are some of the test techniques you can utilize to help at the test level ?</li><li>Static analysis: what exactly is it? How do you perform this? And what are some of the defects you will be able to find?</li><li>How do you calculate your test coverage? (PS: it is too simple to hear people saying I have 70% test coverage, and most likely they have no idea what they’re talking about. )</li><li>Is API testing more toward acceptance criteria or user-oriented? And why?</li><li>How do you prioritize your test to ensure it has the best ROI ? (ROI is the word I prefer to use, haha, <strong>“writing thousands of test cases for a login input field may sound “professional</strong>,” but it doesn’t guarantee the best ROI in terms of test coverage, and it just means that you are unaware of implementing some of the black box techniques, BVA and EP), even if implementing EP, what is valid partition and how would you derive invalid partition if it’s not stated in the acceptance criteria? What should you do?</li><li>Why is black box testing different from white box testing? How does white box testing look into the work product&#39;s structure? What if I applied black box techniques called BVA into a function that calculate marks from 1–100, does this mean I applied white and black box testing? (Ps: I can see “blur” on people&#39;s faces usually when asking this question; most will answer, “Just look into the code,” or “Ask dev to show me the code, and I will verify it.”)</li><li>What are some of the situations you would prefer to build a decision table? And why?</li><li>How can you ensure you have enough test cases/test coverage for the feature? Should you go beyond that and create more tests that are unrelated but could be a regression?</li><li>Do you use tools in your work? What are some of the tools you are using that increase test effectiveness?</li><li>What should I expect in a test completion report? Do I have to include the plan for the next release or the lesson learned in the current sprint? Or both?</li><li>What difference does the UAT tester and the SIT tester make? Do you contribute as both? and why domain knowledge and communication skills have a much greater impact on UAT testers than on SIT.</li></ol><p>My hot latte ☕ is getting cold, and I must stop here. It was a wonderful morning, and I would not like to lose the best taste of my coffee. I will see you in my next one!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TzkF8uAh40hangtjItPuTQ.jpeg" /></figure><h3><strong>Okay, this is the last one. In the next few articles, I will post my study notes, tips, and tricks, which I derive from the syllabus, chapter by chapter.</strong></h3><p><strong>Make sure you follow me on either </strong><a href="https://www.linkedin.com/in/alan-liew/"><strong>LinkedIn</strong></a><strong> or </strong><a href="https://alanliew.medium.com/"><strong>Medium</strong></a><strong> to get notified about it!</strong></p><p>✅ Related Articles:</p><ol><li><a href="https://alanliew.medium.com/graphql-sql-are-they-the-same-9e4a6ae362ce">“From REST to GraphQL” — Wait, GraphQL? SQL? Are they the same?</a></li><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50">AWS! The terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li><li><a href="https://keanoon03.medium.com/black-box-or-white-box-testing-how-many-boxes-do-you-need-3d6b2c0960a">Black Box or White Box Testing? (How many boxes do you need ?)</a></li></ol><h3>✅ ☎️👇🏻</h3><p><em>Or connect with me on LinkedIn to discuss this further!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=920881723d6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have you heard of the Same-Origin Policy and Cross-Origin Resources Sharing?]]></title>
            <link>https://alanliew.medium.com/have-you-heard-of-the-same-origin-policy-and-cross-origin-resources-sharing-efe9fd3a372e?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/efe9fd3a372e</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cors]]></category>
            <category><![CDATA[qa-testing]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sun, 08 Oct 2023 01:02:05 GMT</pubDate>
            <atom:updated>2023-10-08T01:02:05.203Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*g9gVQASCyyT-e0SgOmc7mg.png" /></figure><h3><strong>❓ What is the Same-Origin Policy?</strong></h3><p><strong>Same-origin policy (SOP)</strong> is a rule that is enforced by browsers to control access between web applications.</p><p>Example,</p><p>You are visiting a 🏦banking application and a 🛒 shopping application, the interaction between these two applications is limited by default by all browsers. (You may not realize)</p><p>Even though the bank application is able to make requests to the shopping application, for example submitting a form. However, the shopping application will not be able to read the response. This is because they are not from the same origin. ( shopping.com vs bank.com )</p><p>This is implemented default by all browsers and it’s done for security purposes.</p><p><strong>🤯 Imagine if without this Same-origin policy (SOP),</strong></p><p>You have visited the shopping application and are unsure if it’s malicious. Well, if there is a script in this shopping application asking for your info such as account number, account balances, and personal info from your bank application, your bank application will hand over this information to the shopping application happily without you even noticing it.</p><p>✅ To conclude, this <strong>Same-origin policy (SOP)</strong> is very important, to prevent such events from happening. Otherwise, all applications will pretty much attack each other and access each other data easily.</p><blockquote>Now, do take note that this Same-Origin Policy (SOP) does not prevent <strong>writing</strong> between web applications, it only prevents reading between two applications.</blockquote><p>Then, when the shopping application requests your bank account info from the bank application, and when your bank application sees the request, it will check where the access originated from.</p><p>In this case, if the domain is shopping.com, and this domain is different from the bank domain (bank.com), the browser will reject the request because these two applications have different origins.</p><h3>👀 What is an Origin?</h3><p>Origin is made up of 3 parts, the scheme(protocol), hostname(domain), and port of the URL used to access it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*KiOpY1rgR8VLV_oHgEFsUA.png" /></figure><p>Now, let’s do a simple check on the example below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*2ROXIjy41kaBUwoUFOlVNw.png" /></figure><p>As we can see, same-origin access only works if the scheme, domain, and port are the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*SwuAbR9ZmlT_auKF-ZJz_w.png" /><figcaption>Here is an example when the origin is from alanliew.com and then request to google.com.</figcaption></figure><p>We can see there is a new term “CORS” from the network error from the image above.</p><h3><strong>🚀 Why and what is the Cross-Origin Resource Sharing (CORS) protocol for?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ff1AeuOsG8cgNFOFyuGaQ.jpeg" /></figure><p><strong>Cross-origin resource Sharing (CORS)</strong> is a mechanism that uses HTTP headers to define origins that the browser permits loading resources.</p><p>For example, if you are visiting a shopping application and you want to purchase a chair, you want to make a payment via the bank application.</p><p>In this case, the bank application may need to loosen up the grip of the same origin policy and allow cross-origin interaction. The bank may not want to stop the interaction so these applications will do is to make use of the cross-origin resource sharing protocol.</p><blockquote>Now, you may wonder how would that happen because they are not from the same origin.</blockquote><p><a href="https://shopapplication.com/">https://shopapplication.com</a></p><p><a href="https://bank.com/">https://bank.com</a></p><p><strong>While they are still using the same https://, they are still different domains (different origins).</strong></p><p>✅ Now, in order to cross-origin, the developer from the bank application may need to configure the <strong>CORS rule<em> telling that if there’s a request coming specifically from shopapplication.com</em></strong>, and allow that request to go through.</p><p>Hence, bank and shop applications may be able to interact with each other now.</p><h3>👍🏻 To understand more about CORS Headers</h3><p>CORS basically makes use of 2 HTTP headers:</p><ol><li>Access-Control-Allow-Origin</li><li>Access-Control-Allow-Credentials</li></ol><h3>✅ How are Access-Control-Allow-Origin headers being used?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*e0s9XU8Ej-qPgtytVadsVw.png" /></figure><p>In this example:</p><p>The shopping application is sending a request to read the Bank homepage from the Origin of shopping.com.</p><p>If the bank application has configured to Access-Control-Allow-Origin from all shopping.com origins, the bank application will be able to read the request and allow the request to go through.</p><p><strong>Access-Control-Allow-Origin Syntax:</strong></p><pre>Access-Control-Allow-Origin: *       //whitelist all the internet<br>Access-Control-Allow-Origin:&lt;origin&gt; //whitelist only one origin<br>Access-Control-Allow-Origin: null   // redirects and sand box redirects</pre><h3><strong>✅ What about Access-Control-Allow-Credentials headers?</strong></h3><p>Well, <em>Access-Control-Allow-Origin </em>only allows to access public pages, and if you want to access authenticated pages, you will need <em>Access-Control-Allow-Credentials </em>headers.</p><p><strong><em>👉🏻 Access-Control-Allow-Credentials</em></strong><em> </em>headers allow <strong>cookies, authorization headers, or client certificates</strong> to be included in the cross-origin request.</p><p>Let’s get back to the same example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*jaguid_KgbmUkrvlj3O0Ew.png" /></figure><p>You have decided to purchase a chair 🪑 and proceed with payment. The shopping application will send a request to get your account details (authenticated resources )from your bank application.</p><p>🚀 The shopping application includes the <strong>cookies</strong> in the request headers, and the bank will be able to read the request if <em>Access-Control-Allow-Credentials is </em>set to true, and the shopping application will be able to read the authenticated resources from the bank.</p><p>Access-Control-Allow-Credentials Syntax:</p><pre>Access-Control-Allow-Credentials: true      //all the internet able to read the authenticated resources</pre><h3>🐞 ❌ Now, you may realize something is off here and there are some vulnerabilities using CORS.</h3><h3>I will share about that in the next article! And how you can prevent it as a QA! 🧯</h3><p>👇🏻 👇🏻👇🏻 👇🏻👇🏻 👇🏻</p><h4>Make sure you follow me on <a href="https://alanliew.medium.com/">Medium</a> so that you will get notified of my new articles!</h4><p>✅ Related Articles:</p><ol><li><a href="https://alanliew.medium.com/graphql-sql-are-they-the-same-9e4a6ae362ce">“From REST to GraphQL” — Wait, GraphQL? SQL? Are they the same?</a></li><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50">AWS! The terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li><li><a href="https://keanoon03.medium.com/black-box-or-white-box-testing-how-many-boxes-do-you-need-3d6b2c0960a">Black Box or White Box Testing? (How many boxes do you need ?)</a></li></ol><h3>✅ ☎️👇🏻</h3><p><em>Or connect with me on </em><a href="https://www.linkedin.com/in/alan-liew/"><strong><em>LinkedIn</em></strong></a><em> to discuss more!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efe9fd3a372e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API performance testing using Postman Canary, a game-changing platform.]]></title>
            <link>https://alanliew.medium.com/api-performance-testing-using-postman-canary-a-game-changing-platform-e618c47be60e?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e618c47be60e</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[postman-testing]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[performance-testing]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sun, 09 Jul 2023 09:08:20 GMT</pubDate>
            <atom:updated>2023-07-09T11:10:31.041Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*s0Vi6zfZ1H_Wa1csYX64QA.png" /></figure><p>API testing plays a pivotal role in the software testing process, and most of the QA teams hugely rely on <strong><em>Postman</em></strong> for it.</p><p>QA teams typically utilize several API performance testing tools to assess the performance of APIs, such as Jmeter, LoadRunner, K6, and many more.</p><p>❌ This created friction when QA wanted to test the performance of APIs and APIs request and responses at the same time as they needed to utilize 2 different platforms.</p><p>💡 The good news is there is this new feature in Postman Canary that supports API performance testing at the same time. <a href="https://www.postman.com/downloads/canary/">Postman Canary</a>.</p><p><strong>Postman Canary</strong> is more like a beta release of Postman, and they will release the new features to Postman Canary first before they release it to the official build of Postman.</p><p>✅ It did provide API performance testing features where users can have the capability to simulate <strong>load and stress tests</strong>. These tests help to uncover performance bottlenecks, assess the API’s scalability, and ensure it can handle anticipated or unexpected load conditions effectively.</p><p>👇🏻 This article showcases the practical implementation of Postman Canary to conduct straightforward API performance testing.</p><p>I will demo the features using this <a href="https://deckofcardsapi.com/">deck of cards api</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MVJfuC49j05V7E3-C6k7w.png" /><figcaption>Shuffle cards sample request and response</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GLoKHihAGkZAet1MqI-Ytg.png" /><figcaption>Then, draw a card using the above request endpoint</figcaption></figure><p>🚀 To put it simply, what we gonna do is shuffle a deck of cards and draw one card from the deck that we just shuffled.</p><p>We are gonna stimulate 100 users (ramp up) to perform the same actions in 5 minutes and stimulate the performance test.</p><p>For the first endpoint, we are going to save the deck_id from the response for the second endpoint (draw a card).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vy4bcjO-rWL-88KpuE2ppA.png" /><figcaption>We are shuffling the deck and saving the deck id. Then, we draw a card from this deck using the next endpoint.</figcaption></figure><p>For the second endpoint,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O_tTKaS-8h-y5WI4DY60vg.png" /><figcaption>We are going to draw 1 card from the deck</figcaption></figure><p>One last step, run the collection and see if it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N8Fod2159JP0l1mw62sCtw.gif" /><figcaption>Run the 2 endpoints as a collection and see if it’s returning a 200 OK response code for both endpoints.</figcaption></figure><p>Then, we will be utilizing the performance tab in Postman Canary to perform API Performance Test.</p><p><strong>Virtual Users: </strong>100 users<br><strong>Test Duration: </strong>10 mins<br><strong>Load Profile —</strong> this is to determine fixed 20 users or ramp up(slowly increase) to 20 users in the timeframe. We will choose ramp-up in this case.</p><p><strong>Ramp-up duration:</strong> how long do you want the virtual user (increase) ramp-up to the desired maximum number of virtual users. Eg: Increase the user from 1 to 100 in 5 minutes ramp-up duration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I3NfGDcSMVWCt5vlsZNXcw.gif" /><figcaption>Run performance test with 100 users, ramp up in 5 mins.</figcaption></figure><p>You will see a running graph after the Run Collection button is clicked.</p><p>The running graph shows <strong>important metrics</strong> for you to evaluate the performance of the API.</p><ol><li>Total requests sent — total number of requests sent to the endpoint</li><li>Requests/s- total number of requests sent to the endpoint per second.</li><li>Average response time — average response time across all requests hitting the endpoints.</li><li>Error rate — the percentage of requests that have returned a non-2xx response or were unable to hit the endpoints.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkiZT3ILFxKJElxxMfWpdQ.png" /><figcaption>Let’s evaluate the results</figcaption></figure><p>In general, we can see that the total requests has been sent to each endpoint.</p><p><strong>Min (ms):</strong> 294 to 293, roughly 3 ms. This means that the minimum response time from this endpoint is about 3ms.</p><p><strong>Max (ms):</strong> 2536 to 2586, roughly 2500ms. This means that the maximum response time from this endpoint is about 2500ms.</p><p><strong>90th(ms):</strong> 1404 o 1411, roughly 1400ms. This means that 90% of all the requests sample has a 1400ms response time. The remaining 10% may have a higher response time than 1400ms. This tells us that most users will be able to have a response time of 1400ms to these endpoints.</p><p><strong>Error rate:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5yGAPdGpnb_CcYsKA9stJA.png" /><figcaption>Another test example where the second endpoint cannot identify the deck_id</figcaption></figure><p>We can see a <strong>100% of error rate for 2nd endpoint</strong>. This means that this endpoint has 100% failed across a total of 553 requests. (I have removed the deck id, and the endpoint does not know which deck to pick a card from, hence returning a <strong>404 not found error</strong> code. )</p><p>🚀 This is a very simple example to show you how the error rate works. Bear in mind that this can be more complicated when testing the endpoint with different scenarios.</p><p>✅ Related Articles:</p><ol><li><a href="https://alanliew.medium.com/graphql-sql-are-they-the-same-9e4a6ae362ce">“From REST to GraphQL” — Wait, GraphQL? SQL? Are they the same?</a></li><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50">AWS! The terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li><li><a href="https://keanoon03.medium.com/black-box-or-white-box-testing-how-many-boxes-do-you-need-3d6b2c0960a">Black Box or White Box Testing? (How many boxes do you need ?)</a></li></ol><h3>✅ ☎️👇🏻</h3><p><em>Or connect with me on </em><a href="https://www.linkedin.com/in/alan-liew/"><strong><em>LinkedIn</em></strong></a><em> to discuss more!</em></p><p>#performacetesting #apitesting #SDLC #STLC #ISTQB #postman #postmancanary #postman #api</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e618c47be60e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GraphQL? SQL? Are they the same?]]></title>
            <link>https://alanliew.medium.com/graphql-sql-are-they-the-same-9e4a6ae362ce?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e4a6ae362ce</guid>
            <category><![CDATA[software-test-automation]]></category>
            <category><![CDATA[graphql-vs-rest]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[sdet]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 17:50:05 GMT</pubDate>
            <atom:updated>2023-04-23T17:58:16.776Z</atom:updated>
            <content:encoded><![CDATA[<h3>“From REST to GraphQL” — Wait, GraphQL? SQL? Are they the same?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4x-7hDVPZs2wG59gB7yVg.png" /><figcaption>GraphQL is a query language and runtime for APIs that was created by Facebook in 2012.</figcaption></figure><h3>1.0 🚀 What is GraphQL?</h3><p>GraphQL is a powerful query language and runtime for APIs that was created by Facebook in 2012. It provides a complete and understandable description of the data in your API by giving the power to ask for exactly what they need and nothing more.</p><p>We can read, edit and update the data through GraphQL query.</p><p>GraphQL is a query language for your API and a server-side runtime for executing queries using a type system you define for your data. GraphQL isn’t tied to any specific database or storage engine and is instead backed by your existing code and data.</p><h3>2.0 🤨 GraphQL vs SQL? Same or different?</h3><p>They are different. SQL (Structure Query Language) is a language to manage <strong>relational databases</strong> ( Relational databases have tables with rows, columns, and fixed schema).</p><p><strong>SQL</strong> provides a way to interact with data in a structured way using a set of pre-defined tables, columns, and relationships.</p><p>On the other hand, <strong>GraphQL is a query language for APIs.</strong> It allows clients to request only the data they need, and nothing more, by defining the structure and types of data based on the schema.</p><p>GraphQL provides a more efficient way to retrieve data compare to traditional ( GET, POST, DELETE ) REST APIs.</p><h3><strong>3.0 🏎️ Why do we need GraphQL? How efficient is it?</strong></h3><p>For example, we have a REST API with two endpoints, <br><strong>`/users` </strong>and <strong>`/address`.</strong></p><p>A request to <strong>`/users` </strong>would return a list of all users, while a request to <strong>`/address` </strong>would return a list of all addresses.</p><p>We would need to send 2 different GET requests using traditional REST API to get the data we want as below:</p><pre>GET /user?id=1<br>GET /address?user_id=1</pre><p>However, we only need to send 1 query to get the same data using graphQL.</p><pre>query {<br>  user(id:1){<br>    id<br>    address<br>  }<br>}</pre><p>And the results :</p><pre>{<br>  &quot;users&quot;: {<br>    &quot;id&quot;: 1,<br>      &quot;address&quot;: &quot;Malaysia&quot;<br>    }<br>  }<br>}</pre><p>From the above example, we can clearly see that the benefit of using GraphQL is that it prevents data <strong><em>overfetching</em></strong> and <strong><em>underfetching</em></strong><em> </em>issues.</p><p>As with GraphQL, we can fetch exactly the data we need in a single request without any unnecessary data or additional requests.</p><h3>4.0 👨🏻‍💻 GraphQL Operator</h3><p>Unlike traditional REST APIs operation (GET, POST, DELETE, etc), GraphQL only has 3 main operations ( Queries, Mutations, Subscriptions).</p><p><strong>📖 Queries (Read data) :</strong></p><pre>query{<br>  user {<br>    id<br>    name<br>  }<br>}</pre><p><strong>✍🏻 Mutations (Write Data):</strong></p><pre>mutation{<br>  create (name: &quot;user&quot;){<br>     id<br>  }<br>}</pre><p><strong>👂🏻 Subscriptions (Listen to Data):</strong></p><pre>subscription{<br>  onCreate{<br>    id<br>    name<br>  }<br>}</pre><h4>⭐️⭐⭐️️You can try out GraphQL using this Hasura <a href="https://hasura.io/learn/graphql/graphiql">site</a>.⭐️⭐️⭐️</h4><h3><strong>✅ Queries (Read Data):</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-biw7Mg6YbGFMfGTttmZQ.png" /><figcaption>In this example, we are trying to query users (id, name, and todos), and we also query the id of the todo at the same time, using graphql.</figcaption></figure><p>We can also send the same request using Postman. (Make sure you have provided the mentioned headers in the request.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hrA2cCiAFTn66pGEYOm-lg.png" /><figcaption>As you can see, the results returned from Hasura and Postman are the same.</figcaption></figure><p>Hence, we can write our tests in the tests tab.</p><h3>✅ Mutations (Write Data)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25aiJ_5wUBDoJuNu4VFoig.png" /><figcaption>We added a new todo and returned the (id, created_at, and title).</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3jxy4OnzcbWUf5UzN1Kg0A.png" /><figcaption>The same goes for Postman.</figcaption></figure><p>Now, let’s modify the data of the id (74560).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*lQaT7caX5q6CMmceBuFsgw.png" /><figcaption>We will update the title to “sdet-alan is awesome” and query to return the affected rows ( id, created_at, and title) after the data is updated.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*FFtAl2vO_LiAMelaOGbm2g.png" /><figcaption>Voila, the data is updated!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OP1JyPLFuVXUDG0MJjRTRg.png" /><figcaption>The same goes for Postman.</figcaption></figure><p>Next, let’s delete the data using the id,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPkMZWmQUB_SEbGAGA1qjw.png" /><figcaption>We delete the id(74562) and return the affected rows (title and id).</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*VfF8R4063dNSoMDKc6ve6A.png" /><figcaption>We can confirm the data has been deleted successfully by querying the id(74562) again.</figcaption></figure><h3>✅ Subscription (Listen to Data)</h3><p>A Subscription is a GraphQL operation that enables you to subscribe to events on the server. You will get real-time updates from the server each time the event you subscribed to occurs.</p><p>An event can represent a record insertion, modification, or deletion. Using the todo application as an example, we can use GraphQL Subscriptions to notify us each time a new todo is added to the database.</p><p>GraphQL Subscriptions are a critical component of adding real-time or reactive features to your applications.</p><p>GraphQL clients and servers that support subscriptions allow you to build great experiences without dealing with WebSocket code!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAcJ5xYEuUqWSzFHSZ7spA.png" /><figcaption>For example, we created an insertion.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CArcQ32RGO0IkoyWnWC_uA.png" /><figcaption>We can see the latest data updated in real time from the Subscription response.</figcaption></figure><p>We learned that GraphQL is very powerful in fetching the appropriate data that we need from the APIs, avoiding multiple API calls and data that are not needed (<em>overfetching).</em></p><p>🚀 In this article, I only cover the main operators and basic usage of GraphQL. There are much more arguments and features that you can implement in your use cases.</p><p>👉🏻 For more details, visit the <a href="https://graphql.org/learn/">GraphQL official site</a>.</p><h3>🚀 Let’s recap:</h3><ol><li>GraphQL is a query language for your API.</li><li>GraphQL is NOT SQL. They are different.</li><li>GraphQL operators : Total 3 (Query, Mutation and Subscriptions)</li></ol><p>✅ Related Articles:</p><ol><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725?source=user_profile---------1----------------------------">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50?source=user_profile---------0----------------------------">AWS! The terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884?source=your_stories_page-------------------------------------">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li><li><a href="https://keanoon03.medium.com/black-box-or-white-box-testing-how-many-boxes-do-you-need-3d6b2c0960a?source=user_profile---------0----------------------------">Black Box or White Box Testing? (How many boxes do you need ?)</a></li></ol><h3>✅ ☎️👇🏻</h3><p><em>Or connect with me on </em><a href="https://www.linkedin.com/in/alan-liew/"><strong><em>LinkedIn</em></strong></a><em> to discuss more!</em></p><p>#Softwaretesting #softwaretestere #SDLC #STLC #ISTQB #Java101 #SeleniumJava #blackboxtesting #whiteboxtesting #graphql #sql #api</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e4a6ae362ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Black Box or White Box Testing? (How many boxes do you need ?)]]></title>
            <link>https://alanliew.medium.com/black-box-or-white-box-testing-how-many-boxes-do-you-need-3d6b2c0960a?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d6b2c0960a</guid>
            <category><![CDATA[software-test-automation]]></category>
            <category><![CDATA[istqb-certification]]></category>
            <category><![CDATA[istqb-foundation-level]]></category>
            <category><![CDATA[ctfl]]></category>
            <category><![CDATA[istqb]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sun, 02 Apr 2023 15:33:07 GMT</pubDate>
            <atom:updated>2023-04-02T15:46:21.746Z</atom:updated>
            <content:encoded><![CDATA[<h3>Black Box or White Box Testing? (How many boxes do you need ?)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e06naALZbvcTdwoXFOIZag.png" /></figure><h3>Always Start with the WHY?</h3><p>Why do we need to have <strong>Black Box</strong>, <strong>Grey Box</strong>, and <strong>White Box</strong> testing, respectively?</p><p>It all depends on several factors, such as <strong>type of component or system</strong>, <strong>component/system complexity</strong>, <strong>regulatory standards</strong>, <strong>customer or contractual requirements</strong>, <strong>risk types or levels</strong>, <strong>test objectives</strong>, <strong>documentation and tools availability</strong>, and the <strong>tester’s knowledge and skills</strong>.</p><p>We will have different testing techniques to cater to each combination of factors mentioned above.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — -</p><h4><strong>1. Black Box test technique</strong></h4><p>Black box testing is a <strong>behavior-based technique</strong> that is based on analysis of the appropriate test basis.</p><p>It is a testing technique where the tester will only pay attention to the inputs and outputs without referencing the internal structure of the test object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k9_U2nwiQ8eQjIsHsFWhUg.png" /><figcaption>The tester will only pay attention to the inputs and outputs without referencing the test object&#39;s internal structure.</figcaption></figure><h4>1(a) How to do black box testing?</h4><p>Since we don&#39;t know the internal structure or design, how are we ensuring that our test cases can provide excellent coverage and still find defects?</p><ul><li>✅ <strong>Understanding the requirement / Acceptance Criteria:</strong> The tester can run the software thoroughly to understand the system. The system/component requirements/acceptance criteria will act as a source of truth to create high-coverage test cases in most cases. Tester may need to close the understanding gap with Product Owners to ensure the specifications are sufficient to write black-box test cases.</li><li>✅ <strong>Test Case Creation: </strong>Here is the challenging part, as we do not know the internal structure of the system. However, there are a few paths that we can have a guide on ( Happy Paths, Alternate Paths, and Negative Paths).</li></ul><p><strong>Happy Path</strong>: Usually focus on the critical business requirement where we give positive inputs. It involved the most commonly used steps.</p><p><strong>Alternate Path:</strong> Usually focus on the critical business requirement where we give positive inputs as the happy path does. However, it usually involved not commonly used steps.</p><p><strong>Negative Path:</strong> Focus on the business scenarios where we give negative inputs, and we expect the system to return the error as requirement expected.</p><ul><li>✅ <strong>Execution: </strong>We compare the actual results to the expected results after test executions.</li><li>✅ <strong>Defect Logging and Closure: </strong>This is to log the defects and retest them once it is fixed by the dev. We can also test the scenarios that are around the fix and sometimes leads to another defect.</li></ul><h3><strong>🚀 Now, what are the types of black-box testing techniques? (Total 5)</strong></h3><ol><li><strong>🔥 Equivalence Partitioning(Valid and Invalid)</strong>. We can apply this technique, especially when we have an input range to enter. EG: Length of mobile number.</li></ol><p>Let’s say the mobile number is usually 9 figure length. Hence,</p><ul><li>&gt; 9 digits (Invalid Partition)</li><li>= 9 digits (Valid Partition)</li><li>&lt; 9 digits (Invalid Partition)</li></ul><p>2. <strong>🔥 Boundary Value Analysis.</strong> We have already reduced the test conditions using equivalence partitioning, but that’s not always enough because defects usually happen in the boundary/borders of the equivalence classes.</p><ul><li>8 digits mobile number</li><li>9 digits mobile number</li><li>10 digits mobile number</li></ul><p>Do note that including 100 digits mobile number in this test condition will have a low ROI, and it may cause exhaustive testing where time is consumed.</p><p>3. <strong>🔥 Decision Table Testing:</strong> This usually design to execute tests on complex business logic, Eg: (Correct Email, Correct Password, Correct account number), (Incorrect Email, Correct Password, Correct account number).</p><p>4. <strong>🔥 State Transition Testing:</strong> This type mainly focuses on the system&#39;s output. Eg: ( Alan withdraws $100 from the ATM, and the cash comes out. Then, Alan withdraws $100 again from the ATM later, but he refuses the money this time). Both are the same input, $100, but the state has changed.</p><p>5.<strong> 🔥Use Case Testing:</strong> Use cases will define the system behavior using an actor (User). A use case defines the process flow from the actor, and the use case produces test cases.</p><ul><li>Customer who orders a pizza</li><li>Admin who can provide support for any issues</li><li>The delivery guy checks the address of the customer in the system to deliver the pizza.</li></ul><p>All these above-mentioned black box techniques are more likely to achieve higher test coverage and catch defects.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>2. White Box Testing Technique</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_lFsSve0h0YcNYDDCkHrpw.png" /><figcaption>White-box test techniques concentrate on the structure and processing within the test object.</figcaption></figure><p><strong>White box testing</strong> is a <strong>structure-based technique</strong> based on an analysis of the architecture, detailed design, internal structure, or code of the test object. Unlike black box testing, it concentrates on the structure and processing within the test objects.</p><h3><strong>WHY?</strong></h3><p>💡 The <strong>purpose</strong> of having <strong>white box testing</strong> is to</p><ul><li>Improve Security</li><li>Improve performance and efficiency</li><li>Test the flow of inputs and outputs</li><li>Improve design and ease of use</li></ul><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2HRXoyPUP1TGDCErQgY-ZQ.png" /></figure><p>When we want to buy things online using a payment gateway that brings us to our selected bank web application.</p><p>The bank web application will have return login codes from different authentication or validation services, then the bank web application will contact the payment gateway.</p><p>The payment gateways will talk to the bank application using messages/response codes.</p><p>All these messages or codes are not directly visible to the end user but are part of the bank web application’s internal communication.</p><p>🚨Hence,<strong> the tester may need to write tests to verify whether the correct response status codes/messages are sent to the payment gateway</strong>.</p><p>🚨 Not only that, the <strong>tester may need to verify that the bank web application is responding as expected when received, corresponding to the status code returned from the payment gateway</strong>.</p><p><strong>🚀 White box testing involves checking the internal structure, flow, and source code of the application.</strong></p><h3>🚀 Types of White Box Testing Techniques</h3><p>The major techniques that help you run the white box tests successfully are:</p><ul><li><strong>✅ Statement testing and coverage:</strong> This technique makes sure that each line of code is tested. <strong>Coverage</strong> is measured as the number of statements executed by the tests divided by the total number of executable statements in the test object, normally expressed as a <strong>percentage</strong>.</li><li><strong>✅ Branch and Path coverage:</strong> This technique ensures that all branches/paths (for example, true or false) are tested.</li><li><strong>✅ Decision Testing and coverage: </strong>This exercises the decisions in the code and tests the code that is executed based on the decision outcomes. To do this, the test cases follow the control flows that occur from a decision point (e.g., for an <strong>IF statement</strong>, one for the true outcome and one for the false outcome; for a <strong>CASE statement</strong>, test cases would be required for all the possible outcomes, including the default outcome).</li></ul><h3>Let’s Recap :</h3><ol><li><strong>Black box testing</strong> focuses on evaluating the functionality of a software application without any knowledge of its internal workings. Testers approach the software as external users, using inputs and outputs to verify whether the system performs as expected.</li><li><strong>White box testing</strong> involves analyzing the internal structure and logic of a software application. Testers have knowledge of the code and can evaluate individual components or the system as a whole.</li></ol><h3>✅ Related Articles:</h3><ol><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725?source=user_profile---------1----------------------------">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50?source=user_profile---------0----------------------------">AWS ! the terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884?source=your_stories_page-------------------------------------">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li></ol><h3>✅</h3><p><em>Or connect with me on </em><a href="https://www.linkedin.com/in/alan-liew/"><strong><em>LinkedIn</em></strong></a><em> to discuss more!</em></p><p>#Softwaretesting #softwaretestere #SDLC #STLC #ISTQB #Java101 #SeleniumJava #blackboxtesting #whiteboxtesting</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d6b2c0960a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run your selenium test in Docker! (With selenium grid)]]></title>
            <link>https://alanliew.medium.com/run-your-selenium-test-in-docker-with-selenium-grid-31c0b6612c71?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/31c0b6612c71</guid>
            <category><![CDATA[selenium-webdriver]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-image]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Mon, 20 Mar 2023 06:56:05 GMT</pubDate>
            <atom:updated>2023-03-20T07:25:06.761Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wPl441LZB1fuuDcCE_LiZQ.png" /></figure><p>Well, this article assumes you’ve got the fundamentals of basic Docker command, how containers and between them work together.</p><p>(If you’re not, you can read these articles here</p><ol><li><a href="https://keanoon03.medium.com/docker-networking-the-only-article-you-need-to-read-6ae4b6b4b98?source=user_profile---------0----------------------------">Docker Networking 🌎 (The only article you need to read)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52?source=user_profile---------1----------------------------">“Understand what Docker is in 5 minutes: Challenged Accepted”</a></li></ol><h3>✅ First, we start with the question WHAT and WHY?</h3><p><a href="https://www.selenium.dev/documentation/grid/getting_started/"><em>Selenium Grid</em></a><em> allows the execution of WebDriver scripts on remote machines by routing commands sent by the client to remote browser instances.</em></p><p><a href="https://www.selenium.dev/documentation/grid/applicability/"><em>Selenium Grid</em></a><em> provides an easy way to run tests in parallel on multiple machines. Allow testing on different browser versions and enable cross-browser testing.</em></p><h3>✅ Is it worth using Selenium Grid?</h3><p>Selenium Grid runs test suites in parallel against multiple machines (called Nodes).</p><p>Execution time can be expressed as a simple formula:</p><p>Number of Tests * Average Test Time / Number of Nodes = Total Execution Time</p><pre>15      *       45s        /        1        =      11m 15s   // Without Grid<br>15      *       45s        /        5        =      2m 15s    // Grid with 5 Nodes<br>15      *       45s        /        15       =      45s       // Grid with 15 Nodes<br>100      *       120s       /        15       =      13m 20s   // Would take over 3 hours without Grid</pre><p>As you can see in the diagram above, the time to execute tests with and without using Selenium Grid is huge.</p><p>With that, we knew that with Selenium Grid, we could run our test a lot faster.</p><h3>✅ Here are 2 Methods to use Selenium Grid</h3><ol><li>Run the <a href="https://www.selenium.dev/documentation/grid/getting_started/#standalone">standalone</a> on your local machine, it is the easiest mode to spin up a Selenium Grid. By default, the server will listen for RemoteWebDriver requests on <a href="http://localhost:4444/">http://localhost:4444</a>.</li><li>Run the standalone on docker.</li></ol><p>In this article, we will only focus on how to run standalone on docker.</p><h3>✅ Run the standalone on docker.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*uu4YBwBjBZKVq_-sXdHZZQ.png" /><figcaption>Here is an example of (Hybrid Framework ) involving maven + testng in selenium Java</figcaption></figure><p>First, we will need to have a remote web driver and make sure it points to <a href="https://localhost:4444/">https://localhost:4444</a>, the default port for the selenium grid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Dc5YRYeX5z-ifIqwKS9Ow.png" /><figcaption>Desired Capabilities</figcaption></figure><p>We can create and initiate DesiredCapabilities. DesiredCapabilities are a set of key-value pairs encoded as a JSON object.</p><pre>DesiredCapabilities cap = new DesiredCapabilities();<br><br><br><br>cap.setBrowserName(&quot;chrome&quot;);<br>driver = new RemoteWebDriver(new URL(&quot;http://localhost:4444/&quot;), cap);</pre><p>And we named the browser chrome. Then create a RemoteWebDriver that points to the URL with the DesiredCapabilities.</p><p>Now, we can run this selenium grid in the docker container using the standalone image.</p><pre>docker run -d -p 4444:4444 -p 7900:7900 --shm-size=&quot;2g&quot; --name mymamatest seleniarm/standalone-chromium </pre><p>The above docker image is for Mac M1 / M2, you can choose the docker image <a href="https://hub.docker.com/r/selenium/standalone-chrome">here</a> if you’re using Mac Intel Chip / Windows OS.</p><p>Above command is to ask the docker to run this in detached mode, pointing it to the 4444 port and 7900 port (VNC) and assigning 2GB ram to this container with the seleniarm/standalone-chromium image.</p><p>One thing you have to make sure of is that you have started docker and that docker is running in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QSVbEHK2LGMIz6lfeqSWCA.png" /><figcaption>Here is how it should look when the container is started successfully.</figcaption></figure><p>Now navigate to <a href="https://localhost:4444/">https://localhost:4444</a> and <a href="https://localhost:4444/">https://localhost:</a>7900</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W6TfGf_N6DB5QJsnfinxMA.png" /><figcaption><a href="https://localhost:4444/">https://localhost:4444</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-QRZR73ktnGTBw89bE8Vlg.png" /><figcaption><a href="https://localhost:4444/">https://localhost:</a>7900</figcaption></figure><p>Now, run this command in the terminal.</p><pre>mvn test</pre><p>You will see the test is occupying your node and creating sessions in localhost:4444.</p><p>You can also log in to localhost:7900 with the default password of “secret” if you want to see how is the browser testing going in live.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4BJs3ZsblcMkl2RpDVjHw.png" /><figcaption>There is 1 session and 1 node being occupied.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7n5wL_ioBenWswXqU4g5Zw.png" /><figcaption>The VNC shows the live view of the test.</figcaption></figure><p>Ta-da, this is how you run tests using Selenium Grid in Docker container.</p><h3>✅ Related Articles:</h3><ol><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725?source=user_profile---------1----------------------------">Cloud Computing, let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50?source=user_profile---------0----------------------------">AWS ! the terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why is software testing needed in the first place?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as examples)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884?source=your_stories_page-------------------------------------">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes : Challenged Accepted”</a></li></ol><h3>✅</h3><p><em>Or connect with me in </em><a href="https://www.linkedin.com/in/alan-liew/"><strong><em>LinkedIn</em></strong></a><em> to discuss more !</em></p><p>#Softwaretesting #softwaretestere #SDLC #STLC #ISTQB #Java101 #SeleniumJava #docker #dockercontainer #dockerimage #docker101</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31c0b6612c71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Networking  (The only article you need to read)]]></title>
            <link>https://alanliew.medium.com/docker-networking-the-only-article-you-need-to-read-6ae4b6b4b98?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ae4b6b4b98</guid>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[docker-network]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-networking]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sat, 11 Mar 2023 07:01:30 GMT</pubDate>
            <atom:updated>2023-03-14T02:48:03.267Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e0N1UxuULOLUyMaDydEfzA.png" /></figure><p>We have talk about what is docker in the previous article. One thing we haven’t talk about is Docker Networking.</p><p>If you haven’t read the previous article, you can read it here. <a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52"><strong>Understand what is docker in 5 minutes</strong></a></p><p>Let’s get into it.</p><blockquote>How you can connect multiple containers ?</blockquote><blockquote>How is the containers talk to each other ?</blockquote><blockquote>How you could connect the application running in a container to your local machine ?</blockquote><blockquote>How could you connect to the world wide web from your containers.</blockquote><h3>We start off with What is networks / requests ?</h3><p>In many applications, you’ll need more than one container — for two main reasons:</p><ol><li><strong>It’s considered good practice to focus each container on one main task (e.g., run a web</strong><br>server, run a database, …)</li><li><strong>It’s very hard to configure a Container that does more than one “main thing” </strong>(e.g., run a web server AND a database)</li></ol><p>Multi-Container apps are quite common, especially if you’re working on “real applications.”</p><p>Often, some of these Containers need to <strong>communicate</strong> through:</p><ul><li>Either <strong>with each other</strong></li><li>Or with the <strong>host machine</strong></li><li>Or with the <strong>world wide web</strong></li></ul><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>Let’s get our hands dirty!</h3><p>This <a href="https://app.blackhole.run/#31cef4d5731HwuBZHMW11d6FF6Y4SzuDm2JZR4mFdfJo">node js application here</a> (Click to download), has a couple of dependencies and some custom code to build a web api.</p><p>A little background of this web application. This application returns data when requests are sent to web api.</p><p>It accepts GET requests to the api endpoint (‘/favorite’), (‘/movies) , (‘/people), and POST request (‘/favorite).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPM1JbrnsepHnl6YKr0DcQ.png" /><figcaption>/movies and /people</figcaption></figure><p>We are going to send the GET request to (‘/movies”), then fetch the data from the response and send it back using our own POST (“/favorite”) api to whoever requests this data.</p><p>And in this application, we also establish our connection to the MongoDB database, therefore, you will need a running MongoDB to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*xbcg0avJaedxmjmMOEi2Hw.png" /></figure><p>With that connection, we can store our data (our favorite movies, the response from GET “/movies”) into our database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*UqSGih_N2mmuLH2O086qsA.png" /><figcaption>To show all the favorite movies we have POST to the database.</figcaption></figure><p><strong>Step 1 : </strong>Now, we will build the using the docker file using</p><pre>docker build -t your-preferred-name .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1Z2u_-cNYTiassWcmKi_Q.png" /><figcaption>We have build a docker image using dockerfile successfully.</figcaption></figure><p>Next, we run the image using the container name demoapp in a detached mode and remove it when it did. Exposing it to port 3000: 3000 of our local machine because this app is using port 3000.</p><p><strong>Step 2 :</strong></p><pre>docker run --name demoapp -d --rm -p 3000:3000 favorites-node-app</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PQ_esM_VwcBqEjbmuMFedQ.png" /><figcaption>Our container has been created successfully with the image.</figcaption></figure><p>However, you will realize that the container is not running. Why?</p><p>To troubleshoot it, we run the docker container again in not detached mode, and you will see “MongoNetworkError,” which means the connection failed because MongoDB is not installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SYR3qKv9noibAEqunWAKNQ.png" /></figure><p>This is due to MongoDB is not installed in the container, and it failed to connect to the database.</p><p>Now, what if we installed MongoDB in our local machine and connected the container with that?</p><p>First, we go to <a href="https://www.mongodb.com/docs/manual/administration/install-community/">MongoDB</a> installation guide and install MongoDB on our local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DvHCH-tZxwTEpKMhXo3_uA.png" /><figcaption>In this case, I installed mongodb using brew and started the services successfully.</figcaption></figure><p>Then, we change the connection to <em>host.docker.internal.</em></p><p>What this code does is tell docker to look for that MongoDB in our local machine. This is the path that docker will understand automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lHM5lA4Oiy_iARUWK1s4dw.png" /><figcaption>mongodb://host.docker.internal/swfavorites</figcaption></figure><p>Now, if we rerun <strong>Step 1</strong> and <strong>Step 2</strong>, you will see the app is up and running now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6D_cD9hhGaQ2I1hbrBWuw.png" /></figure><p>Next, we are going to validate if the API works.</p><p>TA-DA! It works like a charm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mUrWjzQ4nEVZtJ5S2sX5Ag.png" /><figcaption>GET localhost:3000/movies</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sd8ZT5cdj7Xw3zdrUEV7YA.png" /><figcaption>POST localhost:3000/favorites</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxZYoCMSdEY3qzxdRp4UBA.png" /><figcaption>GET localhost:3000/favorites , this is what our mongoDB is storing.</figcaption></figure><h3>To recap, what does the above-mentioned step does?</h3><p>We are connecting the docker container to our host machine by using <em>host.docker.internal</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7KcCXht4IAvTdbzwurbZnA.png" /><figcaption>This is what we did in the previous step.</figcaption></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3><strong>Do you still remember why we failed to run MongoDB in the first place?</strong></h3><p>Yes, we did not have MongoDB installed.</p><p>But what if we only want to connect to the World wide web now? What if we only want our docker to make a connection to the internet?</p><p>Can try this out by changing the MongoDB code into a comment first, then we add “app. listen(3000)” to the above of it.</p><pre>app.listen(3000);<br><br>//mongoose.connect(<br>//  &#39;mongodb://host.docker.internal/swfavorites&#39;,<br>//  { useNewUrlParser: true },<br>//  (err) =&gt; {<br>//    if (err) {<br>//      console.log(err);<br>//    } else {<br>//      app.listen(3000);<br>//    }<br>//  }<br>//);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNVH6AsHBrqr1GXTtV0qFQ.png" /></figure><p>We run the docker image and container again.</p><pre>docker build -t favorite-node-app .</pre><pre>docker run --name connectwww -d --rm -p 3000:3000 favorites-node-app</pre><p>Then we send GET request to the /people and /movie again. The response should be returned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NLmfrl6yYgguTb2FdldQ4A.png" /></figure><h3>To recap, what does the above-mentioned step does?</h3><p>We connect the docker container to the world wide web by sending request via HTTP to the www. This is doable by default for docker. Nothing we need to configure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbqZQWRNqTx4llzt0ftOKg.png" /><figcaption>This is what we does in the previous steps.</figcaption></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>Lastly, we are going to connect our docker container to another docker container.</h3><p>Communicating with other Containers is also quite straightforward. You have two main options:</p><ol><li><strong>Manually find out the IP</strong> of the other Container (it may change, though)</li><li>Use <strong>Docker Networks</strong> and put the communicating Containers into the same Network</li></ol><p>Option 1 is not great since you need to search for the IP on your own, and it might change over time.</p><p>Option 2 is perfect, though. With Docker, you can create Networks via the docker network, and you can then attach multiple Containers to one and the same Network.</p><h3>Now, let’s go with Option 1.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JLd6PDIi5TwjyDNa1y0wg.png" /></figure><ol><li>We start and run a docker container named “MongoDB” with a mongo image.</li><li>We check whether the docker container is running using docker ps.</li></ol><p>However, we know this is not going to work, because our mongo db is still connecting to <em>host.docker.internal.</em></p><p>Hence, we need to change it.</p><p>What we do is</p><pre>docker container inspect mongodb </pre><p>and then we try to find the IP address from the network settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98QJzFQrd4GFtOavaCmm0g.png" /><figcaption>ip address under network setting</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*-afxOvZsGBuXASDGHvg7mA.png" /><figcaption>Then we change the host.docker.internal to ip address : 27017 (default port)</figcaption></figure><p>We run the docker image and container again.</p><pre>docker build -t favorite-node-app .</pre><pre>docker run --name mydemoapp -d --rm -p 3000:3000 favorites-node-app</pre><p>We will see that app up and running and be able to examine it with the postman.</p><h3>Option 2: We will create a network and put two containers under that network.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7RxtuHRNRKgN_IQnUWImQ.png" /></figure><pre>docker network create my-app-network   </pre><p>I created this docker network named my-app-network.</p><pre>docker run -d --name mongodb --network my-app-network mongo </pre><p>Then, I run my MongoDB using the mongo image and put it under the network that I created just now -&gt; my-app-network.</p><p>Lastly, rerun the docker build and run the images created using docker file as below:</p><pre>docker build -t favorite-node-app .</pre><pre>docker run --name myapp --network my-app-network -p 3000:3000 favorites-node-app</pre><p>Now, you can examine that by sending GET request to the /favorites endpoint, and it shall return you with an empty response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7KZtNl6bVrjv0aA6XdfU2A.png" /></figure><p>This is due to we created a new MongoDB in a separate container, and it should be empty.</p><h3>To recap, what does the above-mentioned step does?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YKBNSB0cYCGBe7HCt_X_g.png" /></figure><p>We are connecting our container that contains our app to another docker container that contains our MongoDB. With 2 options, we connect both of them using the IP address, or we put both of them under the same docker network.</p><h3>Related Articles:</h3><ol><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725?source=user_profile---------1----------------------------">Cloud Computing , let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50?source=user_profile---------0----------------------------">AWS ! the terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why software testing is needed in the first place ?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology ?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as example)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884?source=your_stories_page-------------------------------------">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li><li><a href="https://keanoon03.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52">“Understand what Docker is in 5 minutes : Challenged Accepted”</a></li></ol><p>❤️</p><p><em>or connect with me in </em><a href="https://www.linkedin.com/in/alan-liew/"><strong><em>LinkedIn</em></strong></a><em> to discuss more !</em></p><p>#Softwaretesting #softwaretestere #SDLC #STLC #ISTQB #Java101 #SeleniumJava #docker #dockercontainer #dockerimage #docker101</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ae4b6b4b98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Docker ? (With 5 minutues, You will learn all of it.)]]></title>
            <link>https://alanliew.medium.com/what-is-docker-with-5-minutues-you-will-learn-all-of-it-e5f91b98ad52?source=rss-ec49619323a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5f91b98ad52</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[docker-101]]></category>
            <category><![CDATA[automation-testing]]></category>
            <dc:creator><![CDATA[Alan Liew]]></dc:creator>
            <pubDate>Sat, 18 Feb 2023 04:56:14 GMT</pubDate>
            <atom:updated>2023-02-20T02:33:02.126Z</atom:updated>
            <content:encoded><![CDATA[<h3>“Understand what Docker is in 5 minutes : Challenged Accepted”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQn9ZKB2w4TidmVhaYkrTA.png" /><figcaption>Let me explain what is docker and why is it important.</figcaption></figure><h3>Let’s start with the WHY ?</h3><h3>.<br>Why Docker ?</h3><p>You may wondering why Docker gain so much success in such short period of time, and it seem like everyone is talking about docker.</p><p>To put in simply, <strong><em>Docker virtualize the virtual machine.</em></strong></p><p>🐳 Docker can virtualize the <strong>operating system</strong> (OS, eg : ubuntu, debian, centos ) , <strong>network, storage and resource allocation</strong>(or you can called it control groups).</p><h3>Next, what is a. container in Docker ?</h3><p>You can understand containers in Docker as a crazy fast light weight computer, and they have own OS, CPU ,memory and network. They are isolated and safe.</p><p>Let me demo it real quick here,</p><p>For example, to connect centos OS, we can pull the image from docker using docker pull centos.</p><pre>docker pull centos                       </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4l1uIM4YxPNvhOOFEpUQHQ.png" /><figcaption>You will see centos image are being pull from the docker hub.</figcaption></figure><p>then we create a container using this centos image ( this line of command is to create a docker container named “mydocker” that run in detached mode.</p><pre>docker run -d -t --name mydocker centos</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JgvM-Ay0JhGArgElUOjsAw.png" /><figcaption>You will see a random string as the response.</figcaption></figure><p>Next, let’s us check if the container is being created successfully .</p><pre>docker ps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VL_dbRhDfadupoWQ3qRqbg.png" /><figcaption>As you can see, the centos image is running in mydocker container now.</figcaption></figure><p>Now, let’s execute the container and open bash of centos. Boom , now you got it !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*aQoESloS6CJ0A3e3-5HR6g.png" /><figcaption>As centos is using bash as default command shell.</figcaption></figure><p>Voila, you understand how we pull the image (centOS) and then run it in a container now.</p><p>To understand the concept better, it’s like you installed centOS into your computer and run it as your operating system.</p><p>🐳 Docker is FUN !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFuiv0-pi5h5OAFdUrMw6g.png" /></figure><p>First, we pull alpine image from docker hub. Next, we run it in a docker container named “ohyeah”, then we check using docker ps to see if it’s created. Then, we execute the shell of the container (alpine).</p><p>Boom ! 🚀, another OS is inside your new container now.</p><p>Does it sound easy ? 🐳</p><h3>Let’s try with the REAL project now.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_pJ2qkzsD0iQql--KCZxA.png" /></figure><p>First, we go to <a href="https://hub.docker.com/r/thenetworkchuck/nccoffee">docker hub</a> and copy this command. <br><em>In docker , we can pull image:version from docker hub and run.</em></p><pre>docker pull thenetworkchuck/nccoffee:frenchpress</pre><p>Then, we create a docker container and map the port using -p 80:80</p><pre>docker run -t -d -p 80:80 --name realproject thenetworkchuck/nccoffee:frenchpress </pre><p>Now, go to your browser, hit to your localhost with port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ofRIJF7AyZ-WZ-tQTZN7w.png" /><figcaption>localhost:80</figcaption></figure><p>Voila, you will be able to see this webpage. 🏆🏆</p><blockquote>Important ! ! ! do you realise something ?</blockquote><p>Did u setup the website ? or alter any settings ? Do you need to install any program to run this webpage ?</p><p>The answer is no, you don’t have to do anything on that.</p><p><strong>You just pull the image and run it in a container.</strong></p><p>This is because container got its operating system , cpu processes, memory, settings, website configuration, etc etc. And we can move this docker container to aws to azure and it run the same.</p><p>The project example that we run just now are in this docker image :</p><pre>Debian-linux <br>NGINX -&gt; website + files<br>and all the dependencies</pre><p>The creator can just pack it into a docker image that can run anywhere. What we need to do is to pull the image and run it in a container.</p><h3><strong>Why is Docker so FAAAASSSTTTT? 🏎️</strong>🏎️</h3><p>First we have to understand the architecture behind it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*hezOFEFv08IkqkQLlqvqYg.png" /><figcaption>The difference of architecture of Virtual Machine and Docker Container.</figcaption></figure><p>As you can see here, docker is so fast because we are only using 1 linux kernel compared to VM if we create two VM (in this case).</p><h3><strong>It is SUPER lightweight ⚡️</strong>⚡️⚡️</h3><p>And due to the different linux kernel in VM , there are different guest operating system + hypervisor, which caused the VM to be very heavy.</p><p>Where in the case of Docker, everything is run and created by 1 docker engine. This caused docker to be super lightweight.</p><h3>The ultimate benefit of using Docker</h3><p>No matter you as a developer / tester, we can write and deploy it to a docker container, and we know it can run everywhere because everything the app needs will be in the docker container.</p><p>And docker container is isolated, where you can just install and update the needed part.</p><p>This solves the issue where the “code” works miracely in dev’s machine, and it’s unable to run on other machine. <br>With Docker, we know this will not happen anymore ! hoorayyy!</p><p>More to go ? Subscribe to my <a href="https://keanoon03.medium.com/">medium</a> , where I will share Docker Networking in the next !</p><p>❤️</p><h3>Related Articles:</h3><ol><li><a href="https://medium.com/@keanoon03/cloud-computing-lets-talk-about-it-part-2-264ea0d6725?source=user_profile---------1----------------------------">Cloud Computing , let’s talk about it [Part 2]</a></li><li><a href="https://medium.com/@keanoon03/aws-the-terms-you-must-know-e00833a29e50?source=user_profile---------0----------------------------">AWS ! the terms you must know 🤫</a></li><li><a href="https://keanoon03.medium.com/istqb-%EF%B8%8Fthe-software-testing-myth-do-you-need-that-a9565be8c163">ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?</a></li><li><a href="https://medium.com/@keanoon03/why-software-testing-is-necessary-in-the-first-place-1824c5408d">Why software testing is needed in the first place ?</a></li><li><a href="https://medium.com/@keanoon03/what-is-agile-methodology-%EF%B8%8F-a8c41ca9da1e">What is Agile Methodology ?</a></li><li><a href="https://keanoon03.medium.com/java-101-for-software-testing-a2e05a1cc82b">Java 101 for software testing (Using fruits and Vehicle as example)</a></li><li><a href="https://medium.com/@keanoon03/what-do-you-need-to-know-in-order-to-test-using-selenium-in-java-that-i-wished-somebody-told-me-8af65a846884?source=your_stories_page-------------------------------------">What do you need to know to test using Selenium in Java? (that I wished somebody had told me)</a></li></ol><p>❤️</p><p><em>or connect with me in </em><a href="https://www.linkedin.com/in/alan-liew/"><strong><em>LinkedIn</em></strong></a><em> to discuss more !</em></p><p>#Softwaretesting #softwaretestere #SDLC #STLC #ISTQB #Java101 #SeleniumJava #docker #dockercontainer #dockerimage #docker101</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5f91b98ad52" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>