Skip to main content
  • Home
  • Blog
  • Sandbox

Alvin Pascoe

Website Developer

Alvin Pascoe
Loading.....
  • The Beauty of Code
    The Beauty of Code
  • Decoupled Front-ends
    Decoupled Front-ends

Software Testing

12th May, 2019

Testing is important. Very important.

There are all sorts of different types of software testing and arguments as to which ones are the best, but I think the most important thing is that you are doing some sort of testing.

I have heard those developers who say that they don't have time for testing or the client isn't willing to pay for testing... and yeah, I do get that sometimes there is a massive deadline that needs to be met and you're working 16 hours a day and over weekends to get this work done, but that really should be the exception, not the rule.

Testing your code really does make it easier to maintain in the long run. A number of times I've gone back into some code to make a tweak and then realised by running the tests that I've just broken (what I thought was) a whole different section. It's those moments, before you push broken code out to production, that you most appreciate your test suite!

Something that I struggled with regarding writing tests was the time it takes to write them. Ideally, you should write your test suite before you write any of the actual code (a practice called Test Driven Development). By doing this, initially your tests will fail (since you haven't written your code yet) and then as you do write your code, they will start passing one by one. This is a very satisfying feeling!

However, something that I underestimated was the time it takes to write good tests... I could very easily spend more time writing the tests than the solution itself. The more you write tests, the faster you become, however it would still be quite normal to spend more time on the tests, than the code (especially on projects where I was very familiar with the code... for example, I'd know exactly where in the code I'd need to tweak to change some functionality, but need to spend time figuring out how I test that new service that makes those specific API calls). I don't think this is a bad thing, I think it just requires a shift in your thinking, since this time spent on writing tests now is an investment... it really does make the code more maintainable and quicker to troubleshoot.

It also has the benefit of acting as documentation... since we have a list of how certain functions and methods are expected to behave. If the requirements of the project change, then so does our tests and in turn, so does our living, breathing documentation.

So yes, I can understand how a developer can think that they don't have time to write tests, but I think that if they tried it out, just on one project, they'd realise that it really is worth that investment in time (and there's nothing like seeing all your tests passing!).

  • Programming
  • Previous Article: The Beauty of Code
    Previous Article: The Beauty of Code
  • Next Article: Decoupled Front-ends
    Next Article: Decoupled Front-ends

Blog Archives

  • December 2019 (1)
  • November 2019 (1)
  • August 2019 (1)
  • May 2019 (1)
  • October 2018 (1)
  • February 2017 (2)
  • January 2017 (3)
  • November 2016 (1)
  • July 2016 (1)
  • January 2016 (1)
More...

Categories

  • Angular
  • CSS
  • Development Environment
  • Drupal
  • Git
  • JavaScript
  • Mac
  • Programming
  • React
  • Tutorial
  • Workflow
  • Home
  • Blog
  • Sandbox
  • Pattern Library
© 2026 Alvin Pascoe
hello{at}alvinpascoe{dot}com
Made by Me, Alvin Pascoe