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
今更JUnit4を勉強する
Search
shiryu
October 20, 2023
Programming
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
今更JUnit4を勉強する
なるべくJUnit5を勉強しましょう。
むきむきJavaで発表した資料です。
https://java-trainees.connpass.com/event/293679/
shiryu
October 20, 2023
More Decks by shiryu
See All by shiryu
JJUG_CFPの書き方について
shiryu
0
110
ゆるゆるJava第二回「第一回でのつまづきと復習ラムダ式」
shiryu
0
46
JJUG CCC Fall 2023 若手こそテストを書こう!
shiryu
2
210
2023/08/26 むきむきJava GithubActions+GCP+自動デプロイ(他山の石ver)
shiryu
1
170
2023/08/31 JJUG LT会 初登壇から学んだ一つのこと
shiryu
0
120
Other Decks in Programming
See All in Programming
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.6k
ActionController meets Protocol Buffers
sorah
1
730
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.8k
Performance Optimization With LLMs
xleitix
0
210
最近”作らせてる” ローカルAIアプリの話
akit37
0
500
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
610
Next.js: The final boss of Web Performance
guaca
0
350
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
190
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
190
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1.3k
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.8k
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
560
Code Review Best Practice
trishagee
74
20k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
860
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
A better future with KSS
kneath
240
18k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
600
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
HDC tutorial
michielstock
2
980
Transcript
今更JUnit4を勉強する
今日伝えたいこと 勉強したい分野の本が古くても、 とりあえず読んでみた方がよさそう 対象者 : 新しいものをやらなきゃいけない気がする新人エンジニア
自己紹介 2023卒エンジニア - むきむきJava主催 - 23歳✌✌👍 - 大学時代は東北で過ごす - つよくない(非情報系)
- @shiryu_go Shiryu
経緯 JUnitの勉強したかったけど 出てきた本が全部JUnit4 そもそも、テストの書き方の前に テストってなんなのか知るのが重要なのでは
その前に:JUnit4,5の違い パッケージ JUnit4 : org.junit.* JUnit5 : org.junit.jupiter.* 例 :
org.junit.Test→org.junit.jupiter.api.Test アノテーション JUnit4 : @Test(expected = Exception.class) JUnit5 : Assertions.assertThrows(Exception.class, () -> {//...});
テストで重要っぽいこと ①FIRST(失敗しないテストの原則) ②Right-BICEP(テストの対象の選び方) ③CORRECT(テストで考慮するべき境界条件) 前提 : 完璧なテストは存在しない
テストの考え方① FIRST(失敗しないテストの原則) - Fast(迅速) - Isolated(隔離) - Repeatable(繰り返し可能) - Self-validating(自律的検証)
- Timely(タイムリー)
テストの考え方② Right-BICEP(テストの対象の選び方) - Right(結果は正しいか) - Boundary(境界) - Inverse(別の関係をチェック可能か) - Cross-Check(別の方法を使って結果をチェック可能か)
- Error(エラーの条件を強制的に発生させられるか) - Performance(特性は許容範囲か)
テストの考え方③ CORRECT(テストで考慮するべき境界条件) - Conformance(形への適合) - Ordering(順序) - Range(範囲) - Reference(参照)
- Existance(存在) - Cardinally(要素数) - Time(時間)
JUnitの年表 Javaの年表 1997 : JUnit 1 Release ???? : JUnit2
Release ???? : JUnit3 Release 2006 : JUnit 4 Release 2017 : JUnit5 Release 1997 : JDK 1.1 2002 : J2SE1.4 2004 : Java SE5 2006 : Java SE6 2008 : J2SEサポ終了 2017 : Java9 JDKのVer = JavaのVer
2001年 : アジャイル宣言(アジャイル開発発祥) 2003年 : テスト駆動開発(TDD) 2006年 : ビヘイビア駆動開発(TDD派生) 2009年
: DevOps →今なんとなく耳にする言葉の発祥は、割と古い
まとめ - 結果 - 境界条件 - 関係性 - エラー条件が正確か等々を確かめる...etc Verが低くても必要なことは多分学べる
おわり
参考図書 実践 JUnit JUnit実践入門
会場内での補足 - できる限り新しい本を読むべき - 今後、日本語での本は出なくなっていく。 - 英語での本は発売される - Java8以降であれば現状ギリギリ活かせる (そもそもJava8がLTSの期限切れそうだけど)