The first step toward getting the right answers from our programsĪnd the most common way to do it is to add assertions to our codeĪn assertion is simply a statement that something must be true at a certain point in a program. The good news is, doing these things will speed up our make sure we know what “correct” actually means.write and run tests for widely-used functions, and.write programs that check their own operation,.If it’s still getting the right answer as we make What they haven’t done is show us how to tell whetherĪ program is getting the right answer, and how to tell Of programming: variables and lists, file I/O, loops, Our previous lessons have introduced the basic tools Add assertions to programs that correctly check the program’s state.Ĭorrectly add precondition and postcondition assertions to functions.Įxplain what test-driven development is, and use it when creating new functions.Įxplain why variables should be initialized using actual data values rather than arbitrary constants.ĭebug code containing an error systematically.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |