Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
Is code duplication allowed in this instance?
 

Index | Next | Previous | View Flat


hkmshb at gmail

Jul 3, 2009, 3:46 AM


Views: 286
Permalink
Is code duplication allowed in this instance?

Hi all. I believe in programming there is a common consensus to avoid
code duplication, I suppose such terms like 'DRY' are meant to back
this idea. Anyways, I'm working on a little project and I'm using TDD
(still trying to get a hang of the process) and am trying to test the
functionality within a method. Whoever it so happens to verify the
output from the method I have to employ the same algorithm within the
method to do the verification since there is no way I can determine
the output before hand.

So in this scenario is it OK to duplicate the algorithm to be tested
within the test codes or refactor the method such that it can be used
within test codes to verify itself(??).
--
http://mail.python.org/mailman/listinfo/python-list

Subject User Time
Is code duplication allowed in this instance? hkmshb at gmail Jul 3, 2009, 3:46 AM
    Re: Is code duplication allowed in this instance? ricli85 at gmail Jul 3, 2009, 4:29 AM
    Re: Is code duplication allowed in this instance? bieffe62 at gmail Jul 3, 2009, 5:34 AM
    Re: Is code duplication allowed in this instance? lie.1296 at gmail Jul 3, 2009, 5:49 AM
    Re: Is code duplication allowed in this instance? steve at REMOVE-THIS-cybersource Jul 3, 2009, 6:11 AM
    Re: Is code duplication allowed in this instance? bearophileHUGS at lycos Jul 3, 2009, 7:34 AM
    Re: Is code duplication allowed in this instance? hkmshb at gmail Jul 4, 2009, 4:18 PM
    Re: Is code duplication allowed in this instance? ldo at geek-central Jul 5, 2009, 2:54 AM
        Re: Is code duplication allowed in this instance? drobinow at gmail Jul 5, 2009, 5:21 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.