<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 2, 2015, at 10:08 PM, Darren Cruse wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Lucida Grande'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>a.  Testing</div><div><br></div><div>Regarding my poor attitude towards TDD... :)  I have been trying to take everyone's comments to heart and have been attempting to get that black background stuff off of drracket for my pong program!!</div></span></blockquote><div><br></div><div>HtDP is NOT TDD. (I learned 'testing' in 1984 in a Franz Lisp and Scheme system. TDD is just the popularizers' way of getting a small element of good programming out to the masses.) </div><div><br></div><div>The tests/examples serve as part of the design step. How can you solve a problem w/o making examples? So HtDP is trying to create a habit. </div><div><br></div><div><br></div><blockquote type="cite">I have made some progress but I did want to ask a few pragmatic questions:<span class="Apple-style-span" style="border-collapse: separate; font-family: 'Lucida Grande'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><br></div><div>a1.  Do people *truly* go for 100% coverage i.e. *truly* get rid of all the black background stuff?</div></span></blockquote><div><br></div><div>No. Students are definitely allowed not to test the main function of a big-bang program. </div><div><br></div><div><br></div><blockquote type="cite">a2.  One kind of funny question - I attempted to add a test of my main function - which calls big-bang - esp. since drracket's showing the black background on that.  Something like this:<span class="Apple-style-span" style="border-collapse: separate; font-family: 'Lucida Grande'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><br></div><div>(check-expect (main initial-world) expected-world)</div><div><br></div><div>(define (main world)</div><div>    (big-bang world</div><div>            [name "Pong World"]</div><div>            [on-tick handle-tick]</div><div>            [to-draw draw-pong-world]</div><div>            [on-pad handle-key-down]</div><div>            [on-release handle-key-up]</div><div>            [on-mouse handle-mouse]</div><div>            [stop-when quitting? draw-goodbye]))</div></span></blockquote><div><br></div><div>If you wish to test such functions, and I need to do that, add another argument to main that specifies for how many ticks you want to run the program. Yes, I should create a big-bang clause</div><div><br></div><div>   [testing? Boolean]</div><div><br></div><div>so that people can test on a head-less machine, like we do for drdr. </div><div><br></div><br><blockquote type="cite">a3.  I also have quite a few of these "setter"/"updater" type of functions for copying a structure but setting one of it's values.  Here's one for an example:</blockquote><div><br></div><div>[It's "its" not "it's" here.]</div><div><br></div><div>Again, I'd expect students to test a function that uses pong-set-world-set-ball (what a name, how about set-pong-world-ball). </div><div><br></div><div>In general, if you are designing f and you put g on the wish list for f, I would expect that you at most derive an example from f's suite for g's -- simply for the design of g. If it is obvious, I would say, just define the function. If f fails and g is even remotely a candidate, derive tests for g from f's test suite to rule out mistakes in g. </div><div><br></div><div>This is for freshman students who have matured to a certain points. I think your pong program demonstrates that you have gotten to that point. Why don't you tackle a universe-based pong game? </div><div><br></div><div>-- Matthias</div><div><br></div></div><br></body></html>