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
Gilang - Playing Unit Test with Spek
Search
Android VIP
January 12, 2019
Programming
490
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Gilang - Playing Unit Test with Spek
Android VIP
January 12, 2019
More Decks by Android VIP
See All by Android VIP
Ghiyats Hanif - Android Templates
androidvip
1
350
Javent - Coroutines 101
androidvip
1
380
Abangkis - INTO KOTLIN A PRAGMATIC WAY
androidvip
3
480
Henry & Meyta - Behind The Scene of Tokopedia Android Homepage
androidvip
2
660
Other Decks in Programming
See All in Programming
JIS keyboard support in Omarchy
lef237
0
180
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
140
Event is what happens
moro
2
3.2k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
130
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
120
Crash Auto Pipelines
veronikapj
1
350
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
140
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
14
11k
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
220
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
690
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
350
AI Augmentation Techniques with Liberty
ivargrimstad
1
320
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
510
Making the Leap to Tech Lead
cromwellryan
135
10k
Why Our Code Smells
bkeepers
PRO
340
58k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
490
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
エンジニアに許された特別な時間の終わり
watany
109
250k
New Earth Scene 8
popppiees
4
2.8k
How GitHub (no longer) Works
holman
316
150k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
450
Transcript
Playing Unit Test with Spek Gilang Ramadhan Android Developer at
Dicoding
Gilang Ramadhan Android Developer at Dicoding
[email protected]
Do we need to do a test?
Application Development Cycle Specifications of the application Write the codes
Test the application manually
New Feature New Bugs . . . https://gph.is/2jt9RvW
And then . . . Automatic Testing such as unit
testing and instrumentation testing. • Write the main code • Write the test code
TDD (Test Driven Development) is an application development method developed
by testing. • Writing Tests • Running Tests • Write down the Code • Running Tests • Refactor Code
Advantages of using TDD • More Productive • Code is
neater • Safer Refactoring • Minimizing Bugs • Documentation
Understand the Testing Pyramid Illustrates how your app should include
the three categories of tests: small, medium, and large https://developer.android.com/training/testing/fundamentals
Unit Testing? Unit Testing is useful for testing code logic
in our application.
Example UnitTest
Spek Spek is a specification framework that allows you to
easily define specifications in a clear, understandable, human readable way. https://spekframework.org
Style of Spek • given, on, it • describe, it
given, on, It • name = name of class •
given = context • on = action • it = actual test
example
describe, it • name = name of class • describe
= context • it = actual test
example
Setting up • org.jetbrains.spek:spek-api:1.1.5 • org.jetbrains.spek:spek-junit-platform-engine:1.1.5 • org.junit.platform:junit-platform-runner:1.0.0 @RunWith(JUnitPlatform::class) class
CalculatorSpec: Spek({ ... })
And then . . .
And then . . .
Migrating to Spek 2.x from 1.x testImplementation 'org.spekframework.spek2:spek-dsl-jvm:2.0.0-rc.1' testImplementation 'org.spekframework.spek2:spek-runner-junit5:2.0.0-rc.1'
Style of Spek 2.x • given, on, it • describe,
context, it
Let’s try https://github.com/gilangadhan/SpekFramework
Terima Kasih