Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Testing JavaScript
Search
Irfan Maulana
May 24, 2022
Programming
0
150
Testing JavaScript
Intro to JavaScript testing
Irfan Maulana
May 24, 2022
Tweet
Share
More Decks by Irfan Maulana
See All by Irfan Maulana
Panduan untuk mempublikasikan kode ke publik
mazipan
0
120
Mengukur dan meningkatkan performa website
mazipan
1
220
Membuat Website Zaman Sekarang
mazipan
0
510
Kinerja Web 101 - Edisi 2022
mazipan
1
460
Layout Repaint & The Lessons Learned
mazipan
0
410
Bagaimana implementasi mockup design
mazipan
0
500
Memulai karir sebagai web programmer
mazipan
0
740
Membuat laporan kecepatan web untuk blog
mazipan
0
530
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
520
Other Decks in Programming
See All in Programming
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
1
110
私はどうやって技術力を上げたのか
yusukebe
43
17k
CSC509 Lecture 04
javiergs
PRO
0
300
高度なUI/UXこそHotwireで作ろう Kaigi on Rails 2025
naofumi
4
3.5k
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
690
Web Components で実現する Hotwire とフロントエンドフレームワークの橋渡し / Bridging with Web Components
da1chi
3
1.9k
ネイティブ製ガントチャートUIを作って学ぶUICollectionViewLayoutの威力
jrsaruo
0
130
ソフトウェア設計の実践的な考え方
masuda220
PRO
3
490
CSC305 Lecture 03
javiergs
PRO
0
230
CI_CD「健康診断」のススメ。現場でのボトルネック特定から、健康診断を通じた組織的な改善手法
teamlab
PRO
0
180
iOSアプリの信頼性を向上させる取り組み/ios-app-improve-reliability
shino8rayu9
0
150
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
140
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
19
1.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
We Have a Design System, Now What?
morganepeng
53
7.8k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
The World Runs on Bad Software
bkeepers
PRO
71
11k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
Raft: Consensus for Rubyists
vanstee
139
7.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Why Our Code Smells
bkeepers
PRO
339
57k
How to Ace a Technical Interview
jacobian
280
24k
Writing Fast Ruby
sferik
629
62k
Transcript
Testing JavaScript By Irfan Maulana
Hi, I am Irfan Working at Tokopedia as Principal Engineer
for Web Platform Team. mazipan.space @Maz_Ipan
A process to verifying the correctness & validating the functional
features of the app being developed APPLICATION TESTING
Software Development Life Cycle
JAVASCRIPT APPLICATION Frontend Backend Handling UI functionality: web, apps, desktop
Handling business logic, data store connection A B We will focus on the Frontend for this session.
PERFORM APP TESTING MANUAL AUTOMATED
WHY DO WE NEED? Bugs are bad, and who gets
blamed? The developer. You know humans are bad at complex, repetitive tasks. Computers are very, very good at complex, repetitive tasks. A professional ships working code. Code that works. Code that is well tested.
Focused on input & output. Not interested about the things
happening inside. Involve testing of the internal structure, code, design & implementation. METHODOLOGIES BLACKBOX WHITEBOX
TESTING PROCESS 1. PLANNING 2. PREPARATION 3. EXECUTION 4. REPORTING
THE TESTING TYPES
PROVEN METHOD FOR TESTING APP
STATIC TEST To catch typos, errors, possible bugs as you
write the code. Tools: • ESLint + Prettier • CodeQL, Snyk, SonarQube
Very fast feedback Can not reproduce functional bugs faced by
users STATIC TEST: PRO & CONS We can mark it as mandatory Very beneficial in the development phase
UNIT TEST To verify that individual, isolated and smallest part
works as expected. Tools: • TestingLibrary.com
Fast feedback Need an extra effort to write UT UNIT
TEST: PRO & CONS Verify the correctness of the function Can not represent the bug when the unit integrated Can not represent real user interaction
INTEGRATION TEST To verify that several units work together in
harmony. Tools: • TestingLibrary.com
Verify most of user interactions Slower feedback than UT More
effort than UT INTEGRATION TEST: PRO & CONS Can not represent device variant Can not replicate using the real data
END-TO-END TEST A robot that behaves like a user to
click around the app and verify that it functions correctly. Tools: • Cypress • Nightwatch • TestCafe
Can use multiple device Very slow to executed Need the
biggest effort E2E TEST: PRO & CONS Can use real data Replicate real user
COMPARISON Static Test Unit Test Integration E2E Test 🚀 Speed
🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 ⏰ Development time 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 💰 Cost 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 😎 Confidence 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 Read more on https://kentcdodds.com/blog/static-vs-unit-vs-integration-vs-e2e-tests
BEST ROI https://twitter.com/kentcdodds/status/960723172591992832
DEMO TIME!
CHECK THE CODE https://github.com/mazipan/react-testing-workshop Prerequisites: • Node.js
ASK ME!
CREDITS: This presentation template was created by Slidesgo, including icons
by Flaticon, and infographics & images by Freepik and illustrations by Stories. THANK YOU Please keep this slide for attribution.