Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Order of tests

by Athanasius (Archbishop)
on Mar 11, 2016 at 17:31 UTC ( [id://1157467]=note: print w/replies, xml ) Need Help??


in reply to Order of tests

Hello John,

If you intend to run just one test (the latest one) until it passes, why run the others at all? Conversely, if you want to run regression tests while developing a new section of code, there’s no point in “running” them in such a way as to prevent them from actually running!

Or put it this way: once tests pass, the purpose of keeping them around is to detect when new code unexpectedly impacts your existing code base in unintended ways. When that happens, it’s usually an indication of a serious design flaw, so you want to know about it as soon as possible. Therefore, the regression tests should always run before the latest, expected-to-fail test.

Just my 2¢.

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Order of tests
by GotToBTru (Prior) on Mar 11, 2016 at 19:20 UTC

    I suppose the best approach is a blended one. Run the full suite at intervals but not after every tweak of the new code. The time saved by not running tests which more than likely are going to pass anyway is a real savings. You just need to balance that against how much coding and testing time (possibly the entire time between now and when you last did the full test!) you'll lose if you fail to detect a break in the older code.

    But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

      This is why it's important to separate your tests into separate files for different areas of functionality. You can run a single test file to ensure you haven't broken the functionality immediately surrounding the code you're editing, but you don't need to run the full suite every time, and periodically run the whole test suite.

      That said, if you only run your entire suite periodically, the time spent figuring out which update broke a remote part of your project might be more costly than just running the whole suite on each change.

      Typically, I run my full suite on each change. On my bigger projects with dozens of test files with thousands of tests, I at minimum run the suite on each commit prior to pushing, then on each push, Travis-CI runs the gamut on 4-8 versions as well.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1157467]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-25 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found