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
340
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
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
150
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.1k
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
150
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
1.9k
Performance Optimization With LLMs
xleitix
0
210
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
360
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
460
contenteditable と日本語入力に向き合う
colorful12
0
230
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
200
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
Jetpack Compose Mechanisms
skydoves
3
880
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
230
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
440
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
What's in a price? How to price your products and services
michaelherold
247
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
580
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
560
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
740
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
350
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
490
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