Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Unit Testing in Java!
You have completed Unit Testing in Java!
Preview
It's super important to also know what you shouldn't test, and what you should stub out. Let's explore!
Coverage
Mocking Libraries
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
we'll probably not end up falling
into some common pitfalls.
0:00
You wanna make sure that you don't
test stuff that can't really break.
0:01
A good example of this is
testing of getters and setters.
0:04
In a behavior to find test you probably
won't even think of this, but for
0:09
those test that's simply
test all the methods,
0:12
you might actually encounter someone
testing a method like test get name.
0:15
That's pretty silly right?
0:19
I mean, how could that actually break?
0:21
Especially if it's just exposing
a private member variable.
0:23
A great quote found in the JUnit
frequently ask questions is this.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up