Java Unit Testing with JUnit - Tutorial - How to Create And Use Unit Tests

preview_player
Показать описание
Full tutorial on creating Unit Tests in Java with JUnit!

Do you write Java code that you're just not confident is 100% right? You can create unit tests using the JUnit testing framework to verify your Java code, and I'll show you exactly how to do it.

Many beginners don't know there's a great way to test their code with simple, fast tests and make sure their code is working exactly how they think it is.

The IntelliJ testing tools also make creating and running your Unit Tests super simple.

In this beginner's Java tutorial video, we'll do a full walkthrough of why and how you can create your own unit tests!

Learn or improve your Java by watching it being coded live!

Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.

Let me know what else you'd like to see!

Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.

📕 THE best book to learn Java, Effective Java by Joshua Bloch

📕 One of my favorite programming books, Clean Code by Robert Martin

🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial

🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)

📹Phone I use for recording:

🎙️Microphone I use (classy, I know):

Donate with PayPal (Thank you so much!)

☕Complete Java course:

Рекомендации по теме
Комментарии
Автор

Your channel is pure GOLD! I'm learning more in a few minutes than an whole semester of classes.

Roberto-ozet
Автор

Today, I crashed production because I didn't review and test my code. This was a valuable lesson for me. A colleague with more experience showed me how I could have detected this error through unit testing. We wrote 8 test cases within 20 minutes that could have assessed the functionality of my changes, and I would have noticed the bug. I am glad that we have an open culture for acknowledging errors, and that I was 'allowed' to make this mistake.

marmont
Автор

Honestly there's no better refresher course on java unit testing than this. Short, precise, keeps your gears turning and leaves you wanting to know more.
Thank you so much John.

tejumania
Автор

I enjoyed the topic of the video, since unit tests are not necessarily what you have to do at school (and it's not in the curriculum).
What I also liked was you switching to IntelliJ. I've been experimenting with my students, and we tested 3 different IDEs. They said that they felt most comfortable with IntelliJ and also appreciated the helpful tips that guided them towards fixing errors.
I'd also like to give you props for the way you present the topics, among them being voice, intonation, gestures and pace.

micleh
Автор

John, i almost said that this was the most easy topic i learned in java, but when i read other comments, i realized its because your teaching method is simply great. I’m glad i found you!

Hurosaki_
Автор

These are all wonderful. I'm a retired Java 6 programmer writing

Minecraft mods in Java 8, 16, and 17. Your videos are clear and concise! They help me a lot.

macmcleod
Автор

Very noice!!! As a “beginner” learning on my own these lectures are important lessons. Great Intro exposure to thinking about writing code holistically. Ty. 🙌🏿🙏🏾

mastershonobi
Автор

Hey John! I took a course in the fundamentals of computer science last year where our professor mentioned the importance of unit testing and made us all write our own ones without really explaining the reason why or showing how to properly do it. This video really cleared that up for me. Thank you so much!

Chronozia
Автор

Concise, Crisp & To-the-point. Short videos, really time saving. Great work John.

muhammadhassaanbasil
Автор

i wish this dude made spring boot videoes would be gold

zjizrld
Автор

Thanks and kudos for the Coverage aspect in Intellij IDEA.

raghavanaliassaravananm
Автор

I've been trying to learn unit testing for ages and this made everything so much clearer!

olillin
Автор

Hit the like, if you have been watching many tutorials and finally, you get the proper context with clear explanations.

beetcshivsundarbankar
Автор

This video makes the JUnit test case more easily to implement. Thanks. 🎉

pokitlui
Автор

I need to give John some major KUDOS. I actually followed the link to his course and now, after like 10% in, I've learned at least 4 or 5 new things that are going to make my life so much easier. Thanks buddy for making these videos and adding a course. Ternary alone is going to save me so much time. A+++

greatjobbuddy
Автор

You're brilliant! I'm a senior Java developer but I don't have these didactics and ease to explain/teach. Awesome job

samueldnc
Автор

Long time programmer but never wrote a single unit test. Its this thing i know i should do, but I seriously never have time for. This video is a actually a great example, ur unit tests tend to use as much or even more lines of code than the original. In the real word the next deadline is always yesterday…

samuvisser
Автор

"run our test with coverage" was a requirement for project...Its clearer now. That was a treat. Great video

gplus
Автор

Run our test with coverage, John all the expected points you explained in a very simple way, Thanks for your hard work nd keep on doing such a great real time videos

kanchankumari
Автор

Hands down the best Java channel on YT. I love you John. You just very clearly explained to my dumb brain what the rest of the web really struggled to achieve. Thank you! <3

paulus_germanus