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
Intro to Unit Test & Metrics
Search
Maikel Chandika
July 28, 2018
Programming
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to Unit Test & Metrics
Maikel Chandika
July 28, 2018
More Decks by Maikel Chandika
See All by Maikel Chandika
Microservices Architecture with Spring Cloud Stack
mkdika
0
290
Other Decks in Programming
See All in Programming
気持ちぃ〜角丸 Squircle
ryu1013
0
310
golang-bob.pdf
iwatsukayura
0
130
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
670
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
Event is what happens
moro
2
780
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
Next.js: The final boss of Web Performance
guaca
0
260
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
Workers Cache を知る
syumai
0
360
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
1.3k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
Featured
See All Featured
Between Models and Reality
mayunak
4
500
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Prompt Engineering for Job Search
mfonobong
0
520
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Statistics for Hackers
jakevdp
799
230k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
A Tale of Four Properties
chriscoyier
163
24k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Skip the Path - Find Your Career Trail
mkilby
1
260
Transcript
Intro to Unit Test and Metrics By: Maikel Chandika (
[email protected]
)
Medan, 28 July 2018.
Maikel Chandika, S.Kom, OCA ICT Manager and Lead Java
Developer at Waruna Group Java Ecosystem and OSS Enthusiast Website: https://mkdika.com GitHub: mkdika 2
Todays Topics A Little Bite to Software Testing Java Testing
Framework & Libs Unit Test Metrics & Demo To go further 3
Why Need Unit Test? 4
Software Testing Path Software Testing Developer Test Unit Test Integration
Test Users Test End-to-End Test 5
Test Pyramid 6
Test Framework & Lib in Java Testing Framework: JUnit,
TestNG, JBehave Mock Lib: Mockito, PowerMock, EasyMock Parameterized Test Lib: JUnitParams Equality Test Lib: Hamcrest Integration Test Lib: Maven Failsafe, REST Assured, DBUnit 7
Unit Test Metric & Analysist Lib Built System &
Test env: Maven, Gradle Code Coverage Lib: Jacoco, Cobertura Mutation Test Lib: PIT Load Test Tools: JMeter, Gatling End-to-End/ Acceptance Test Tools: Cucumber 8
Test Metrics – Unit Test 9 Focus on single class/unit.
Assertions and expectation.
Test Metrics – Coverage Test “A measure used to describe
the degree to which the source code of a program is executed when a particular test suite runs.” 10
Test Metrics – Coverage Test? Percentage of our code call
(statement, branch, path) from test environment. Not say anything about quality of our test. 11
Test Metrics – Coverage Test? 12
Test Metrics – Mutation Test 13 “Test how good are
your Unit Test.” Add mutation (errors) to the code and check if unit test failed (fault seeding). Effectiveness of test is gauged by ratio of survived and killed mutations.
Test Metrics – Mutation Test? 14 Very CPU demanding &
time consuming process. Will slow down review life cycle if run in every single commit.
What Next? Unit test best practice Mock Test
Integration Test Test-driven Development (TDD) Behavior-driven Development (BDD) Automatic Static Code Analysis ex: Findbugs 15 Cucumber BDD Example
Other PL Unit Test Framework & Libs PHP
Unit test & coverage: PHPUnit Mutation test: Humbug .NET Unit test & coverage: MS Test, Nunit Mutation test: VisualMutator, NinjaTurtle Ruby Unit test & coverage: RSpec Mutation test: Mutant-RSpec Python Unit test & coverage: unittest, coverage Mutation test: MutPy 16
Summary – Unit Test Metrics Coverage Test Numbers of code
call from test environment (unit test). Mutation Test Test the quality of Unit Test. 17
Q & A 18
To Go Further 19 Practical Unit Testing with Junit and
Mockito By: Tomek Kaczanowski
THANK YOU 20