Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: TDD can be useful even when it doesn't achieve what you want Date: Thu, 18 Feb 2016 20:45:09 +1300 Lines: 25 Message-ID: References: <56c34b5c$0$18569$e4fe514c@newszilla.xs4all.nl> <56c4b474$0$4233$e4fe514c@newszilla.xs4all.nl> <56c4ef61$0$4197$e4fe514c@newszilla.xs4all.nl> <56c573ab$0$4031$e4fe514c@newszilla.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net m6CqIMimtdWFuR6K2iCUqQdH7VGgwjnK27Q4cx+SDapLNvTmYI Cancel-Lock: sha1:kF0Dbkn7jZKdl5usznbjL82lYGo= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Xref: csiph.com comp.lang.c++:41020 Ian Collins wrote: > Wouter van Ooijen wrote: >> Op 17-Feb-16 om 11:19 PM schreef Ian Collins: >>> >>> Let me ask you why you wouldn't obey the rules for say a device driver? >>> I certainly do and for such low level fiddly code I find TDD to be an >>> ideal tool. I like to step through, almost bit by bit, tasks such as >>> setting up device registers. The steps, both conceptually and in code, >>> are small and ideally suited to an incremental test/code/refactor cycle >>> such as TDD. Being close to a pure coding exercise, any objections to >>> TDD and design are irrelevant at this level. >> >> Let's say I write code for a UART to transmit data at a (run-time) >> specified baudrate. What would your (first) test be? > > It wouldn't be the first test (there would be more generic configuration > to test first), but the last test for the requirement would be that the > drive sits the correct bits in the the appropriate configuration It's been a long day... s/drive sits/driver sets/ > register(s). -- Ian Collins