From the course: Programming Foundations: Test-Driven Development
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
✓ Challenge: Database - Java Tutorial
From the course: Programming Foundations: Test-Driven Development
✓ Challenge: Database
(upbeat music) - We need to figure out a way to test the score database. - But our architect is still finalizing the design. - Yeah but if you think about it all we need to test with the database is to save and retrieve scores for each round. - How do you feel about a test double? - I mean it's interesting but how? - Well just create a proxy for the real database and we just need to make sure that when the real one comes in that our code doesn't break and that the tests still run. - That's a cool idea. Let's break it down a little bit. Here's what I think should be done. So save word plus score and return true. So when a word and a score for that word is passed to the database it saves it and then it returns true. Get word and return score. So when a word is passed to the database it checks to see if it exists in the score database and if yes it returns the score and if no then it returns zero. What do you think? - I think it sounds like a great start. Can you help us mock the score…
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.