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
JLPDevs - Web Application Unit Testing: Strateg...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
JLP Community
December 05, 2015
Programming
0
47
JLPDevs - Web Application Unit Testing: Strategy and Tools
JLP Community
December 05, 2015
Tweet
Share
More Decks by JLP Community
See All by JLP Community
JLP Community Profile
jlpcommunity
0
56
JLPDevs - Optimization Tooling for Modern Web App Development
jlpcommunity
3
210
Other Decks in Programming
See All in Programming
How to stabilize UI tests using XCTest
akkeylab
0
140
Nuxt Server Components
wattanx
0
120
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.4k
The free-lunch guide to idea circularity
hollycummins
0
350
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.1k
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
230
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
130
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1k
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.1k
モダンOBSプラグイン開発
umireon
0
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1k
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.5k
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.5k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
300
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
How GitHub (no longer) Works
holman
316
150k
Music & Morning Musume
bryan
47
7.1k
How to Ace a Technical Interview
jacobian
281
24k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Thoughts on Productivity
jonyablonski
75
5.1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
990
Done Done
chrislema
186
16k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
490
Everyday Curiosity
cassininazir
0
180
Transcript
Web Application Unit Testing: Strategy and Tools Presented by: Salman
El Farisi 05 Desember 2015 @ code margonda
Let's Move On Runnable Code Testable Code
Not So Testable Code
Better Version
Better Version (2)
Testing Pyramid
Web Application Unit Testing Challenge: Too much dependency Network
(HTTP Request) Database Third Party Library File System (upload / download file) Tools: PHPUnit (Unit testing framework) Mockery (Mock Object) Faker (Fake Object) PHP-DI / Pimple (Dependency Injection Library)
Mockery
Faker
Web Application Unit Testing (2)
Web Application Unit Testing (3)
Web Application Unit Testing (3) Assertion: Compare expected and actual
value AssertTrue() AssertNotNull() AssertEquals() AssertArrayHasKey() AssertClassHasAttribute() Etc. https://phpunit.de/manual/current/en/phpunit-book.html#appendixes.assertions
Mock Object RoleController.php Connect to database
Mock Object (2) RoleControllerTest.php Control the 'Role' class behaviour so
it wont touch the database
Fake Object Create fake object
Thank You :)