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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
340
Abangkis - INTO KOTLIN A PRAGMATIC WAY
androidvip
3
450
Henry & Meyta - Behind The Scene of Tokopedia Android Homepage
androidvip
2
610
Other Decks in Programming
See All in Programming
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
670
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
1
380
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
150
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
170
Beyond the Basics: Signal Forms
manfredsteyer
PRO
0
110
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
240
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
13
7.7k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
230
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
530
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
3k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
340
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
110
Code Reviewing Like a Champion
maltzj
528
40k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
How STYLIGHT went responsive
nonsquared
100
6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
WENDY [Excerpt]
tessaabrams
9
36k
Documentation Writing (for coders)
carmenintech
77
5.3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
850
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
210
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
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