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
Gilang - Playing Unit Test with Spek
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Android VIP
January 12, 2019
Programming
2
460
Gilang - Playing Unit Test with Spek
Android VIP
January 12, 2019
Tweet
Share
More Decks by Android VIP
See All by Android VIP
Ghiyats Hanif - Android Templates
androidvip
1
320
Javent - Coroutines 101
androidvip
1
330
Abangkis - INTO KOTLIN A PRAGMATIC WAY
androidvip
3
440
Henry & Meyta - Behind The Scene of Tokopedia Android Homepage
androidvip
2
600
Other Decks in Programming
See All in Programming
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
200
MUSUBIXとは
nahisaho
0
130
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
280
Raku Raku Notion 20260128
hareyakayuruyaka
0
180
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
AtCoder Conference 2025
shindannin
0
1.1k
Oxlint JS plugins
kazupon
1
960
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
130
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Scaling GitHub
holman
464
140k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
Writing Fast Ruby
sferik
630
62k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
53
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
Raft: Consensus for Rubyists
vanstee
141
7.3k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
290
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