Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^4: Universal test flag

by zwon (Abbot)
on Jul 18, 2012 at 17:08 UTC ( #982490=note: print w/replies, xml ) Need Help??

in reply to Re^3: Universal test flag
in thread Universal test flag

the hard truth in the commercial world

Oh, you apparently think that I'm living off charity and only write abstract examples ;)

refactoring always falls in second place, after you get the (ever changing) functionality pinned down

refactoring is not something you do after implementing functionality, it is something you do to implement functionality in a most efficient way (and so save time and money)

Replies are listed 'Best First'.
Re^5: Universal test flag
by ait (Friar) on Jul 19, 2012 at 12:07 UTC
    Oh, you apparently think that I'm living off charity and only write abstract examples ;)

    No sir, I don't make those assumptions ;-)

    What I'm saying is that it's very different, for example, to code a well thought-out CPAN library, than working on a large system with a team of coders at different levels, with time and money constraints.

    I think that your comments refer more to design than to the process of coding. Refactoring by very definition is a continuos and disciplined process after the fact, so your assumption above is actually wrong and must not be confused with good design. Good design is paramount, and that is not in discussion.

    Furthermore, to actually be able to refactor you must first have a solid set of tests so when you actually refactor, you can guarantee the same functionality that should have been pinned down beforehand.

      to actually be able to refactor you must first have a solid set of tests

      And the exact problem with what you are trying to do is that it isn't solid. Suppose later you extract SMS sending code into a separate module, will your tests help you to find if you broke anything? No, because the code that may be broken by the change is being skipped in the test mode.

      So what I would do, is to write solid test, and refactor code to pass it.

        I think we are talking about two different things here. I understand what you are saying but this is not the case that the SMS code is inside the function and later factored out (in fact the SMS part was a made-up example to illustrate). I'm talking about the the case where the sub you are testing calls something else and you want to skip that, the same way you may skip tests in your test harness.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982490]
Corion orders some gifts online :)
[ambrus]: We're spending Christmas and the week after at my brother's place. First time ever, because the last four years they could came home instead.
[ambrus]: robby_dobby: wait what? Glasgow? isn't that one of the most boring towns ever?
[marto]: ambrus: no :)
[robby_dobby]: ambrus: Dunno. marto is from Glasgow. I'm in London and I say London is quite colourful, but boring :-)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2017-12-15 10:49 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (431 votes). Check out past polls.