From the course: Agile Software Development: Refactoring

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Setting up the TDD environment

Setting up the TDD environment

From the course: Agile Software Development: Refactoring

Start my 1-month free trial

Setting up the TDD environment

- [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…

Contents