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.
Start writing pin-down tests
From the course: Agile Software Development: Refactoring
Start writing pin-down tests
- [Narrator] Our first step in working with legacy code is to add pin-down tests so let's add our first pin-down test. We'll start by examining the source code that the kata author gave us and see how it works. So at line 11 we're creating an array of items, at line 12 creating an instance of the Gilded Rose app passing in that array of items. In line 13 calling updateQuality and line 14 making an assertion about the current state of the items in the array. We'll follow that pattern as we write our pin-down tests. And now to guide us on the first pin-down test to write let's take look at the requirements again. So the first requirement says all items have a SellIn value that denotes the number of days we have left to sell the item. All items have a Quality value that denotes how valuable the item is and at the end of each day our system lowers both values for every item. Let's write a pin-down test for that behavior. We'll go back to Gilded Rose test at line 16 1/2 type @test public…
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)
Technical debt: Why it’s a problem55s
-
(Locked)
Setting up the legacy code kata4m 17s
-
(Locked)
Methodology2m 46s
-
(Locked)
Start writing pin-down tests3m 24s
-
(Locked)
Complete writing pin-down tests2m 32s
-
(Locked)
Refactoring pin-down tests4m 39s
-
(Locked)
Refactoring: Change Signature3m 30s
-
Code coverage4m 51s
-
(Locked)
Branch coverage4m 35s
-
(Locked)
-
-