From the course: Programming Foundations: Test-Driven Development
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
✓ Challenge: Functionality - Java Tutorial
From the course: Programming Foundations: Test-Driven Development
✓ Challenge: Functionality
(upbeat playful music) - So now that we have a method to fetch the word, the next step in the requirement is to get a clue to be shown to the player. - Right, so let's write a test case that tests the method fetch clue that returns all characters of the word replaced by dashes when the player starts the game. - And when the player inputs a guess, then this fetch clue will also need to return these dashes replaced by correct guess made by the player, right? - That's right. So let's split our requirement into three. So first, we'll write a test case for before the player enters a guess. Second, we'll write a test case for after the player enters a correct guess. And finally, for after the player enters an incorrect guess. - So, going back to our pizza example. If the fetched word is pizza, then the fetch clue method should return five dashes. And if the player inputs a correct guess, for example A, then it should return four dashes and an A. - Right. Now also, when the player enters an…
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.