Discover the first thing to do when you write code from the beginning: set up your test-driven development (TDD) environment. Learn how to set up JUnit and make sure your IDE and project are configured properly.
- [Instructor] The first step of the kata…is to set up JUnit as the test framework.…Remember test-driven development…and the Red, Green, Refactor three-step dance?…The first thing we'll do is create a failing test…that ensures JUnit exists and works properly.…At line three and a half,…type @Test and press Escape to make sure…the autocomplete doesn't get accepted,…then press Enter.…Continue typing, public void junitWorks,…parentheses, and a left squiggly bracket.…
Press Enter.…And at line six, type assertTrue(false).…Notice all the red on the strain; this is good.…This code is so red that it won't even compile.…This is the first step…of the Red, Green, Refactor three-step dance.…Let's do the least amount of work to fix that.…The problem is that our project…is not yet configured to use JUnit.…To resolve this, we'll ask IntelliJ…to fix the configuration for us.…
When we let IntelliJ do this kind of work for us,…we can focus more on solving the kata.…Move the cursor to line four on top of the word Test,…press Option Enter,…
Author
Released
2/1/2019- Defining refactoring
- Setting up a test-driven development environment
- Renaming variables
- Using the extract method
- Pinning down legacy code
- Testing code and branch coverage
- Refactoring legacy code
- Simplifying math and Booleans
- Adding new behaviors to refactored code
Skill Level Intermediate
Duration
Views
Related Courses
-
Agile Software Development
with Shashi Shekhar1h 53m Beginner -
Agile Software Development: Pair and Mob Programming
with Chiu-Ki Chan1h 36m Intermediate -
Agile Software Development: Scrum for Developers
with Shashi Shekhar2h 40m Intermediate
-
Introduction
-
1. Refactoring with New Code
-
Code kata1m 24s
-
Setting up the new code kata2m 30s
-
Refactoring: Rename Variable3m 47s
-
Micro-refactoring3m 47s
-
Refactoring: Inline Code4m 3s
-
Refactoring: Extract Method4m 38s
-
2. Stabilizing Legacy Code
-
Methodology2m 46s
-
Start writing pin-down tests3m 24s
-
Refactoring pin-down tests4m 40s
-
Code coverage4m 51s
-
Branch coverage4m 35s
-
3. Refactoring Legacy Code
-
Refactoring: Final steps3m 33s
-
Conclusion
-
Next steps47s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Setting up the TDD environment