Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Day 1 - Testing
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
offz
April 19, 2017
Programming
64
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Day 1 - Testing
Automate software testing with Java for beginner.
offz
April 19, 2017
More Decks by offz
See All by offz
TM-P2-IT-security
offfffz
0
29
Docker Compose for Rails Developer
offfffz
1
40
Day 2 - Docker
offfffz
0
49
Day 2 - CI
offfffz
0
69
Day 1 - Git
offfffz
0
97
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
110
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
18k
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
390
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
970
setup-vp GitLab対応の裏側
naokihaba
0
140
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.4k
App Intentsのビルドプロセスを支える技術
kntkymt
0
460
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
160
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
320
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
550
Amusing Abliteration
ianozsvald
1
320
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
550
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
410
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
The SEO identity crisis: Don't let AI make you average
varn
0
560
Everyday Curiosity
cassininazir
0
330
Optimizing for Happiness
mojombo
378
71k
Transcript
Testing….
ความเชื่อผิดๆ - เขียน Test ทำให้ทำงานช้าลง - เขียน Test แล้วงานเพิ่มขึ้น ได้เงินเท่าเดิม
เขียน Test ทำให้ทำงานช้าลง
งานเพิ่ม เงินเท่าเดิม - ที่งานเยอะ ไม่ใช่เพราะ feature แต่เพราะ bug - fix
bug เหนื่อยกว่าทำ feature - context switching cost แพงมาก
Now
ทำไมต้อง Test ? - เพื่อความมั่นใจ - เพื่อชื่อเสียง - เพื่อเงิน
ใครต้อง Test ? - คนที่เขียน code นั้นๆ - คนที่เก่งเรื่องจับผิด -
คนที่จ่ายเงิน
วิธีการ Test ? 1. ทำ software ให้เสร็จ 2. ติดตั้งลงในสภาพแวดล้อมจำลอง 3.
click ไปเรื่อยๆ จนกว่ามันจะพัง
Future
งานซ้ำๆ ให้คอมทำเร็วกว่า
วิธีการ Test class Calculator { public int plus(int a, int
b) { return a + b; } } class CalculatorTests { public boolean testPlus() { Calculator calculator = new Calculator(); int result = calculator.plus(1, 2); return result == 3; } }
วิธีการ Test class TestMain { public static void main(String[] args)
{ CalculatorTests suit = new CalculatorTests(); if (suit.testPlus) { System.out.println("You survive!"); } else { System.out.println("You died!"); System.exit(-1); } } }
เครื่องมือ Test
JUnit Test class CalculatorTests { Calculator calculator; @Before public void
setup() { calculator = new Calculator(); } @Test public void test1Plus2Equals3() { int result = calculator.plus(1, 2); assertEquals(result, 3) } @After public void tearDown() { calculator = null; } }
ทำไมต้อง Auto Test - นอนหลับสบายขึ้น - มีเวลาอยู่กับครอบครัวมากขึ้น - ท้องไม่อืด
ทำไมต้อง Auto Test - ทำงานได้เร็วกว่าให้คนกด ทำซ้ำได้บ่อย - developer รับผิดชอบงานของตัวเองเต็มที่ -
มีความมั่นใจใน software สูงขึ้นมาก - release software ได้เร็วขึ้น
exercise 1 1. clone project FizzBuzz 2. อ่าน README และทำความเข้าใจ
3. เปิด project ใน Eclipse แล้วสร้าง test case ใหม่ๆ 4. ทดลองรัน Test ใน Eclipse ด้วย JUnit
exercise 1.1 1. refactor FizzBuzz 2. รันเทสให้มั่นใจ ว่ามันยังทำงานได้ตามต้องการ 3. พยายามทำตาม
The Transformation Priority Premise
exercise 2 1. clone project chidchat 2. ลองรัน Server และ
Client เล่น 3. ลองนำ Client ไปต่อกับ server • host: 128.199.193.120 • port: 5000
exercise 2.1 1. ให้เลือก emoticon 1 ตัวจาก • https://www.emojicopy.com/ 2.
สร้าง issue emoticon <emo-name> 3. ทำให้ server สามารถรับ keyword แล้วแสดงเป็น emoticon ได้ • เช่น :sob: แสดงเป็น เขียน Test ด้วย!!