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
Android VIP
January 12, 2019
Programming
470
2
Share
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
330
Javent - Coroutines 101
androidvip
1
350
Abangkis - INTO KOTLIN A PRAGMATIC WAY
androidvip
3
450
Henry & Meyta - Behind The Scene of Tokopedia Android Homepage
androidvip
2
620
Other Decks in Programming
See All in Programming
Spec-driven Development: How AI Changes Everything (And Nothing)
simas
PRO
0
540
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.4k
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
410
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
150
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
130
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
920
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
110
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
290
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
2
370
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
510
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
900
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Facilitating Awesome Meetings
lara
57
6.8k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
180
HDC tutorial
michielstock
2
650
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