Two sets of code may sound redundant but in the lifecycle of a project you save time. Plus, the tests are always there and serve as documentation of what the code is supposed to do. You always know the code is working, and passing testing, which increases the intrinsic value of the program.