<?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 Peerapong Toworakajornkul on Medium]]></title>
        <description><![CDATA[Stories by Peerapong Toworakajornkul on Medium]]></description>
        <link>https://medium.com/@zillapeee?source=rss-d79be4003d8a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dIaDFIs4-BOfOvTt.</url>
            <title>Stories by Peerapong Toworakajornkul on Medium</title>
            <link>https://medium.com/@zillapeee?source=rss-d79be4003d8a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:44:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zillapeee/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[ความเข้าใจในการใช้ Suite Setup , Suite Teardown , Test Setup , Test Teardown ใน Robot Framework]]></title>
            <link>https://medium.com/thinknet-engineering/%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B9%83%E0%B8%88%E0%B9%83%E0%B8%99%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89-suite-setup-suite-teardown-test-setup-test-teardown-%E0%B9%83%E0%B8%99-robot-framework-9542022f84df?source=rss-d79be4003d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9542022f84df</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[robot-framework]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[testers]]></category>
            <category><![CDATA[automation-testing]]></category>
            <dc:creator><![CDATA[Peerapong Toworakajornkul]]></dc:creator>
            <pubDate>Wed, 17 Oct 2018 09:20:23 GMT</pubDate>
            <atom:updated>2018-10-17T09:20:23.604Z</atom:updated>
            <content:encoded><![CDATA[<h3>ความเข้าใจในการใช้ Suite Setup , Suite Teardown , Test Setup , Test Teardown ใน Robot Framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*TrAdPVcCUst3kiXNRInrYA.png" /></figure><p>เคยไหมที่สับสนการใช้ Suite Setup , Suite Teardown , Test Setup และ Test Teardown ใน Setting ของเรา ถ้าจะให้อธิบายสั้น ๆ ง่าย ๆ การทำงานของแต่ละตัว</p><blockquote>Suite Setup = ก่อนที่จะเริ่ม Run Test ทั้งหมด จะต้องเริ่มการทำงานตัวนี้ก่อน</blockquote><blockquote>Suite Teardown = หลังจาก Run Test เสร็จทั้งหมดแล้วจะสั่งให้ทำอะไรตอนสุดท้าย</blockquote><blockquote>Test Setup = ก่อนที่จะเริ่มเข้า Test Case ให้เริ่มการกระทำนี้ก่อน</blockquote><blockquote>Test Teardown = หลังจากจบ Test Case แต่ละ Case ให้ทำการกระทำนี้</blockquote><p>4 คำสั่งนี้ ไม่จำเป็นที่จะต้องมีใน Settings ของเราก็ได้ ถ้า Test Case ที่เราออกแบบมา ค่อนข้างที่จะเป็นอิสระ หรือ Case ที่จะทำมีแค่ Case เดียวก็ไม่ต้องมี 4 คำสั่งก็ได้</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0aa668afc2fb93274e21f610c4d547b/href">https://medium.com/media/b0aa668afc2fb93274e21f610c4d547b/href</a></iframe><p>แบบด้านบนก็สามารถรันได้เหมือนกันใช่ไหมครับ? แต่ถ้าเราเอา Step ใน Case ไปไว้ใน Setttings ล่ะ จะทำให้ Code เราอ่านง่ายกว่าหรือเปล่า?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2aff0d3abd883dbab0eb60846d675638/href">https://medium.com/media/2aff0d3abd883dbab0eb60846d675638/href</a></iframe><p>อย่างรูปด้านบนก็จะรู้ได้ว่า ก่อนที่จะเริ่ม Run Test ทั้งหมดเนี่ย ให้เริ่มทำการเปิด Browser ก่อน <strong>(Suite Setup)</strong> แล้วพอจบ Test ให้ทำการ ปิด Browser นี้ซะ <strong>(Suite Teardown) </strong>ก็ดูเข้าใจง่ายขึ้นไปอีก</p><p>∴ กรณีหากเรามี Case แค่ Case เดียวอาจจะไม่จำเป็นที่จะต้องใช้ Test Setup กับ Test Teardown ก็ได้ เพราะว่าเราสามารถใช้ Suite Setup ในการเริ่มต้น และ Suite Teardown ในการจบการกระทำเลยก็ได้</p><p>แล้วถ้าเรามีหลายๆ Case ล่ะ ทำไงดี?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e59d5e7f814416b35830efb68657dc4/href">https://medium.com/media/9e59d5e7f814416b35830efb68657dc4/href</a></iframe><p>กรณีที่เรามี Case เยอะๆ แล้ว flow การทำงานเหมือนกันทุก Case อย่างเช่น กรณีด้านบน คือการตรวจสอบการ Log in ของ Gmail. flow การทำงานของมันคือ</p><ul><li>เริ่มต้น Run File นี้โดยเปิดเว็บ google <strong>(Suite Setup : เปิด Browser)</strong></li><li>เริ่มต้นก่อนเข้า Case คือการไปหน้า Log in <strong>(Test Setup : คลิกปุ่ม ลงชื่อเข้าสู่ระบบ )</strong></li><li>ตอนจบ Case ต้องกลับมาหน้าแรก เพื่อเริ่มต้นการทำงานใน Case ใหม่ได้ <strong>(Test Teardown : ไปที่ </strong><a href="http://www.google.com)/"><strong>www.google.com)</strong></a></li><li>พอเริ่ม Case ที่ 2 3 4 5 6 หรือ Case ที่ 100 มันก็จะเริ่ม Test Setup ก่อนเข้า Case และจบ Case ให้ Test Teardown</li><li>จบ Case สุดท้าย ก็ให้ปิด Browser นั่นซะ <strong>(Suite Teardown : ปิด Browser)</strong></li></ul><p><strong>Trick :</strong> สมมติว่า Test Case เราเนี่ยมี Pre-Condition ที่มี Step เหมือนกันทุก Test Case ก็ควรเอา Step นี้อยู่ใน Test Setup ซะ</p><blockquote>ข้อดีของมันก็คือการลด Line of Code แล้วแน่ ๆ เห็นไหมว่า ถ้ามันมี Flow ที่มี Step แบบนี้ เป็นร้อย ๆ Case แล้วมี Test Setup , Test Teardown เข้ามาช่วย เราจะสามารถลดบรรทัดได้เป็น 200 บรรทัดเลยนะ</blockquote><p>หวังว่าบทความนี้จะเป็นประโยชน์ไม่มากก็มาก เอ้ย!! ไม่มากก็น้อยสำหรับทุกคน หากผิดพลาดประการใดขออภัยมา ณ ที่นี้ด้วยครับ ขอบคุณครับผม</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9542022f84df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thinknet-engineering/%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B9%83%E0%B8%88%E0%B9%83%E0%B8%99%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89-suite-setup-suite-teardown-test-setup-test-teardown-%E0%B9%83%E0%B8%99-robot-framework-9542022f84df">ความเข้าใจในการใช้ Suite Setup , Suite Teardown , Test Setup , Test Teardown ใน Robot Framework</a> was originally published in <a href="https://medium.com/thinknet-engineering">THiNKNET Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สรุปบทที่ 7 เรื่อง Unit Testing in the Browser with Javascript จากหนังสือ The Way of the Web Tester]]></title>
            <link>https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%88-7-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-unit-testing-in-the-browser-with-javascript-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-2e1ed2fe8398?source=rss-d79be4003d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e1ed2fe8398</guid>
            <category><![CDATA[testers]]></category>
            <dc:creator><![CDATA[Peerapong Toworakajornkul]]></dc:creator>
            <pubDate>Thu, 14 Sep 2017 10:05:45 GMT</pubDate>
            <atom:updated>2017-09-14T10:24:10.728Z</atom:updated>
            <content:encoded><![CDATA[<p>ปัจจุบันนี้ Javascript ถือว่ามีบทบาทสำคัญในเว็บในทุกๆวันนี้ และในบทนี้ถ้าอ่านจะทำให้รู้ว่าจะเขียนtest ด้วย Javascript อย่างไร? ในบทนี้สำหรับ Developer จะเป็นบทที่ดีสำหรับตัวเองในการเขียน JavaScript และมองหาไอเดียใหม่ๆในการทำ test อย่างไร สำหรับ Tester ก็ดีเหมือนกัน คุณอาจจะได้รู้อะไรเบื้องต้นในการที่จะเริ่มเขียน Javascript ในการทำ Automated Testing</p><h3><strong>Magic in the Browser</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*VT_3l1yoGp8sSzBdqhNvSQ.png" /></figure><blockquote>The Magic of Ajax<br>Ajax (Asynchronous Javascript and XML) เป็นเทคนิคที่ทำการรับส่งข้อมูลระหว่าง Client กับ Server ได้โดยที่เราไม่ต้องทำการ Refresh หน้า Browser หลักการทำงานของ Ajax คือจะมี Javascript ชุดหนึ่งจะทำหน้าที่ Request ข้อมูลจากทาง Server ผ่านทาง XMLHttpRequest และทำการนำค่าที่ได้นั้นออกมาแสดงที่หน้า Browser อีกที โดยข้อมูลที่จะรับเข้ามานั้นจะเป็น XML หรือว่าเป็น Text plan ธรรมดาก็ได้</blockquote><h3>Javascript แตกต่างจาก Ruby อย่างไร แล้วมันทำงานขนาดไหน?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*DgmmKsC_jAEov-66L0_GnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*pCjuKmM1Oh97c-nV4gOCnw.png" /></figure><p>เจ้าตัว Ruby เนี่ยจะรันอยู่บน Server การรันบน Server หมายความว่ามันจะมี Request เข้ามา แล้วเจ้า Ruby ก็ทำอะไรบางอย่างเพื่อที่จะได้ผลลัพธ์ออกมาแล้วส่งกลับไป ทั้งหมดของเหตุการณ์เนี่ยเกิดขึ้นที่ Server ทั้งหมด</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*MWFpIzSDunYUovwqldq44A.png" /></figure><p>แต่ในทางกลับกันเจ้าตัว Javascript เนี่ยจะรันอยู่ในฝั่ง Client หมายความว่าการกระทำทั้งหมดใน Browser ทั้งหมด นั่นจึงบอกว่า ทำไม Javascript มันถึงเร็ว เพราะทุกอย่างมันทำงานบน Device</p><p>ในส่วนของบทนี้ก็จะเขียน Unit Tests ด้วย Javascript ในฝั่ง Cilent อย่างไร?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*4UiKrqqzE3ABaSQEZkZCaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*AV3h1saNRIVzsFbD9iKKJQ.png" /></figure><blockquote><a href="http://honglub.com/web-applications/html-dom-tutorial/">DOM (Document Object Model) <br>คือการจัดเอกสาร HTML ให้อยู่ในรูปแบบของ DOM Tree โดยนิยาม objects และ properties เพื่อให้โปรแกรมหรือสคริปต์ สามารถปรับเปลี่ยนโครงสร้าง, ข้อมูล และ styles ของ HTML DOM ผ่าน methods ได้</a></blockquote><p>นี่ก็เป็นรูปของโปรแกรม Javascript ที่ฝังอยู่ใน HTML page <br>และนี่ก็เป็นโค้ดของเจ้าตัวโปรแกรมนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*0hhHkBOlYhR68bF4jINVBg.jpeg" /></figure><h3><strong>JavaScript and the Pyramid</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*es-7nzuZrsgKSGhSMCCp4g.png" /></figure><p>ถึงแม้ว่าเราจะ Test UI แต่จริงๆแล้วเราก็อย่าลืมที่จะทำการ test ตั้งแต่ Unit tests <br>แต่จริงๆแล้ว UI Test ไม่จำเป็นที่จะต้องทำ end-to-end อยู่ตลอด ในความเป็นจริง เราอาจจะทำอะไรให้มันดีขึ้น ให้มันไวขึ้นได้ให้รันแบบ localในตัวของ UI มันเอง <br>จึงบอกได้ว่า UI Tests เนี่ยอยู่บนสุดของพีระมิดนะ</p><h3>ใครก็ได้ช่วย Dave หา Bug หน่อย</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*8bc-TNlZGxNO7rYst_3RzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*EogGdmMZyLTmqZ1yrJfjsA.png" /></figure><p>จากรูปด้านบนไฮไลท์คนทางฝั่งขวา แล้วกดลูกศรไปทางซ้าย แล้วมันไม่เกิดอะไรขึ้น ทำไมมันถึงไม่อัพเดทละ มาดูกันว่าขั้นตอนควรทำยังไงกัน</p><blockquote>Step 1 : Scan the HTML</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*q8hV_s5UDYKBqULMpkWTow.png" /><figcaption>กำหนด ID ให้กับทุก element</figcaption></figure><blockquote>Step 2 : Check the Javascript</blockquote><blockquote>Step 3 : Write the Tests</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*CIr1HC-whKqg0ko9Oar7tQ.png" /><figcaption>Test Function ในการเก็บข้อมูล Model 4 ตัว</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*ABxhGS4UAjqC6l2K833_CA.png" /><figcaption>การ Set function ให้กับปุ่มลูกศร แล้วก็ปุ่มSave</figcaption></figure><p>ถ้าอยากรู้ว่า Code ของ Step พวกนี้เป็นยังไง ลองหาหนังสือเล่มนี้มาอ่านดูนะครับผม</p><h3>มาต่อกันเรื่อง Static vs. Dynamic Typing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*y2mgskXo8U-Q-lU3lK_Ypg.png" /></figure><blockquote>Static type คือ มีการรวมกันของ stage เป็นภาษาที่ต้องกำหนด type ในการประกาศตัวแปรเช่น c,c++,java, etc. และสามารถแก้ไขข้อผิดพลาดก่อนที่คุณจะรันโปรแกรม</blockquote><blockquote>Dynamic type คือ ไม่มีการรวมกันของ step ที่จำเป็น และมันง่ายต่อการรัน ภาษาที่ไม่ต้องกำหนด type ในการประกาศตัวแปรเช่น php,python,java script,etc.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*O9_6DxLCAx3a1BEdpSbKBw.png" /></figure><p>เป็นเรื่องที่ดีที่เราลองทำซ้ำและทดลองโค้ดให้มันรวดเร็วขึ้น โดยพื้นฐานถ้าเราพิมพ์อะไรบางอย่างผิด เราจะไม่สามารถหามันเจอ จนกว่าเราจะจับมันได้ใน Unit test หรือจนกว่าจะพบมันตอนที่อยู่บน Browser แล้วนั่นเอง</p><p>สิ่งสำคัญที่ได้จากบทนี้ก็คงจะเป็น<br>1.เราสามารถที่จะเขียน Unit test ได้ว่าอะไรจะเกิดขึ้นใน Browser <br>2.UI test ไม่จำเป็นที่จะ test แบบ end-to-end อยู่ตลอด<br>3.Javascript เนี่ยไม่ใช่ภาษาที่เป็น stactic type</p><p>Reference : <a href="https://pragprog.com/book/jrtest/the-way-of-the-web-tester">https://pragprog.com/book/jrtest/the-way-of-the-web-tester</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e1ed2fe8398" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%88-7-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-unit-testing-in-the-browser-with-javascript-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-2e1ed2fe8398">สรุปบทที่ 7 เรื่อง Unit Testing in the Browser with Javascript จากหนังสือ The Way of the Web Tester</a> was originally published in <a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3">นายไม่อ่านหนังสือ นายจะรู้อะไร</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สรุปบทที่ 5 เรื่อง Integration Testing RESTful Web Services จากหนังสือ The Way of the Web Tester]]></title>
            <link>https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%88-5-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-integration-testing-restful-web-services-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-33a4b0b8bd54?source=rss-d79be4003d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/33a4b0b8bd54</guid>
            <category><![CDATA[testers]]></category>
            <dc:creator><![CDATA[Peerapong Toworakajornkul]]></dc:creator>
            <pubDate>Thu, 14 Sep 2017 09:37:56 GMT</pubDate>
            <atom:updated>2017-09-14T10:23:36.917Z</atom:updated>
            <content:encoded><![CDATA[<p>จากท้ายบทที่4 จะมีการเกริ่นขึ้นมาถึง RESTful มาในบทนี้จะเป็นการบอกว่าเจ้า RESTful เนี่ยเป็นยังไงมีรายละเอียดอะไรบ้าง เรามาดูกัน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*nHOgHKAzVdoiWgkdnu2DSQ.png" /></figure><blockquote>จะทดสอบยังไงกันนนนนนนนนนนนนนนนนนนนนน</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*YdormLimJcr0qvHomQeoyQ.png" /></figure><p>Dave กับทีมของเขาเนี่ยก็ได้ใช้ RESTful API ในการพัฒนา โดยในการ test RESTful เนี่ยก็ได้มีเขียนทั้งหมด 4 รูปแบบ นั่นก็คือ GET , POST , PUT , DELETE</p><blockquote>เพิ่มเติมสักเล็กน้อย เรื่อง CRUD</blockquote><blockquote>CRUD เนี่ยเป็นตัวย่อมาจาก Create , Read , Update และ Delete การรู้ตัวย่อเพิ่มขึ้นทำให้มีประโยชน์ หากเราได้ยินคนอื่นพูดถึงเกี่ยวกับ APIs จะต้องมีการทำงานของ CRUD ซึ่ง CRUDเนี่ย การทำงานก็จะมีความคล้ายกับ RESTful ถ้าเปรียบเทียบก็คือ GET (Read) , POST(Create) , PUT(Update) , DELETE(Delete)</blockquote><blockquote>อีกสักเรื่อง RESTful คืออะไร?</blockquote><blockquote><a href="https://saixiii.com/what-is-restful/">เป็นการสร้าง webservice ชนิดหนึ่งที่สื่อสารกันบน internet คือไม่มี session ซึ่งต่างจาก webservice แบบอื่น เช่น WSDL และ SOAPและการทำงานของ RESTful เนี่ย จะอาศัย URI/URL ของ request เพื่อค้นหาและประมวลผลส่งกลับมาในรูป XML/HTML/JSON โดย response ที่ส่งกลับมาจะเป็นการยืนยันผลของคำสั่งที่ส่งมา</a></blockquote><blockquote>URI กับ URL ต่างกันยังไง?</blockquote><blockquote><a href="http://www.bloggang.com/viewdiary.php?id=zkaru&amp;month=08-2009&amp;date=08&amp;group=3&amp;gblog=8">URI คือข้อมูลที่ใช้ระบุตัวตนของทรัพยากร (resource)<br>โดยที่ resource อาจจะเป็น data, image, file, service, website, หนังสือ, คน หรือ หน่วยงานก็ได้ เรียกว่าอะไรก็ได้ เอามาระบุตัวตน (identify) โดยทำให้ออกมาเป็นรูปแบบเดียวกัน (uniform)</a></blockquote><blockquote><a href="http://www.bloggang.com/viewdiary.php?id=zkaru&amp;month=08-2009&amp;date=08&amp;group=3&amp;gblog=8">URL คือ URI ที่บอกวิธีการที่จะเข้าถึง/ติดต่อ (locate) resource มาให้ด้วย คือมีรายละเอียดขึ้นไปอีก</a></blockquote><h3>HTTP GET</h3><p>เจ้า HTTP GET เนี่ยมันทำอะไร ที่จริงแล้วมันเอาไว้ทำการเรียกข้อมูลจาก Server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*FZHIxHG7VM4VWc_q1eITqg.png" /><figcaption>จากรูปเป็นการเรียก ID เป็น 1</figcaption></figure><p>โดยถ้าดูจาก URL จะบอกได้ว่า permit เนี่ยเป็น resource , 1 คือ ID และ json คือ format</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*2mLhip00RmIZdsujTmEWig.png" /></figure><p>และนี่คือสิ่งที่ได้มาจากการเรียก ID = 1 จาก server ก็จะให้ JSON กลับคืนมา</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*U-YACbqlc8k4XoJXcGMosw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*vI22skTDHeq_lkH66cCbug.png" /></figure><p>แล้วตอนนี้เรากว่าจะได้ JSON มาเนี่ย เจ้า Server มาได้ทำอะไรกับเรา ที่จริงแล้ว Server จะมี Response มาบอกเราเป็น Status Code อย่างภาพทางซ้ายจะบอกว่า Status 200 ส่วนทางขวาจะมี 404 แต่ละรหัสก็จะมีการตอบรับที่ไม่เหมือนกัน มาดูกันว่า Response จาก Server ที่ส่งมาให้เรามีรหัสอะไรบ้าง</p><blockquote>Code 1xx : Informational Responses<br>Code 2xx : Success<br>Code 3xx : Redirection<br>Code 4xx : Client Errors<br>Code 5xx : Server Errors<br>ในแต่ละตัวเลขหลักร้อย ก็มีย่อยๆไปอีก แต่ละ Code ก็จะอธิบายรายละเอียดที่ลึกขึ้นยังไงก็ลองไปหาความรู้เพิ่มเติมดูนะครับ</blockquote><h3>ส่วน Code ของ HTTP GET</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*8Wa3A6yXFO4fpUzBrudfrQ.png" /></figure><h3>HTTP POST</h3><p>เจ้า HTTP POST เนี่ยจะมีความคล้ายคลึงกับ HTTP GET แต่ HTTP POST มันจะส่งข้อมูลไปให้ Server ด้วย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*osEZ3UJ8ZF_q44FS19oeeQ.png" /></figure><blockquote>flow การทำงานของมันก็จะบอกประมาณว่า <br>1.หาตำแหน่งว่ามีไหม <br>2.เช็คตรวจสอบว่ามีไหม ถ้ามี <br>3.สร้างเลย <br>4.มาหาอีกทีว่ามันสร้างแล้วหรือเปล่า <br>5.ถ้ามีก็ตรวจสอบว่าผ่าน</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*F_FV4nlNxM3jBf_OTSMlrQ.png" /></figure><h3>ส่วน Code ของ HTTP POST</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*Rsklyy4J23nvMwU5s0YWQA.png" /></figure><h3>HTTP PUT</h3><p>ถ้าพูดกันง่ายๆ เจ้าตัว HTTP PUT เนี่ยจะเป็นเหมือนการ Update ข้อมูล</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*3-qh7-mMXnPhGgo_jUoggA.png" /></figure><p>ในการที่จะทำ HTTP PUT ได้ต้องผ่านการทำ HTTP POST ในด้านการเขียน code ก็จะเหมือนกับตัว HTTP POST</p><h3>ส่วน Code ของ HTTP PUT</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*q9gOHDrJzO0cHW654ywC-A.png" /></figure><h3>HTTP DELETE</h3><p>สำหรับตัวสุดท้ายก็ไม่น่าจะมีอะไรแปลกใจมาก ตรงๆตัวเลยก็คือการ Delete นั่นเอง ก็เพียงแค่ส่ง ID ที่จะ Delete ไปเท่านั้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*uLFdRI4DFRO9uAYhrGO2gg.png" /></figure><h3>ส่วน Code ของ HTTP DELETE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*Hl-SFiVs5BlWUM7W84H4zQ.png" /></figure><blockquote>ก็จบกันไปแล้วกับบทที่ 5 น่าจะพอเข้าใจกับพวกการทำงานของ GET , POST , PUT , DELETE กันแล้ว บทที่ 6 จะเป็นยังไงรอติดตามกันต่อไปนะครับบบบบบบบบบบบบบบบบ :)</blockquote><p>Reference : <a href="https://pragprog.com/book/jrtest/the-way-of-the-web-tester">https://pragprog.com/book/jrtest/the-way-of-the-web-tester</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33a4b0b8bd54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%88-5-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-integration-testing-restful-web-services-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-33a4b0b8bd54">สรุปบทที่ 5 เรื่อง Integration Testing RESTful Web Services จากหนังสือ The Way of the Web Tester</a> was originally published in <a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3">นายไม่อ่านหนังสือ นายจะรู้อะไร</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สรุปบทที่ 3 เรื่อง Adding UI Tests to Legacy Systems จากหนังสือ The Way of the Web Tester]]></title>
            <link>https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%88-3-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-adding-ui-tests-to-legacy-systems-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-692b59a4cef6?source=rss-d79be4003d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/692b59a4cef6</guid>
            <category><![CDATA[testers]]></category>
            <dc:creator><![CDATA[Peerapong Toworakajornkul]]></dc:creator>
            <pubDate>Fri, 01 Sep 2017 08:34:50 GMT</pubDate>
            <atom:updated>2017-09-14T10:22:37.496Z</atom:updated>
            <content:encoded><![CDATA[<p>หลังจากผ่านมาแล้ว 2 บทเป็นยังไงกันบ้าง พอจะเข้าใจมุมมองการเขียนสักเล็กน้อยและเนอะ ในบทนี้จะมาลงลึกในการเขียนโค้ดให้ดูง่าย ต้องขอเกิ่นก่อนว่าในหนังสือเล่มนี้จะใช้ภาษา Ruby ในการเขียนโค้ดนะครับ เอาหละมาลุยต่อกันเลยยยย!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*PgJYW_xO-xgrQvVRTBAjJg.png" /></figure><p>ในการจะดู Page Source ของหน้าเว็บนั้นๆแค่ทำการ คลิกขวา &gt; เลือก View Page Source ก็จะแสดงหน้า HTML Page ทั้งหมดเราก็จะเห็นโค้ด</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Z7w4VVYNuirSs8u-JNIUFA.png" /></figure><p>พอเห็นหน้า Page Source ก็แอบตกใจเบาๆ ทำไมมันไม่มี ID กำกับเลยในแต่ละส่วนต้องบอกก่อนว่าในการเขียนโค้ดที่ดีควรมี ID กำกับทุกส่วน เพื่อให้ง่ายต่อการค้นหา การเรียกนำไปใช้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*tHrda2F-cy0ULlzd5VyDAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*DcLn9dpKsievxarMszxBKw.png" /><figcaption>ตัวอย่างในการเขียนโค้ดที่ดี ที่มี ID กำกับ</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*r-acH9MTWusZvYnv4r8Rfg.png" /><figcaption>ตัวอย่างโค้ดในการ Test</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*PVV02AV5XdSC71mE4o7lLA.png" /></figure><p>ยังมีอีกวิธีที่จะดูโค้ดของทาง Developers ที่เขียนไว้ คือการ คลิกขวา &gt; Inspect Element เราก็จะเห็น Developer Tools ในส่วนนี้จะเห็นทั้งโค้ด HTML และ CSS ด้วยเลย เรายังสามารถค้นหาโค้ดได้ใน Console เราสามารถพิมพ์สิ่งที่เราต้องการที่จะรู้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*A91AV2IOS2TC4-dBVl4KuQ.png" /></figure><p>อย่าง เช่น ภาพข้างบนนี้เป็นการพิมพ์ใน console เป็นการหา element ของ input ทั้งหมดก็จะมีปรากฎมาเหมือนในภาพ input text ของ name , input text ของ email , input password ของ password , input password ของ confirmation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*h4W4MRymArmEDVBWyfVIWA.png" /></figure><p>ภาพข้างบนนี้จะคล้ายกับก่อนหน้านี้แต่เพิ่ม attribute เข้ามาซึ่งจะรู้ผลลัพธ์ที่เราต้องการได้ลึกขึ้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*G9vB3xYAIi8uVG8GwOyFJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*3Nyj9UE4TunqOCmeIQI86A.png" /></figure><p>อย่างส่วนนี้จะกำหนดมากขึ้นคือ position คือตำแหน่งของมันเลย ซึ่งจะทำให้การกำหนดตำแหน่งของมันชัดขึ้น และในการนำมาใช้การค้นหามันง่ายมากขึ้นด้วย</p><h3>การใช้ . แทนการใช้ class</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*XBOSbT-_F2wiOY_2nEpWnA.png" /></figure><p>อย่างตัวอย่างในรูป เป็นการพิมพ์ใน console ว่า $(“.btn-large”) ในที่นี้ . คือตัวกำหนดว่าเรียก class นะ class อะไร class ที่ใช้ชื่อ btn-large คือ ปุ่มที่ขนาดใหญ่นะ ก็จะแสดงคำตอบว่าตัวที่ใช้ ปุ่มใหญ่เนี่ย คือ type submit คือปุ่ม Sign in นะ การเขียนแบบนี้ก็ถือว่าช่วยให้เราพิมพ์ได้เร็วขึ้น สะดวกมากขึ้น</p><h3>การใช้ # แทนการใช้ ID</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*nXPNCYN2Qk-cGHZQURpbyg.png" /></figure><p>อย่างการใช้ # ก็จะเป็นการแทนด้วยการใช้ ID อย่างภาพถ้าเราต้องการหา ID ของ user_name ก็สามารถใช้ # แทนการพิม ID เช่น #user_name ก็จะ return ค่าที่เราต้องการหา</p><h3>การตรวจสอบผลของการ Sign up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*w4XOycxq0oPodizzdw2r1A.png" /></figure><p>ถ้า Sign up สำเร็จจะต้องตรวจสอบว่าผ่านยังไง ก็จะตรวจสอบ 3 อย่าง คือ 1.ต้อง Redirect ไปหน้า Welcome Page 2.จะแสดงชื่อ Username ในหน้า Welcome Page 3.จะแสดงข้อความ Success</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*1ZNzfeeFSjwLmPhaP2cBiQ.png" /></figure><p>ถ้า Sign Up ไม่สำเร็จจะเกิดไรขึ้น ในเหตุการณ์นี้คือเรากดปุ่ม Create my account สิ่งที่ตามมาคือจะแสดง error ในสิ่งที่เราไม่ได้ทำลงไปในการ Sign up</p><h3>Code ของการ Test ระบบที่กล่าวมาจากด้านบนทั้งหมด</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*tR1ta83yzn_Mw8Acu2icmw.png" /></figure><p>โดย Code ตัวนี้จะใช้ภาษา Ruby ในการเขียนโค้ด ถ้าลองไล่โค้ดตามเนื้อหาจากด้านบนน่าจะเข้าใจว่าเป็นอย่างไร</p><blockquote>เข้า Web page &gt; กรอกข้อมูล name , email , password , confirmation &gt; คลิก button &gt; ตรวจสอบว่าเข้าสำเร็จ หรือ ไม่สำเร็จก็จะมี alert ที่แตกต่างกันไป</blockquote><p>จบจากบทนี้ไปก็ลองกลับไปฝึกเขียนเทสดูครับ เราก็จบบทนี้ไว้เพียงเท่านี้ บทต่อไปจะเป็นเรื่องอะไร เมื่อไหร่ คอยติดตามกันครับบบบบบบบบบผม</p><p>Reference : <a href="https://pragprog.com/book/jrtest/the-way-of-the-web-tester">https://pragprog.com/book/jrtest/the-way-of-the-web-tester</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=692b59a4cef6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%88-3-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-adding-ui-tests-to-legacy-systems-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-692b59a4cef6">สรุปบทที่ 3 เรื่อง Adding UI Tests to Legacy Systems จากหนังสือ The Way of the Web Tester</a> was originally published in <a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3">นายไม่อ่านหนังสือ นายจะรู้อะไร</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สรุปบทที่ 1 เรื่อง The Testing Pyramid จากหนังสือ The Way of the Web Tester]]></title>
            <link>https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%881-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-the-testing-pyramid-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-b84cdfc4f7cf?source=rss-d79be4003d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b84cdfc4f7cf</guid>
            <category><![CDATA[testing-pyramid]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Peerapong Toworakajornkul]]></dc:creator>
            <pubDate>Wed, 30 Aug 2017 09:22:50 GMT</pubDate>
            <atom:updated>2017-09-14T10:20:14.203Z</atom:updated>
            <content:encoded><![CDATA[<p>ในบทที่ 1 ของหนังสือ The Way of the Web Tester นั้นจะพูดถึง Testing Pyramid ว่ามีส่วนประกอบของอะไรบ้างในพีระมิด แต่ละส่วนประกอบมีการทำงานยังไง แต่ละส่วนใครเป็นคนเกี่ยวข้อง และผลเป็นอย่างไร</p><h3>Testing Pyramid</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*Ks5Gb7Epj9cbYOr93SVl1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*LXqKsWGhmHR1fiS0scJgJQ.png" /></figure><p>ส่วนบนสุดของพีระมิดคือ UI Tests หรือที่เรียกอีกอย่างนึงว่า User Interface Tests ส่วนนี้เป็นส่วนในการ test แบบ end-to-end หรือพูดกันง่ายๆ คือการ test แบบ user ใช้งานจริงๆ</p><p>ส่วนต่อมาเป็นส่วนกลางของพีระมิดคือ Integration Tests ในส่วนนี้จะแสดงภาพรวมของระบบ และมี Service เพื่อใช้ในการเชื่อมต่อ Function</p><p>ส่วนล่างสุดคือ Unit Tests เป็นส่วนที่เล็กที่สุด มีความเร็วและแรงในการ test ในส่วนนี้จะเป็นการทดสอบของ developers</p><h3>UI Tests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*wTkhHmPgZ6pRE73ACUt4ag.png" /></figure><p>เป็นการรวมทุก Layers ของระบบ โดยการ Test ของส่วนนี้จะมีการ Test ที่ช้าและมีความอ่อนแอ เพราะการ Test ในส่วนของ UI ต้องใช้เวลานานเพราะมีขนาดที่ใหญ่ และหากพบ Bug จะทำการตรวจสอบได้ยาก ในส่วนนี้จึงเป็นส่วนที่อยู่บนสุดของพีระมิดเพราะมันคือการตรวจสอบที่เหมือนกับการใช้งานจริงทุกส่วนของระบบ</p><h3>Integration Tests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*-XLO22ELw28sMhYTEMSBvw.png" /></figure><p>เป็นการรวมชิ้นส่วนทั้งหมดของ Unit Tests เข้าด้วยกันโดยใช้ Service ในการเชื่อมต่อกันในแต่ละ Unit ในส่วนนี้จะบอกว่าข้อผิดพลาดในการ test แต่เราไม่สามารถรู้ได้ว่าข้อผิดพลาดอยู่ที่ไหน จึงทำให้ในส่วนนี้ไม่แม่นยำ</p><h3>Unit Tests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*O6KkmOPuH8I7u80cpgBRNA.png" /></figure><p>ในส่วนของ Unit จะมีความแม่นยำ ความเร็วในการ test สูงมาก ในส่วนนี้ Developers จะเป็นคนทำซะส่วนใหญ่ เนื่องจากในส่วน Unit tests อาจจะเกิด bug ที่ซ่อนในตอนที่เราเข้าสู่ Integration ได้จึงเป็นข้อเสียในส่วนนี้</p><h3>Rules of Thumb</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*zlD6Zq6YWRq8wJtXBKqwiQ.png" /></figure><p>ในส่วนนี้จะเป็นการบอกว่าการ test เราควรทำจากข้างล่างขึ้นไปข้างบน ไม่มีโปรเจคไหนที่ทำ UI ได้โดยปราศจาก Unit และ Integration ในส่วนล่างสุดจะมีความเร็วและมีราคาที่ถูก ต่างจากด้านบนจะมีความช้าและมีราคาที่สูง</p><p>ข้อคิดในหัวข้อนี้บอกว่า “เมื่อไหร่ที่มี test เข้ามาใหม่เราควรมองที่ Unit Test ก่อน” “อย่าพยายามที่จะใช้ Automate Test อยู่ตลอดเวลา ใช้ตามความเหมาะสม”</p><h3>ข้อแตกต่างระหว่าง Unit Tests และ UI Tests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*0ckb2QPYG595PxrIUdMNjg.png" /></figure><h3>การทำงานของ Developers และ QA</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*8s-zRvzO_nKahWx8o2CDIA.png" /></figure><h3>ต้อง Test ทุกอย่าง ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*eopuwEKWsfPxPiNPnSivgw.png" /></figure><p>ถ้าเราจะทดสอบทั้งหมดก็ต้องแลกด้วยเวลาเหมือนดั่งรูปตราชั่ง ซึ่งจริงๆแล้วเราไม่จำเป็นต้อง test ทั้งหมด เพราะทุกอย่างเราต้องมองหลายๆ มุมมองว่าควร test แค่ไหนให้เหมาะสมกับ scope ของงาน เวลาของงานในแต่ละชิ้นด้วย</p><h3>มุมมองของแต่ละฝ่าย</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*2T3RGz97dQ19iOPlk49aFQ.png" /></figure><p>มุมมองของแต่ละฝ่ายจะแตกต่างกัน มุมมอง dev ก็จะบอกว่ายิ่งไวสิยิ่งดี เราทำทุกอย่างเสร็จแล้วนะของ Unit แต่มุมมอง QA จะบอกว่าต้อง test ทุกอย่างนะถึงจะถูก Unit คืออะไร เราสามารถ Automate Test ได้ทุกอย่างของ UI ซึ่งดูจากภาพต่างฝ่ายต่างมองในมุมมองของตัวเอง เราจึงต้องมาหาข้อตกลงระหว่างกัน ซึ่ง QA ก็ต้องมองในมุมมอง dev ด้วย dev ก็ต้องมองในมุมมอง QA ด้วย แล้วจะส่งผลไปในทางที่ดีของ product ของเรานั่นเอง</p><h3>เพิ่มเติมสักเล็กน้อย</h3><p>มีส่วนหนึ่งในหนังสือเรื่องนี้ที่สำคัญได้บอกว่า “อย่าลืมที่จะลองการ Test แบบ Exploratory Test” ทั้งหมดเราอาจจะมีการเขียนสคลิปต์ทั้ง Test แบบ Manual และ Automate แต่อย่าลืมที่จะลอง test หรือใช้งานไปเรื่อยๆ มั่วๆ แบบไม่มีสคริปต์ แบบไม่มีแบบแผนไว้ ลองทำแบบมั่วๆ บางทีการทำอะไรนอกกรอบอาจจะทำให้เจอ bug ที่เราคาดไม่ถึงก็ได้</p><p>Reference : <a href="https://pragprog.com/book/jrtest/the-way-of-the-web-tester">https://pragprog.com/book/jrtest/the-way-of-the-web-tester</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b84cdfc4f7cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/%E0%B8%AA%E0%B8%A3%E0%B8%B8%E0%B8%9B%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%881-%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-the-testing-pyramid-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-the-way-of-the-web-tester-b84cdfc4f7cf">สรุปบทที่ 1 เรื่อง The Testing Pyramid จากหนังสือ The Way of the Web Tester</a> was originally published in <a href="https://medium.com/%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD-%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%88%E0%B8%B0%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3">นายไม่อ่านหนังสือ นายจะรู้อะไร</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>