Support the ongoing development of Laravel.io →
posted 10 years ago
Testing
Last updated 2 years ago.
0

If you write the unit tests after you write your code, then it will take longer. It will also be harder as you may run into issues with the testability of your code, or your application structure generally that you might have avoided by writing them before.

But that doesn't mean it's easy to write them before. Until you've been doing it for a while, it's not. It's very difficult and yes it will slow you down.

But it's an investment. As you gain experience the overhead goes down and you find you get the benefits of better decoupled applications and less code needing to be written. So you can certainly get to the point where you can write tests and code faster than you can write code and then test it (and re-test it each time you make a change). But it doesn't happen overnight, or even quickly.

But even before you reach this point, you start to get the benefit of much more maintainable code and the ability to handle client-requested changes without the need to go into a corner and have a little cry first.

Last updated 2 years ago.
0

petercoles said:

But even before you reach this point, you start to get the benefit of much more maintainable code and the ability to handle client-requested changes without the need to go into a corner and have a little cry first.

This cracked me up. I'm also looking in to learning more about tests and the different kinds.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

geocine geocine Joined 10 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.