KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to use Test Driven Development to implement my signal processing library. But I have a little doubt: Assume I am trying to implement a sine method (I'm not): Write the test (pseudo-code) assertEqual(0, sine(0)) Write the first implementation function sine(radians) return 0 Second test assertEqual(1, sine(pi)) At this point, should I: implement a smart code that will work for pi and other values, or implement the dumbest code that will work only for 0 and pi? If you choose the second option, when can I jump to the first option? I will have to do it eventually...
Tags (comma-separated)
Save Edits
Cancel