CSE 201 Lecture Notes - Lecture 12: Gift Card, Simplicity, Junit
Document Summary
Cse 201 - lecture 12 - test driven development. Ex) adding gift card functionality to starbuzz website for orders. Order information: customer"s name, drink description, store #, gift card #. Gift card information: activation date, expiration date, balance. Receipt information: confirmation number, pickup time, remaining balance on card, purchase cost. Writing each line of code specifically as response to tests. Our first test is for representing order information. Smallest test we could write? (think basic) Keep it simple and just create new orderinformation object. However this doesn"t compile yet because we are using class names that don"t exist yet. We want tests to fail when we first write them. In our example, that will include orderinformation object. Now it"s clear that we have to create the class to pass the test. Fail first and code later: before going further by writing more tests or working on the task, write the simplest code to get the test to compile.