Re: TDD for numerical algorithms
Adam Sroka <[email protected]> Tue, 25 May 2010 01:53:39 -0700
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <[email protected]> |
On Mon, May 24, 2010 at 9:55 PM, Richard <[email protected]> wrote: > > > > In article <[email protected]>, > Adam Sroka <[email protected]> writes: > > > Make sense? > > Sort of, but its not really a satisfying answer. > Sorry. I was going for technically correct and clearly stated. Satisfying is above my pay grade ;-) > Yes, TDD can be about exploring an evolutionary design with emergent > properties that result in a solution satisfying the tests. That works > fine for business software when you're exploring possibilities and > pruning time-wasting branches from the search tree as you seek to > satisfy a business need. > It's more about challenging our assumptions about what we "need" to do so that we can discover simpler alternatives. > Yet TDD doesn't preclude implementation of known algorithms or having > an up-front design. > If you are following the rules of TDD then you are compelled not to implement something that is more complex than absolutely necessary to pass the current set of tests. You are also compelled to do that incrementally, one small test at a time. Keeping the solution as simple as possible as you go along. > I would like to hear some experiences about developing numerical, > scientific or simulation software with TDD. Mersenne Twister was just > one example of a class of problems. > Algorithms are, by their nature, generalized solutions. TDD eschews generalized solutions in favor of a specific solution to the problem immediately posed. So, TDD solutions rarely resemble the generic algorithm. Most often they look naively simple by comparison. I have solved a number of numerically intensive problems using TDD. However, in most cases the goal of TDD is to solve some problem that is not yet well understood. Known solutions to well understood problems probably require a different approach. If I need a sort or a random number generator or a string parser, etc. I will probably just use someone else's library. TDD does, on the other hand, provide me with a set of tools to challenge the assumption that I need these things in the first place. ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/refactoring/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/refactoring/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/