Instant Test Driven Development with Java, JUnit and Mockito
- 4 hours on-demand video
- 3 articles
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Write unit tests with confidence. Understand the various patterns and techniques to apply in different situations.
- Go from Zero to Hero with your Java TDD skillz!
With the use case of a leap year detector, this is a quick demo of TDD in action. You should see how it feels to write tests first, using your IDE to generate enough code to make the software compile and writing small implementations to make the tests pass.
Revisiting the code from the TDD Instant Demo, this will look at how JUnit and TDD is used in a little more detail.
The deep dive shows how each element of TDD and JUnit comes together to make testing and coding work hand in hand.
Revisiting the leap year algorithm, this lecture explores how to cultivate an algorithm by iteratively adding tests to cover use cases, refactoring the code when it gets too complex.
This shows TDD with a very lightweight set of JUnit practices. The intention is to show how TDD scales to larger problems.
In every technique you learn, there is usually some underlying pattern. In the case of TDD, each test has a natural form. This lecture explains what's underneath all testing techniques so you can recognise tests that are unusually formed and tests which are a perfect example of the craft.
For those people who wish not to use IntelliJ as their IDE or who wish to set up projects from the command line, this version of project set up shows how to use the maven command from the command line. One simple command can build the barebones project in which tests and conventional code can be developed.
Instant demo of Mockito in action.
Where there are services that might touch the outside world, you use mocks to test your core algorithms. This example, based around distributing articles from a data source to the right receiving services, uses Mockito to eliminate dependencies on real implementations.
After looking at the Mockito library to do some basic mocking and stubbing, this lecture takes a look at what mocking is all about. It covers the motivations towards mocking and how mocking drives good design into the code. It also looks at what happens if mocking is over or under used.
Growing a web application through tests is relatively easy to do, especially if you do it in small steps. In this example, we take the skeleton of a Rest API and by adding small increments to it, make it work.
This is a long walk-through, showing technology and process, with mishaps along the way illustrating how to troubleshoot when problems occur.
As a contributor to this open source project, perhaps it's down to me to show you how to use it.
See https://github.com/greghaskins/spectrum for more information on the tool.
This lecture just scratches the surface, but shows a completely different approach to testing, which is hopefully thought provoking.
- Basic understanding of programming and Java.
This course will get you up to speed with JUnit and TDD in next to no time with a mixture of Instant Demos, Deep Dives and Philosophy lectures.
In the Instant Demo you'll quickly get a feeling for how things will work once you're an expert. No getting distracted by detail, just the real life feel of using the techniques.
With a Deep Dive we will unpack all the necessary detail to enrich your understanding.
The Philosophy lectures will give you the fundamentals from which you can grow your own knowledge.
Building your knowledge from the inside out with realistic examples means you will understand TDD quickly and deeply. Hopefully this course will make you excited about what TDD can do for you.
Various other JUnit runners
Written by the author of The Coding Craftsman WordPress blog.
- Java developer looking to become an expert in Test Driven Development and the JUnit ecosystem.