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.
Code kata: Continue solving the problem
From the course: Agile Software Development: Refactoring
Code kata: Continue solving the problem
- [Presenter] I've gone ahead and added additional tests and solution code for all of the single digit Roman Numeral cases. You can complete that part of the Kata yourself or you can look at the solution code that I've provided. Now lets move on to the next test case, Roman Numeral addition. In Roman Numerals, addition looks like this. To write one plus one, you put I and I next to each other. II is the same thing as one plus one, and in our code and our solution we'll be looking for that to return the value of two. III would be the same as one plus one plus one, and our code should return the value, three. VI would be the same as five plus one and our code should return the value, six, and so on. So let's write our first test case for this at like 23 and a half, type @Test public void and we'll give this test a name like, romanNumeralAddition. And our first assertion will be AssertEquals two with the input of Roman.convert II. We'll run our tests, and we'll notice that our test…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
What is refactoring?53s
-
(Locked)
Test-driven development (TDD)1m 10s
-
(Locked)
Code kata1m 24s
-
(Locked)
Setting up the new code kata2m 30s
-
(Locked)
Setting up the TDD environment3m 13s
-
(Locked)
Refactoring: Rename Variable3m 47s
-
(Locked)
Micro-refactoring3m 47s
-
Refactoring: Inline Code4m 3s
-
(Locked)
Code kata: Continue solving the problem4m 2s
-
(Locked)
Refactoring: Extract Method4m 38s
-
(Locked)
-
-
-