On Wed, Mar 09, 2016 at 01:23:40PM -0700, Davide Del Vento wrote:
> For example, if you use a library for the first time, you will be
> probably writing some "throw-away" code (maybe in ipython/jupyter)
> to see how it behaves. Make those a unit test! You will have a test
> on your assumptions.  You might or might not discover a bug in this
> (or future) release of the library, but you will make clear what
> assumptions you have on it. If a test against the library fails, you
> either have found a bug on the library itself, or find a bug in your
> assumptions.

If you write unit tests for the library, please submit them to the
library so all consumers can benefit from testing those assumptions
;).

> Frankly, I could tease Trevor attitude and say "you can never know
> if computers are right, so why bother writing good code? just write
> what you can and hope for the best".

I'm in favor of testing all the things ;), I was just guessing at the
distinction Ashwin was making between unit tests for libraries and
unit tests for applications [1].  I think the takeaway is that no test
will ever make it easy to locate bugs without further digging, but
that the more narrowly scoped your tests are, and the more testing you
have on each layer of your stack, the less work that digging will be.
I think most folks are on board with that, and we're just tripping
over the “unit test” vs. “integration test” phrasing.

> 3) Moreover, if you also do TDD or at least "test first", I firmly
>    believe…

While I like tests, I think test-driven development is going to be a
hard sell to folks who haven't written much software before.  Robust
test suites are much easier to sell to people that have been through a
big, ugly refactor at some point ;).  And for folks I don't work with
directly, I'm more interested in the outcome (does your project have
good test coverage?) than the workflow used to get there (TDD, or
“tests grafted on as we have time” ;).

Cheers,
Trevor

[1]: 
http://lists.software-carpentry.org/pipermail/discuss_lists.software-carpentry.org/2016-March/004042.html
     Subject: Re: [Discuss] scientific computing, HPC and tests
     Date: Wed, 9 Mar 2016 07:15:31 -0500
     Message-ID: 
<CANLckLvD--xS+4B+X-vsW3_0kaqSBnGKX_c68zWkBW7rBbb0=q...@mail.gmail.com>

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Discuss mailing list
Discuss@lists.software-carpentry.org
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org

Reply via email to