Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Universal test flag

by zwon (Monsignor)
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)


Comment on Re^4: Universal test flag
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-09-03 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls