<?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 Chong S. Lee on Medium]]></title>
        <description><![CDATA[Stories by Chong S. Lee on Medium]]></description>
        <link>https://medium.com/@chonglee30?source=rss-2346332f9545------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XT-fr6ZkdzsmVo-q</url>
            <title>Stories by Chong S. Lee on Medium</title>
            <link>https://medium.com/@chonglee30?source=rss-2346332f9545------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:08:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chonglee30/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[UI Test Strategy with Component Testing]]></title>
            <link>https://medium.com/@chonglee30/ui-test-strategy-with-component-testing-c45c4f9826b5?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/c45c4f9826b5</guid>
            <category><![CDATA[component-testing]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 23:06:41 GMT</pubDate>
            <atom:updated>2025-06-13T17:57:05.446Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*F1uMNFb43hTC42MQGE6kGQ.png" /></figure><p>Component testing focuses on verifying individual modules or components in isolation. Each component has certain visual and functional properties.</p><p><strong>Reason to test a component</strong><br>Button as an example<br>button looks good with an emoji, special character or a normal text and should be able to click.<br>Testing a component in isolation gives you a much wider set of options.<br>Also, if developers want to refactor component and want to get an immediate feedback on anything that might be broken. It is much easier to just render a component with an emoji, than go through your app looking for it. ​Testing a component in isolation can provide a lot of value, especially following cases:<br><strong>Case1: </strong>a<strong> </strong>form that validates a multitude of different inputs. How do you test that the form throws correct errors as well as correct Input cases</p><p><strong>Case2:</strong> a complex online calculator that converts and calculates a result based on different data. How would you test all of the edge cases?</p><p><strong>Case3:</strong> Complex component like date picker with all edge cases.</p><p>These cases can be achieved by e2e test approach by initial login page then once login and then landing home page and clicking through our app to get to the button with all network request and wait for response.<br>This approach is very ineffective and takes really long time to run to get to the button component. also, it will increase maintenance overhead tremendously and add another flaky test headache.</p><p>I believe other tools can test component testing as well, but what sets Cypress apart from other tools is it runs its component tests in a real browser. Also, you have all the power of Cypress API at hand for your component tests as well. You can click and type make assertions.</p><p>Here are examples</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*G-DuaBc8a4DCLt5pMKIB1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*qDdT5FHTbWB9_zcUmzIYhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*_6-3VdoiVFQI5eCTEeNm6w.png" /></figure><p>Basically, start, mount, then Test component and no network required and set up required. very fast feedback to developers. esp very useful when they refactor components and make sure nothing break their changes.</p><p>Great UI Test strategy is test as much scenarios using component testing including all possible positive and edge and negative cases. e2e testing to test critical business work flow.</p><p><strong>References:</strong><br><a href="https://www.youtube.com/watch?v=V-F80UzZAmA">Cypress Component vs E2E Testing | by Mark Noonan</a><br><a href="https://www.youtube.com/watch?v=At0BcOMOYT0">Component Testing: How we do it at Cypress</a><br><a href="https://applitools.com/blog/component-testing-in-cypress-what-is-it-and-why-its-important/">Component testing in Cypress</a><br><a href="https://dev.to/mbarzeev/react-component-testing-with-cypress-10-43oh">ReactJS Component Testing with Cypress</a><br><a href="https://www.cypress.io/blog/how-component-testing-changed-our-workflow-and-how-i-came-to-work-at-cypress">How Cypress Component Testing changed our workflow</a><br><a href="https://kailash-pathak.medium.com/how-to-handle-ui-components-using-playwright-bc3dd49fe4e9">Automate UI Components Elements Using Playwright</a><br><a href="https://www.youtube.com/watch?v=QdZuKKK7oD0">React Testing Library vs Cypress Component Testing</a><br><a href="https://www.youtube.com/watch?v=6BkcHAEWeTU&amp;t=3s">Cypress Testing with React — Simple Tutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c45c4f9826b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write Stable UI Tests with Application Tests]]></title>
            <link>https://medium.com/@chonglee30/write-stable-ui-tests-with-application-tests-18c408793bfc?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/18c408793bfc</guid>
            <category><![CDATA[contract-testing]]></category>
            <category><![CDATA[application-testing]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 17:47:50 GMT</pubDate>
            <atom:updated>2025-06-12T18:39:54.468Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*hsHR37H0r0Owo9RkKlkKoQ.png" /></figure><p><strong>Overview:</strong><br>I participated Frontend Nation 2025 online conference and I really liked “Stop Doing E2E Tests! Write Better Tests with Contract Tests” presentation by Markus Oberlehne. He presented front end testing strategy with faster and reliable test scripts. He demonstrated with playwright framework written in typescript. Normally, test/dev environment is not as powerful as production environment, so API response and processing speed is not as fast as production environment which lead to slow response and flaky tests. Flaky and huge maintenance overhead is always popular topic in test automation topic. This is one of way to reduce flaky tests and maintenance time. Using real browser, real user, and real requests , but you stub/mock API response. Basically, use contract-based stubs to test Front End Application. He used <a href="https://specmatic.io/">specmatic</a> to contract between Front End and Backend. Normally, it is ideal for micro-services architecture as some API services response return slowly. Services agree on API specifications and use real API contracts. If API is changed, then automatically detected.<br>Also, could deploy independently on both sides (Front End and BackEnd).<br>I have used similar approach to test front end using cypress with cy.intercept mock api response to test sorting both ascending and descending table data. Response JSON data is from the fixture folder and no need to worry about data being changed in the test environment by others. I know exact response data every times I run the tests, so I know whether data is correctly sorted either ascending or descending order.</p><p>Here are the info about this presentation.<br>Speaker: Markus Oberlehner<br><a href="https://goodvuetests.com/">https://goodvuetests.com/</a></p><p><a href="http://twitter.com/markus">@markus</a>.oberlehner.net<br><a href="https://markus.oberlehner.net/">https://markus.oberlehner.net/</a><br>Tool: <a href="https://specmatic.io/">specmatic</a><br>Github <a href="https://github.com/maoberlehner/talk-contract-testing-apps-frontend-nation-2025">Repo</a> <br>His talks on <a href="https://www.youtube.com/watch?v=2J194dDeLQg">contract testing</a><br>He also talked about : <a href="https://www.youtube.com/watch?v=vY9t6hNFhFc">Vitest or Cypress? Why not both?! at the vuejs.de Conf 2022</a></p><p><strong>References</strong><br><a href="https://www.youtube.com/watch?v=QFCHSEHgqFE">Don’t Do E2E Testing!</a><br>Code Example — contract testing with specmatic<br>Specmatic — <a href="https://www.youtube.com/watch?v=IhhgtgCSFec">Api contract testing</a><br><a href="https://www.youtube.com/watch?v=CVG6BrZDzOI">Early detection of API spec vs implementation mismatches</a><br><a href="https://www.youtube.com/watch?v=arfwmRNTwp0&amp;t=161s">Contract Testing example with Pact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18c408793bfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test Strategy with Solid Unit Test]]></title>
            <link>https://medium.com/@chonglee30/test-automation-strategy-with-solid-unit-test-80035b2cfe10?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/80035b2cfe10</guid>
            <category><![CDATA[test-strategy]]></category>
            <category><![CDATA[unit-test-cases]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 00:11:09 GMT</pubDate>
            <atom:updated>2025-06-13T17:48:34.658Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*aREebAhaOOUlwBKE0JNgaA.png" /></figure><p><strong>Overview</strong><br>For agile development environment, test automation is no longer good to have. We must have solid test automation as many organizations release new features to the production every 2 weeks. As features are growing every week, test cases are growing as well. Imagine if we have to execute them all manually; it will take months to execute them manually. Also, right test automation strategy is necessary. I have seen many projects where test automation doesn’t bring much Return on investment (ROI) value, so it is very important to tackle automation strategy with right approach. Quick test result feedback is necessary to all team members esp. developer; make sure not to break existing features, so quick test run time is important. <br>Most QA engineers might have heard test pyramid by Mike Cohn, but when they write automation scripts, they mainly focus on either integration and UI levels test automation. Unit test is developers’ job, but without really<br>understanding what is covered in the unit testing, it could easily lead to inverted test pyramid described in this articles with big maintenance overhead: <a href="https://mike-bland.com/2023/09/13/the-inverted-test-pyramid.html">https://mike-bland.com/2023/09/13/the-inverted-test-pyramid.html</a> <a href="https://ritesh-kapoor.medium.com/testing-automation-what-are-pyramids-and-diamonds-67494fec7c55">https://ritesh-kapoor.medium.com/testing-automation-what-are-pyramids-and-diamonds-67494fec7c55</a></p><p>It is really important for QA Engineer/SDET to coordinate with developers regarding unit test coverage although unit test is for developer testing. Because other than testing method/function, class for the unit test, many business logics tests can be included in the unit test.</p><p>I agree with this article that QA Engineer/SDET need to understand what has been covered in the unit test so that they do not over-test in order to avoid unnecessary duplicating logic and reduce test execution time and maintenance overhead. Also, help increase unit test coverage as developers likely not have thorough test coverage.<br><a href="https://medium.com/@sargsyanmariam901/why-test-automation-engineers-should-understand-unit-test-coverage-149b018ae63c">https://medium.com/@sargsyanmariam901/why-test-automation-engineers-should-understand-unit-test-coverage-149b018ae63c</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*k_CljXDmaNSWRwmLaYvUmQ.png" /></figure><p>As this article mentioned, we can cover business logic from unit test.<br>For example, following business rule “If a user is under 18, they can’t register for an account and age must be integer.”<br>Simple age check is best tested with unit tests. You can cover edge cases as well and will likely take 1 second to execute all these tests.<br>Age more than 18 like 21<br>Age exactly 18<br>Age 17<br>Edge Cases:<br>Age 0<br>Age -4<br>Age: 17.999999<br>Age: 18.000111<br>Age: 19.111111<br>Invalid age (integer) formats like string, special characters, etc.</p><p>Have one happy scenario and one negative scenario covered in the integration/UI test to ensure happy path is accepted and negative scenario throw right error message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*bWJMF8M3x9Tr8CpmUVKd7w.png" /></figure><p>I also wrote simple user input validator code <a href="https://github.com/chonglee30/UserInputValidator">https://github.com/chonglee30/UserInputValidator</a><br>Most of business logics tests are validated from the unit tests such as valid email, fields validation, etc. and can be verified by quick.</p><p>This article is another great example what cases to cover in the unit test and what other cases to cover in the integration tests:<br><a href="https://semaphoreci.medium.com/unit-testing-vs-integration-testing-test-automation-basics-f1b9bd83eb85">https://semaphoreci.medium.com/unit-testing-vs-integration-testing-test-automation-basics-f1b9bd83eb85</a></p><p><strong>Unit Testing</strong></p><pre>from app import add_numbers, multiply_numbers<br>class TestMathFunctions(unittest.TestCase):<br>    &quot;&quot;&quot;Unit tests for math functions with broad test cases.&quot;&quot;&quot;<br>    def test_add_numbers_valid(self):<br>        &quot;&quot;&quot;Test the add_numbers function with valid numeric inputs.&quot;&quot;&quot;<br>        # Test with positive integers<br>        self.assertEqual(add_numbers(1, 2), 3)<br>        # Test with negative integers<br>        self.assertEqual(add_numbers(-1, -1), -2)<br>        # Test with zero<br>        self.assertEqual(add_numbers(0, 0), 0)<br>        # Test with positive floats<br>        self.assertEqual(add_numbers(1.5, 2.5), 4.0)<br>        # Test with negative floats<br>        self.assertEqual(add_numbers(-1.5, -2.5), -4.0)<br>        # Test with mixed integer and float<br>        self.assertEqual(add_numbers(1, 2.5), 3.5)<br>        # Test with very large numbers<br>        self.assertEqual(add_numbers(1e20, 1e20), 2e20)<br>        # Test with very small numbers<br>        self.assertAlmostEqual(add_numbers(1e-20, 1e-20), 2e-20)<br>    <br>    def test_add_numbers_invalid(self):<br>        &quot;&quot;&quot;Test the add_numbers function with invalid (non-numeric) inputs.&quot;&quot;&quot;<br>        # Test with strings (letters)<br>        with self.assertRaises(TypeError):<br>            add_numbers(&#39;a&#39;, &#39;b&#39;)<br>        # Test with strings that look like numbers<br>        with self.assertRaises(TypeError):<br>            add_numbers(&#39;1&#39;, &#39;2&#39;)<br>        # Test with None<br>        with self.assertRaises(TypeError):<br>            add_numbers(None, 2)<br>        # Test with lists<br>        with self.assertRaises(TypeError):<br>            add_numbers([1, 2], 3)<br>        # Test with dictionaries<br>        with self.assertRaises(TypeError):<br>            add_numbers({&#39;a&#39;: 1}, {&#39;b&#39;: 2})<br>        # Test with boolean values<br>        with self.assertRaises(TypeError):<br>            add_numbers(True, False)<br>    def test_multiply_numbers_valid(self):<br>        &quot;&quot;&quot;Test the multiply_numbers function with valid numeric inputs.&quot;&quot;&quot;<br>        # Test with positive integers<br>        self.assertEqual(multiply_numbers(2, 3), 6)<br>        # Test with negative integers<br>        self.assertEqual(multiply_numbers(-2, -3), 6)<br>        # Test with positive and negative integers<br>        self.assertEqual(multiply_numbers(-2, 3), -6)<br>        # Test with zero<br>        self.assertEqual(multiply_numbers(0, 100), 0)<br>        # Test with positive floats<br>        self.assertEqual(multiply_numbers(2.5, 4), 10.0)<br>        # Test with negative floats<br>        self.assertEqual(multiply_numbers(-2.5, -4), 10.0)<br>        # Test with mixed integer and float<br>        self.assertEqual(multiply_numbers(3, 0.5), 1.5)<br>        # Test with very large numbers<br>        self.assertEqual(multiply_numbers(1e10, 1e10), 1e20)<br>        # Test with very small numbers<br>        self.assertAlmostEqual(multiply_numbers(1e-10, 1e-10), 1e-20)<br>    <br>    def test_multiply_numbers_invalid(self):<br>        &quot;&quot;&quot;Test the multiply_numbers function with invalid (non-numeric) inputs.&quot;&quot;&quot;<br>        # Test with strings (letters)<br>        with self.assertRaises(TypeError):<br>            multiply_numbers(&#39;a&#39;, &#39;b&#39;)<br>        # Test with strings that look like numbers<br>        with self.assertRaises(TypeError):<br>            multiply_numbers(&#39;1&#39;, &#39;2&#39;)<br>        # Test with None<br>        with self.assertRaises(TypeError):<br>            multiply_numbers(None, 2)<br>        # Test with lists<br>        with self.assertRaises(TypeError):<br>            multiply_numbers([1, 2], 3)<br>        # Test with dictionaries<br>        with self.assertRaises(TypeError):<br>            multiply_numbers({&#39;a&#39;: 1}, {&#39;b&#39;: 2})<br>        # Test with boolean values<br>        with self.assertRaises(TypeError):<br>            multiply_numbers(True, False)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*glO6GNSGQ3Hdl3o7UJIoBA.png" /></figure><p><strong>Result: </strong>only takes less 0.001 second</p><p><strong>Integration Testing</strong></p><pre>from app import app<br>class TestAppIntegration(unittest.TestCase):<br>    &quot;&quot;&quot;Integration tests for the Flask application.&quot;&quot;&quot;<br>    def setUp(self):<br>        &quot;&quot;&quot;Set up the test client.&quot;&quot;&quot;<br>        # Configure the app for testing<br>        app.config[&#39;TESTING&#39;] = True<br>        self.client = app.test_client()<br>    def test_add_endpoint(self):<br>        &quot;&quot;&quot;Test the /add endpoint with valid and invalid inputs.&quot;&quot;&quot;<br>        # Valid input test<br>        response = self.client.get(&#39;/add?a=10&amp;b=20&#39;)<br>        self.assertEqual(response.status_code, 200)<br>        self.assertEqual(response.get_json(), {&#39;result&#39;: 30.0})<br>        # Invalid input test (non-numeric values)<br>        response = self.client.get(&#39;/add?a=foo&amp;b=bar&#39;)<br>        self.assertEqual(response.status_code, 400)<br>        self.assertEqual(response.get_json(), {&#39;error&#39;: &#39;Invalid input&#39;})<br>        # Missing parameter test (missing &#39;b&#39;)<br>        response = self.client.get(&#39;/add?a=10&#39;)<br>        self.assertEqual(response.status_code, 400)<br>        self.assertEqual(response.get_json(), {&#39;error&#39;: &#39;Invalid input&#39;})<br>    def test_multiply_endpoint(self):<br>        &quot;&quot;&quot;Test the /multiply endpoint with valid and invalid inputs.&quot;&quot;&quot;<br>        # Valid input test<br>        response = self.client.get(&#39;/multiply?a=5&amp;b=4&#39;)<br>        self.assertEqual(response.status_code, 200)<br>        self.assertEqual(response.get_json(), {&#39;result&#39;: 20.0})<br>        # Invalid input test (non-numeric value for &#39;b&#39;)<br>        response = self.client.get(&#39;/multiply?a=5&amp;b=bar&#39;)<br>        self.assertEqual(response.status_code, 400)<br>        self.assertEqual(response.get_json(), {&#39;error&#39;: &#39;Invalid input&#39;})<br>        # Missing parameter test (missing &#39;b&#39;)<br>        response = self.client.get(&#39;/multiply?a=5&#39;)<br>        self.assertEqual(response.status_code, 400)<br>        self.assertEqual(response.get_json(), {&#39;error&#39;: &#39;Invalid input&#39;})<br>    def test_add_multiply_endpoint(self):<br>        &quot;&quot;&quot;Test the /add_multiply endpoint with valid and invalid inputs.&quot;&quot;&quot;<br>        # Valid input test<br>        response = self.client.get(&#39;/add_multiply?a=2&amp;b=3&amp;c=4&#39;)<br>        self.assertEqual(response.status_code, 200)<br>        self.assertEqual(response.get_json(), {&#39;result&#39;: 20.0})  # (2 + 3) * 4 = 20<br>        # Invalid input test (non-numeric value for &#39;a&#39;)<br>        response = self.client.get(&#39;/add_multiply?a=foo&amp;b=3&amp;c=4&#39;)<br>        self.assertEqual(response.status_code, 400)<br>        self.assertEqual(response.get_json(), {&#39;error&#39;: &#39;Invalid input&#39;})<br>        # Missing parameter test (missing &#39;c&#39;)<br>        response = self.client.get(&#39;/add_multiply?a=2&amp;b=3&#39;)<br>        self.assertEqual(response.status_code, 400)<br>        self.assertEqual(response.get_json(), {&#39;error&#39;: &#39;Invalid input&#39;})<br>    def test_calculate_route(self):<br>        &quot;&quot;&quot;Test the /calculate route for form submissions.&quot;&quot;&quot;<br>        # Test addition via form submission<br>        response = self.client.post(&#39;/calculate&#39;, data={<br>            &#39;operation&#39;: &#39;add&#39;,<br>            &#39;a&#39;: &#39;5&#39;,<br>            &#39;b&#39;: &#39;7&#39;<br>        })<br>        self.assertIn(b&#39;The result is: 12.0&#39;, response.data)<br>        # Test multiplication via form submission<br>        response = self.client.post(&#39;/calculate&#39;, data={<br>            &#39;operation&#39;: &#39;multiply&#39;,<br>            &#39;a&#39;: &#39;4&#39;,<br>            &#39;b&#39;: &#39;6&#39;<br>        })<br>        self.assertIn(b&#39;The result is: 24.0&#39;, response.data)<br>        # Test add and multiply via form submission<br>        response = self.client.post(&#39;/calculate&#39;, data={<br>            &#39;operation&#39;: &#39;add_multiply&#39;,<br>            &#39;a&#39;: &#39;2&#39;,<br>            &#39;b&#39;: &#39;3&#39;,<br>            &#39;c&#39;: &#39;5&#39;<br>        })<br>        self.assertIn(b&#39;The result is: 25.0&#39;, response.data)<br>        # Test invalid input via form submission<br>        response = self.client.post(&#39;/calculate&#39;, data={<br>            &#39;operation&#39;: &#39;add&#39;,<br>            &#39;a&#39;: &#39;foo&#39;,<br>            &#39;b&#39;: &#39;bar&#39;<br>        })<br>        self.assertIn(b&#39;Error: Invalid input provided.&#39;, response.data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*-GE334AY2JROCoq0QOhQMA.png" /></figure><p><strong>Result: </strong>takes 0.023 seconds<br>23 times slower compared to unit test</p><p>Integration Test cover end-to-end functionality validation, tests interactions between components (integrate correctly with the routes and handle data as expected), checks input validation and handles errors (ex: appropriate error messages and HTTP status codes)</p><p><strong>Conclusions</strong><br>Generally, when we find bugs from unit test, they are found in one or more places in the Changes, the Logic, the Assumptions, or the Contracts we made in the code. If we write a unit test that focuses on these four things, we are actually able to address bugs soon than later and, if it fails, the test will actually tell us WHAT broke and it is easy to address.<br>Maximize Unit Testing to test business logics and domain logics and without interacting with external dependencies are important and give quick feedback to the team members. <br>Integration Test can test further by using dependencies and can simulate real user behaviour, but a lot slower compared to unit test. we can supplement with Unit + Integration tests, but have cover more in the unit tests is important to have quick feedback to developers and less maintenance cost.</p><p>Other References: <a href="https://medium.com/@case_lab/testing-in-agile-3d7bc3b64b33">https://medium.com/@case_lab/testing-in-agile-3d7bc3b64b33</a><br><a href="https://medium.com/@continuousconfidence/confident-qa-unit-tests-vs-integration-test-what-vs-how-86fca28bb8a5">https://medium.com/@continuousconfidence/confident-qa-unit-tests-vs-integration-test-what-vs-how-86fca28bb8a5</a><br><a href="https://medium.com/@hannahanulur/the-test-pyramid-and-approaches-ca9b3af1a862">https://medium.com/@hannahanulur/the-test-pyramid-and-approaches-ca9b3af1a862</a><br><a href="https://medium.com/optivem/modern-test-pyramid-0a38a4285c4d">https://medium.com/optivem/modern-test-pyramid-0a38a4285c4d</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80035b2cfe10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Performance Testing]]></title>
            <link>https://medium.com/@chonglee30/performance-testing-0954694d653d?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/0954694d653d</guid>
            <category><![CDATA[performance-testing]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 22:18:55 GMT</pubDate>
            <atom:updated>2025-06-13T17:41:43.444Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Overview</strong><br>Performance testing is one of software engineering practices to evaluate how a system performs under different workloads and conditions. Also we can identify bottlenecks early and know how the system can handle real-world usage. There are various performance testing types. We can perform different types of performance testing using K6.</p><p>A. <strong>Load Testing</strong><br>Testing application under the <em>typical load</em>. Under the typical load, increase/decrease the load gradually <br>Typical Load: typical rush hour during the typical day; typical number of users. <strong>Empirical data</strong> is based on production data. <br>If not deploy to the production, then estimate number of expected users. <br>Ex: 300 users/day</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*yJ3_k9zQ7N_Hk18AL_PgbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLUpslp5dTmBhG3hY7bpAg.png" /></figure><p>Increase/decrease gradually; simulate how users behave.<br>Minimum Stages: but can have more stages.</p><pre>import http from &#39;k6/http&#39;;<br>import { sleep } from &#39;k6&#39;;<br><br>export const options = {<br>    stages: [<br>        {<br>            duration: &#39;5m&#39;,  // During 5 minutes<br>            target: 100      // Gragually increase Virtual users from 0 to 100<br>        },<br>        {<br>            duration: &#39;30m&#39;, // During 30 minutes<br>            target: 100      // Stay at 100 Virtual users<br>        },<br>        {<br>            duration: &#39;5m&#39;,  // During 5 minutes<br>            target: 0        // Gragually decrease Virtual users from 100 to 0<br>        }<br>    ]<br>}<br><br>export default function () {<br>    http.get(&#39;https://test.k6.io&#39;);<br>    sleep(1);<br>    http.get(&#39;https://test.k6.io/contact.php&#39;);<br>    sleep(2);<br>    http.get(&#39;https://test.k6.io/news.php&#39;);<br>    sleep(2);<br>}</pre><p>a. <strong>Ramp Up Stage</strong>: gradually increase # of users in 5 minutes (0-&gt;100 users)<br>can show possible first sign of weakness.<br>b. <strong>Stay Stage</strong>: stay 100 users for 30 minutes<br>c. <strong>Ramp Down Stage</strong>: gradually decrease #of users in 5 minutes (100 -&gt; 0 users)</p><p>Start with minimum stages configurations in K6: Scale Up/Down<br>Start with low value to gather data to check server resources to handle traffic. ex: 50 -&gt; 100 -&gt; 200 -&gt; 300 users</p><p><strong>Environment</strong>: Pre-Production (Staging) — mimic to the production<br>Typical time to run load testing:<br>1. Before deploy to the production after change the version of application<br>2. Infrastructure changes whether small or big change. will save a lot of time later.</p><p>How to Run Test Code: k6 run loadTest.js<br><a href="https://grafana.com/blog/2024/01/30/average-load-testing/"><strong>References: </strong>https://grafana.com/blog/2024/01/30/average-load-testing/</a><br><a href="https://grafana.com/blog/2024/01/30/average-load-testing/#average-load-testing-in-k6">https://grafana.com/blog/2024/01/30/average-load-testing/#average-load-testing-in-k6</a></p><p>B. <strong>Stress Testing</strong><br>After load testing and perform within acceptable limit, perform stress testing to test how application perform above normal conditions. it is similar to load testing, but main difference is increase the load. <br>Typical Scenario: Black Friday — more than normal users load</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2K5fV5cMqzQjlOcTa7rfw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_GjPy3xzWixXJy5AeQHgQ.png" /></figure><pre>import http from &#39;k6/http&#39;;<br>import { sleep } from &#39;k6&#39;;<br><br>export const options = {<br>    stages: [<br>        {<br>            duration: &#39;5m&#39;,<br>            target: 2000<br>        },<br>        {<br>            duration: &#39;30m&#39;,<br>            target: 2000<br>        },<br>        {<br>            duration: &#39;5m&#39;,<br>            target: 0<br>        }<br>    ]<br>}<br><br>export default function () {<br>    http.get(&#39;https://test.k6.io&#39;);<br>    sleep(1);<br>    http.get(&#39;https://test.k6.io/contact.php&#39;);<br>    sleep(2);<br>    http.get(&#39;https://test.k6.io/news.php&#39;);<br>    sleep(2);<br>}</pre><p>Data: <strong>Empirical data </strong>based on last year.<br>Watch Ramp Down Stage: performance comes back to normal value.<br>Pre-requisite: run only after successful completion of load testing<br>Recommendation: don’t start with high number; make sure load testing is performing as expected then increase the load gradually by 10, 20, etc.<br>See how application perform with different values.</p><p><strong>References</strong>: <a href="https://grafana.com/blog/2024/01/30/stress-testing/">https://grafana.com/blog/2024/01/30/stress-testing/</a><br><a href="https://grafana.com/blog/2024/01/30/stress-testing/#stress-testing-in-k6">https://grafana.com/blog/2024/01/30/stress-testing/#stress-testing-in-k6</a></p><p>C. <strong>Spike Testing<br></strong>Expected/unexpected sudden number of users<br>Suddenly increase/decrease the load of system<br>Ex: advertising new application product during the TV commercial time with big audience like super bowl</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IK8IAxuERAuVVbgfQVJlpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GAr9dRWKuFPbTPzMV0vn5g.png" /></figure><p>Application: # of users even above stress testing limit<br><strong>Ramp Up Stage: </strong>0 -&gt; 20,000 users all sudden<br>No in between stage<br><strong>Ramp down stage:</strong> 20,000 -&gt; 0 users all sudden<br><strong>Note1:</strong> can have more stages; this is simplistic version; <br>Assuming users normally visit first homepage of application instead of viewing all products.</p><pre>import http from &#39;k6/http&#39;;<br>import { sleep } from &#39;k6&#39;;<br><br>export const options = {<br>    stages: [<br>        {<br>            duration: &#39;2m&#39;,<br>            target: 20000<br>        },<br>        {<br>            duration: &#39;1m&#39;,<br>            target: 0<br>        }<br>    ]<br>}<br><br>export default function () {<br>    http.get(&#39;https://test.k6.io&#39;);<br>    sleep(1);<br>}</pre><p><strong>Note2: </strong>How to defind realistic spike value?<br>difficult to tell, but good starting point of spike test value: stress testing value*5<br>After system crash, can it automatically recover? or need manually fix by engineers?</p><p><strong>References:</strong> <a href="https://grafana.com/blog/2024/01/30/spike-testing/">https://grafana.com/blog/2024/01/30/spike-testing/</a><br><a href="https://grafana.com/blog/2024/01/30/spike-testing/#spike-testing-in-k6">https://grafana.com/blog/2024/01/30/spike-testing/#spike-testing-in-k6</a></p><p>D. <strong>Breakpoint Testing</strong><br>Determine maximum capacity of an application<br>Maximum load — load application handle without crash.<br>Pre-requisite: perform only after completion of load and stress testing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2SQUQFRuilJ7Hwnggx-iQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_urHhOTir1-TPrC6EXx9Q.png" /></figure><p>Similar to stress test; only difference is almost infinite scale up <br>only 1 stage</p><pre>import http from &#39;k6/http&#39;;<br>import { sleep } from &#39;k6&#39;;<br><br>export const options = {<br>    stages: [<br>        {<br>            duration: &#39;2h&#39;,<br>            target: 50000000<br>        }<br>    ]<br>}<br><br>export default function () {<br>    http.get(&#39;https://test.k6.io&#39;);<br>    sleep(1);<br>}</pre><p><strong>Note1:</strong> when to stop testing<br>extremely high error rate or unacceptable response time<br>write down numbers of users</p><p><strong>Note2: K6 </strong>not output metrics in the real time, but it can export to the file or send to the server and watch metrics in the real time<br><strong>Reference Site:</strong> <a href="https://grafana.com/blog/2024/01/30/breakpoint-testing/">https://grafana.com/blog/2024/01/30/breakpoint-testing/</a></p><p>E. <strong>Soak (Endurance) Testing</strong><br>Perform extended period of time<br>Similar to load testing, but stretch duration of time<br>Pre-requisite: perform after load testing; not make sense to test soak test if application cannot even handle 30 minutes of load testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lgd6IhJC3GVcwfWLI7W8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fN-VX2jkcfTybV4-zxtsA.png" /></figure><p>What we can determine from this testing:<br>a. Memory Leak: program hold memory for long time<br>b. Disk space unavailable: DB grow over time and log files are growing<br>c. Server Crash indeterministic and goes to offline</p><pre>import http from &#39;k6/http&#39;;<br>import { sleep } from &#39;k6&#39;;<br><br>export const options = {<br>    stages: [<br>        {<br>            duration: &#39;5m&#39;,<br>            target: 1000<br>        },<br>        {<br>            duration: &#39;24h&#39;,<br>            target: 1000<br>        },<br>        {<br>            duration: &#39;5m&#39;,<br>            target: 0<br>        }<br>    ]<br>}<br><br>export default function () {<br>    http.get(&#39;https://test.k6.io&#39;);<br>    sleep(1);<br>    http.get(&#39;https://test.k6.io/contact.php&#39;);<br>    sleep(2);<br>    http.get(&#39;https://test.k6.io/news.php&#39;);<br>    sleep(2);<br>}</pre><p><strong>Reference:</strong> Udemy k6-load-testing-performance-testing course</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0954694d653d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cypress Flaky Test Prevention PlugIns]]></title>
            <link>https://medium.com/@chonglee30/cypress-flaky-test-prevention-plugins-40793cae2694?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/40793cae2694</guid>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 19:12:50 GMT</pubDate>
            <atom:updated>2025-06-13T17:30:23.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*j6fA3ImwsJ-E9QeVb-MsdQ.png" /></figure><p><strong>Overview:</strong><br>I have used Cypress Framework to run UI (Front-End End-To_End) and API Backend Tests automatically. Also, I have used Cypress Framework to simulate End-To-End BackEnd business logic flow with APIs. I encountered flaky tests when I run either from UI or Backend API tests. Easiest way to wait is use static wait: cy.wait(10000), but this is the most abused cypress command to use as we don’t know when we get the respond back as sometimes we get very quick response when not many are using the system; other time we get very slow response when many are using the system. As mentioned in this <a href="https://dev.to/sebastianclavijo/the-most-abused-cypress-command-ever-cywaittime-15e0">article</a>, it is the most abused cypress command. When we reviewed pull request from others (mostly junior/intermediate level QA engineers), we suggested to use different way to wait for the system response. There are many different ways. Here are Cypress PlugIns helps me to use wait for the system response efficiently and overcome flaky tests.</p><p>1. <strong>cypress-wait-until plugIn</strong><br><a href="https://www.npmjs.com/package/cypress-wait-until">https://www.npmjs.com/package/cypress-wait-until</a><br>This plug-in wait until conditions are met.</p><p><strong>Example:</strong> API backend test example below.<br>After calling post creating item, I encountered delay to process creating item. Sometimes, it can take extra delay esp. busy time when many are using same endpoints and system at the same time.</p><p>Following example is after creating item, wait for item to be searched.</p><pre>searchBody = {<br> &quot;filters&quot;: {<br> &quot;item_id&quot;: itemId<br> }<br>}<br><br>cy.waitUntil(() =&gt; cy.searchItem(url, token, searchBody)<br> .then(response =&gt; response.body.length &gt; 0), {<br> errorMsg: `Item not found ${itemId}`, // overrides the default error message<br> timeout: 60000, // waits up to 60s, default to 5000<br> interval: 5000 // performs the check every 5s, default to 200<br>});</pre><p><strong>Note1:</strong> This dynamically wait up to 60 seconds and poll every 5 seconds to check if item is searchable once created item. When system is less busy, then it return quicker. This method is much preferable than static wait method.</p><p>2. <strong>cypress-recurse plugIn</strong><br><a href="https://github.com/bahmutov/cypress-recurse">https://github.com/bahmutov/cypress-recurse</a><br>This plug-in also wait until conditions are met.<br>I have used this plug-in to go to correct page from the pagination.</p><p>After creating item from the UI, I want to verify by searching created item.<br>UI Pagination is being used to search for items in the pagination.<br>Keep clicking pagination button until the right itemName is displayed.</p><pre>recurse(<br> function () {<br> cy.wait(&#39;@getItems&#39;);<br> cy.getByTestId(&#39;data-table-loading&#39;).should(&#39;not.exist&#39;);<br> return cy<br> .contains(&#39;[data-testid=&quot;data-table&quot;] tbody tr&#39;, itemName)<br> .should(Cypress._.noop);<br> },<br> $tRow =&gt; $tRow.length &gt; 0,<br> {<br>   delay: 1_000,<br>   limit: 100,<br>   timeout: 300_000,<br>   post() {<br>   cy.get(&#39;div[role=&quot;pagination&quot;]&#39;).click({<br>    force: true<br>   });<br>}<br>});</pre><p>Another great examples below using cypress-recurse to prevent flaky tests by appropriate waiting to meet right conditions<br>Avoid Flake when typing into the input elements Using cypress-recurse<br>Article Reference: <a href="https://glebbahmutov.com/blog/flaky-cy-type/">https://glebbahmutov.com/blog/flaky-cy-type/</a><br>Code Reference: <a href="https://github.com/bahmutov/cypress-recurse/blob/main/cypress/e2e/type-with-retries-spec.js">https://github.com/bahmutov/cypress-recurse/blob/main/cypress/e2e/type-with-retries-spec.js</a><br>Youtube Reference: <a href="https://www.youtube.com/watch?v=aYX7OVqp6AE">https://www.youtube.com/watch?v=aYX7OVqp6AE</a></p><p>Wait for the API to respond<br>Youtube Reference: <a href="https://www.youtube.com/watch?v=CU8C6MRP_GU">https://www.youtube.com/watch?v=CU8C6MRP_GU</a></p><p>Reload page until showing right text: <a href="https://github.com/bahmutov/cypress-recurse/blob/main/cypress/e2e/reload-page/reload-spec.js">https://github.com/bahmutov/cypress-recurse/blob/main/cypress/e2e/reload-page/reload-spec.js</a><br>Open Accordion Panels Until It Finds A Button To Click: <a href="https://www.youtube.com/watch?v=s2_467yUF2Y">https://www.youtube.com/watch?v=s2_467yUF2Y</a></p><p>3. <strong>cypress-map plugIn</strong><br><a href="https://github.com/bahmutov/cypress-map">https://github.com/bahmutov/cypress-map</a></p><p>Note: I have not used cypress map plugin (<a href="https://github.com/bahmutov/cypress-map">https://github.com/bahmutov/cypress-map</a>) for waiting element purpose, but this seems to be great way to wait for dynamic table row column data.</p><p><strong>Complex Find Table Rows</strong> Example<br>Two different solutions</p><p><strong>Solution1:</strong></p><pre>cy.get(&#39;table tr:has(td:nth-child(2)[data-testid=checked])&#39;)<br> .find(&#39;td:nth-child(1)&#39;)<br> .then(($el) =&gt; Cypress._.map($el, &#39;innerText&#39;))<br> .then((list) =&gt; list.map(Number))<br> .should(&#39;deep.equal&#39;, [23, 45])</pre><p><strong>Note1:</strong> this solution work if static table data, but it fail if table data is populated dynamically. Also, even though using cypress version 12 or above, split chains into multiple commands with cy then not query the commands and stop retry.</p><p><strong>Solution2:</strong> better solution with automatic retry</p><pre>cy.get(&#39;table tr:has(td:nth-child(2)[data-testid=checked])&#39;)<br> .find(&#39;td:nth-child(1)&#39;)<br> .map(&#39;innerText&#39;)<br> .map(Number)<br> .should(&#39;deep equal&#39;, [23, 45])</pre><p><strong>Note2:</strong> using cy.map is much better solution with multiple commands chains with automatic retry esp. when table data is populated dynamically.<br>Dynamic data population from API response is more realistic scenario.</p><p>Reference Link (Feb 7, 2023): <br><a href="https://www.youtube.com/watch?v=v4EwXbtb6Fo">https://www.youtube.com/watch?v=v4EwXbtb6Fo</a><br>Reference Code: <br><a href="https://glebbahmutov.com/cypress-examples/recipes/has-rows.html">https://glebbahmutov.com/cypress-examples/recipes/has-rows.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40793cae2694" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascrpt — Arrow Function]]></title>
            <link>https://medium.com/@chonglee30/javascrpt-arrow-function-aa3c5bbde2dc?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa3c5bbde2dc</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Mon, 28 Oct 2019 00:27:20 GMT</pubDate>
            <atom:updated>2019-10-28T00:27:20.930Z</atom:updated>
            <content:encoded><![CDATA[<h3>Javascrpt — Arrow Function</h3><p>What is <strong>Arrow Functions</strong>?<br>Clean modern javascript code.<br>Alternative way to create function in Javascript. <br>Special syntax. Ex: oneline function</p><p><strong>Different syntax to define it:</strong><br>1. Start with argument lists.<br>2. Arrow =&gt;<br>3. Wrap up with definitions our function body in curly braces.</p><p><strong>Great Features:<br></strong>* Short-hand Syntax: single line<br>* Different way to define function body that regular function cannot do it.</p><p><strong>Example Arrow Function Code:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21e75d26c8a2bf18e8ffc18985ee2c56/href">https://medium.com/media/21e75d26c8a2bf18e8ffc18985ee2c56/href</a></iframe><p>When to use regular functions instead of arrow functions?<br>1. Local functions do not bind to the <strong>argument variables</strong>. <br>2. Does not bind to <strong>this.</strong></p><p>Arguments exist only regular functions.</p><p><strong>Reference:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmrYMzpbFz18%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmrYMzpbFz18&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmrYMzpbFz18%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/54b205605e3035d07d9e75d29fe4d12f/href">https://medium.com/media/54b205605e3035d07d9e75d29fe4d12f/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa3c5bbde2dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which Tests Should We Automate]]></title>
            <link>https://medium.com/@chonglee30/which-tests-should-we-automate-f6e3b2286763?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6e3b2286763</guid>
            <category><![CDATA[test-automation]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Sat, 31 Aug 2019 22:03:48 GMT</pubDate>
            <atom:updated>2019-08-31T22:03:48.012Z</atom:updated>
            <content:encoded><![CDATA[<p>This interesting talk was presented by Angie Jones at the Sauce Con 2018 when she was working at the Twitter. On my last project, I was asked to automate manual test cases which were set to “Ready for Automation” by a manual tester, offshore automation lead, and test lead/manager for the project. Honestly, I was quite questionable what criteria they select as automation test cases, because a lot of test cases were duplicated and didn’t think some are necessary for automation candidates. Many existing scripts are failing. I hear many managers want to automate pretty much everything to reduce the regression testing cycle. Well, this is common problem for many teams. I am glad Angie Jones introduced this topic at the Sauce Con.</p><p>Here are area to consider for automation tests:<br>1. Require Maintenance: update automation scripts.<br>2. Require lots of execution time.<br>3. Redundant Automation: noisy</p><p>Automate the right things instead of everything. How do we know what to automate right things? Twitter App Profile feature as an example for this presentation.</p><p>Here are the test cases scenarios and guideline what test cases to automate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d2w0q3Tt6M0OMhgaPaaVOw.png" /></figure><p>1. <strong>G</strong>- <strong>G</strong>ut Feeling</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*aKyt8vwK8nVRH2_tXTXd3w.png" /></figure><p>2. <strong>R</strong>: <strong>R</strong>isk <br>Frequency: 1: not much 5: very frequently<br>Impact: 1: low impact 5: high impact</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*M_MqwII9U1LNsw4bVH923Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sB2daUPxzby1HdJAnKAg5Q.png" /></figure><p>3. <strong>V</strong>: <strong>V</strong>alue</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*csSkoRUitSZ1aU2cvJiL8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPbV_GHuZie6EFRoIytldA.png" /></figure><p>4. <strong>C</strong>: <strong>C</strong>ost-Efficiency</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*3CIlKKD6rZ22Kl52lJ7-yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cr7tADyAiwBPEEfUAuLRyA.png" /></figure><p><strong>Note:</strong> How quickly and easily can this test scenarios to be automated? Some easy, but takes long time due to lots of steps.</p><p>5. <strong>H</strong>: History</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*zV0yr8LsQxSfXUUS-JJ1Ig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OsOrhC7zkvk9_yxJhLxZCQ.png" /></figure><p>History: Maintenance update: score can change</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wdWGggXRTStm7dXoPUge1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4jwE1AbZzuIl3DJNL8YYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXctGYlgKyZnMxsD4N00rw.png" /></figure><p><strong>Reference:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVL-_pnICmGY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVL-_pnICmGY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVL-_pnICmGY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a79a453f47edb2ace6acad815a978dbc/href">https://medium.com/media/a79a453f47edb2ace6acad815a978dbc/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.slideshare.net%2Fslideshow%2Fembed_code%2Fkey%2FHkIhoVu61iUT3O&amp;url=https%3A%2F%2Ffr.slideshare.net%2Fsaucelabs%2Fwhich-tests-should-we-automate-by-angie-jones&amp;image=https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fwhichtestsshouldweautomatebyangiejones-180315012640-thumbnail-4.jpg%3Fcb%3D1521080444&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=slideshare" width="600" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/0686288e56b3ecc4bbee08e753f8fc25/href">https://medium.com/media/0686288e56b3ecc4bbee08e753f8fc25/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6e3b2286763" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Get Automation Included in Definition of Done in the Sprint]]></title>
            <link>https://medium.com/@chonglee30/how-to-get-automation-included-in-definition-of-done-in-the-sprint-20f39a6222f5?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/20f39a6222f5</guid>
            <category><![CDATA[software-test-automation]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 23:50:11 GMT</pubDate>
            <atom:updated>2019-08-25T23:50:11.301Z</atom:updated>
            <content:encoded><![CDATA[<p>“How to Get Automation Included in Your Definition of Done” — this topic was discussed at the Selenium Conference 2016 in London by Angies Jones who is one of my favourite test automation engineer to follow. I was in the team where I was responsible to automate from the backlog. Biggest challenge was lack of understanding domain knowledge. Many of test cases were written by testers who no longer worked at the company, so very difficult to understand business knowledge and test scenarios. I am glad Angie Jones brought up this topic. Automation is a set of criteria which team should agree to complete before a feature can be considered DONE. Otherwise, tech debt will increase if manually tested to pass the story. Here is the summary of her talk.</p><p><strong>Brief Summary</strong> <br>Angie Jones as she discusses agile-friendly approaches to test automation which will allow teams to close their sprints with automation in place. These automation techniques allow scrum teams to work smarter, not harder, and find bugs quicker with a more narrowed scope of the root cause, essentially leading to quicker resolution times. Angie will also walk through an example Story and demonstrate how to apply these techniques to ensure automation is <br>achievable within the sprint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*T1FSHhCDlTY43XGzV7yuSw.png" /></figure><ol><li>Collaborate with other players.</li></ol><p>1) Speak with B.A (Business Stakeholder). Ask questions like following: “what we are building? why are we building? what is the risk? what is the problem area? How customers are being used the product? what is the most important feature? etc.” Do we need to automate all scenarios below? — find out the most important scenario. Or include some other in regression group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*lZngPO7IRU_Wot_CcIzpAA.png" /></figure><p>2) Speak with Developer. Before developer start coding, draw the picture of UI and compare. Know different perspectives and compromise solution. Identify element: types of things we need; nice stable locators for elements. Idea: testable and can be automated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*gQVfHC32qp2_7a9UKIVTdA.png" /></figure><p>2. Automate Strategically<br>Take short cut and clever way — Automation Pyramid<br>Look at the DOM and see form and passing parameters. Use API to go to the appropriate page. Example below. No need to go to “Add to Cart” Page to test “Remove from Cart” feature. Call “Add To Cart” API then test “Remove from Cart” feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*36aM1Tsrtzqv4VQtxolbUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*guJ3L_fPwrljON0Nf8CwyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*rqCLAwc1chjbxdOJaCXblg.png" /></figure><p>3. Build Incrementally<br>Don’t try to build entire framework at once; build small and gradually.<br>TDD type of approach. Define test first like below and what framework should be there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*8YWkPMmqzu69JQ67ehpvVg.png" /></figure><p>Also, even if feature A-”Create Profile” button isn’t working, you could still work on “Create Profile” Page as much as possible, then next sprint, you have less task to work on when you work on “View Profile” feature story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*IpSGzy9NV-_Fqhk2JJqu0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*JEiLxJMtz0eRSwTVd64Eaw.png" /></figure><p>Here is the example of Definition of DONE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*OxKm9kdPtnmYae-8oa6Meg.png" /></figure><p>Here is the video from Selenium Conference — London 2016</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHaIoYFtuu-U%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHaIoYFtuu-U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHaIoYFtuu-U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5907af62b283a4fe0fb5f84d3b2f721d/href">https://medium.com/media/5907af62b283a4fe0fb5f84d3b2f721d/href</a></iframe><p><strong>2017 Quality Jam</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FhzeJ37G8EKg%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DhzeJ37G8EKg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FhzeJ37G8EKg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/11d90d11b4f848c07c4df061ee74c222/href">https://medium.com/media/11d90d11b4f848c07c4df061ee74c222/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20f39a6222f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Builder Design Pattern]]></title>
            <link>https://medium.com/@chonglee30/builder-design-pattern-7140421b8cb8?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/7140421b8cb8</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Thu, 01 Aug 2019 22:19:52 GMT</pubDate>
            <atom:updated>2019-08-01T22:19:52.067Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong> As I spend most time developing test automation scripts, I find myself need to know more about software design pattern to develop code more efficiently.</p><p><strong>Creational Design Patterns</strong><br>Object of a class: immutable (product instance)<br>Ex: string<br>property of object: not change once an object is created.<br>Use builder design pattern in multiple parts in order to build an object.<br><em>Immutable Class</em>: object’s state/properties cannot be changed once the object is created.</p><p><strong>What is a Builder?<br></strong>We have a complex process to construct an object involving multiple steps, then builder design pattern can help us.<br>In builder, we remove the logic related to object construction from “client” code &amp; abstract it in separate classes.</p><p>When do we use <strong>Builder Design Pattern</strong>?<br>- when you have a complex constructor<br>- when we have complex object that can be built in multiple simple steps.</p><p><strong>UML</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMAmU9tMetkCsyER1eABgg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yYZtoupJ-X6uEiqj4yx6sA.png" /></figure><p><strong>Product</strong>: final instantiate class object.<br><strong>ConcreteBuilder</strong>: already built objects from the builder.<br>build function: assemble object.<br>get method: getProduct which has already created.</p><p><strong>Director</strong>: Client: knows how to build a builder object.<br>builder object to create.<br>- Knows about the sequence of steps needed to create an object.<br>- In charge of calling methods of builder that build one part of final product at a time. <br>- Knows the steps and also the sequence in which these methods need to be called.</p><p><strong>Design</strong> Considerations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xkk2wU2B_AZjAHeXhVS9Gw.png" /></figure><p>Examples of Builder Design Pattern</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d_TC2Z7HCzaHK_U3CGzrPA.png" /></figure><p>Implement a <strong>Builder</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlBtiU7-hZIhbworzzjO-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rzX03trYYSESF0ttc9LDwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7WNsLmyiZrjf7ET-4cFLQ.png" /></figure><p><strong>User</strong> Class: entity class<br>object get from persistent layer and store into DB.<br><strong>Address</strong> Class: store inside User class<br><strong>Client</strong> class: Orange color (further enhancement)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*agQWHs49Q4XgK6t3q6px9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*aFIbwVv81Nrejt8HvfbnRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcrXWjzTSKSuUHY0JUjU9A.png" /></figure><p><strong>Builder Design Pattern </strong>Reference Sites:</p><ul><li><a href="https://dzone.com/articles/the-builder-pattern-for-class-with-many-constructo">The Builder Design Pattern in Java - DZone Java</a></li><li><a href="https://dzone.com/articles/design-patterns-builder">Builder Pattern Tutorial with Java Examples - DZone Java</a></li><li><a href="https://dzone.com/articles/creational-design-patterns-builder-pattern">Creational Design Patterns: Builder Pattern - DZone Java</a></li><li><a href="https://dzone.com/articles/design-patterns-the-builder-pattern">Design Patterns: The Builder Pattern - DZone Java</a></li><li><a href="https://dzone.com/articles/design-pattern-builder-pattern">Intro to Design Patterns: Builder Pattern - DZone Java</a></li><li><a href="https://www.geeksforgeeks.org/builder-design-pattern/">Builder Design Pattern - GeeksforGeeks</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7140421b8cb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java: main and Path and Classpath concepts]]></title>
            <link>https://medium.com/@chonglee30/java-main-and-path-and-classpath-concepts-c855e3b360de?source=rss-2346332f9545------2</link>
            <guid isPermaLink="false">https://medium.com/p/c855e3b360de</guid>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Chong S. Lee]]></dc:creator>
            <pubDate>Tue, 30 Jul 2019 21:57:36 GMT</pubDate>
            <atom:updated>2019-07-30T21:59:12.500Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction: </strong>As I build scripts using java, sometimes I just do the programming without really understanding the meaning of main method. As I went over this basic concept, I decided to write some basic concept about main. Also, I included basic concepts of path and classpath after I encountered “Error: could not find or load main class in Java” issue while writing small test program.</p><p><strong>public static void main(String[] args)</strong><br>This function is where the program starts its execution (entry point). Every word has a meaning to the JVM. JVM will always look for specific method signature to start running an application, and that would be public static void main(String args[]).</p><p><strong>public</strong> : Access modifier: globally available and made public so that JVM can invoke it from outside the class as it is not present in the current class.</p><p><strong>static</strong>: JVM can invoke it without instantiating the class. Static means it will compile with any static method but does not run until JVM find main with string array argument. Only one copy of the main function is available.</p><p><strong>void</strong>: a method does not return anything. As soon as main method terminates, java program terminates too.</p><p><strong>main</strong>: identifier that the JVM look for as the starting point of the java program.</p><p><strong>String[] args</strong>: command line arguments and an array of type String class. The name of the String array: args, but not fixed and user can name in place of it.</p><p><strong>Reference1:</strong> <em>when encounter running from the command line</em>:</p><p><a href="https://javarevisited.blogspot.com/2015/04/error-could-not-find-or-load-main-class-helloworld-java.html">Error: Could not find or load main class in Java [Solved]</a></p><p><strong>Reference Site:</strong></p><p><a href="https://www.geeksforgeeks.org/understanding-public-static-void-mainstring-args-in-java/">Understanding public static void main(String[] args) in Java - GeeksforGeeks</a></p><p><strong>Opinion:</strong></p><p><a href="https://www.youth4work.com/Talent/Core-Java/Forum/118313-what-is-meaning-of-public-static-void-mainstring-args">what is meaning of public static void main(string[] args)</a></p><p><strong><em>Path</em></strong><em> and </em><strong><em>Classpath</em></strong><em> differences</em>:<br>a. <strong>Path</strong>: <br>a) environment variable which is used to locate JDK binaries (system executable commands) ex: java, javac<br>b) Use by OS to find any binary command.<br>c) include JDK_HOME/bin directory in path environment variable.<br>d) Not overridden by any java settings.</p><p>b. <strong>Classpath</strong>:<br>a) Only used by Java Class Loader to load class files.<br>b) environment variable which is used by system/Application class loader to locate and load compile Java byte codes stored in the class file.<br>c) include all those directories you put .class or jar files which are required by java application<br>d) Can be overridden by commandline options.</p><ul><li><a href="https://www.java67.com/2012/08/what-is-path-and-classpath-in-java-difference.html">What is PATH and CLASSPATH in Java - Path vs ClassPath</a></li><li><a href="https://javarevisited.blogspot.com/2011/01/how-classpath-work-in-java.html">How to Set Classpath for Java on Windows and Linux</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c855e3b360de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>