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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
shiryu
October 20, 2023
Programming
150
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
100
ゆるゆるJava第二回「第一回でのつまづきと復習ラムダ式」
shiryu
0
45
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
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
110
Security issues being discussed on Web Platforms
petamoriken
0
960
Are APIs Still Relevant in the AI Era?
soyuka
0
250
cdk deploy JawsSonic #MARATHONしながらAWSリソースをデプロイしてみよう
akihisaikeda
2
140
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.8k
What We Talk About When We Talk About XP
m_seki
2
650
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
430
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
340
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.7k
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
150
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
170
setup-vp GitLab対応の裏側
naokihaba
0
110
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
7k
Navigating Team Friction
lara
192
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Six Lessons from altMBA
skipperchong
29
4.5k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Producing Creativity
orderedlist
PRO
348
41k
Odyssey Design
rkendrick25
PRO
2
810
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
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の期限切れそうだけど)