• The dismal state of Javascript testing

    Javascript has become one of the most important languages used today. There are many indicators, one of which is GitHub’s report of the most popular languages at GitHub’s repos earlier this tear. If you have worked on any small web project, chance’s are that the testing strategy was lacking. When I saw the result of Ashely Nolan’s front end survey that he ran, the results still surprised.  Close to 60% of the people that responded to the survey said that they don’t use any kind of Javascript testing framework.

    Why should we care to test?

    • Fast feedback loop. We want to get feedback quickly if we break functionality and not wait until QA tests it days or even weeks later and we already work on a different user story.
    • Refactor aggressively with confidence. We want to keep our code nimble and remove duplication and we need to be confident that we have tests that will catch us if we break the functionality.
    • We want to save time. Running even many thousands of unit tests is going to much quicker than manually test every time we make a change that we want to verify if it works.
    • We want to be able to integrate and deploy quickly. How can we ever consider moving to Continous Delivery if we don’t have a good test suite? It’s not enough to just have unit tests but they are the base of the testing pyramid and incredibly important.
    • Unit tests should be the base of your testing pyramid. We will miss broken functionality if we don’t have a solid base of unit tests. Manual testers can only keep up in a small and simple application.

    These are some of the basic reasons why testing is important. As we get more comfortable writing good unit tests, we should learn about TDD and how it helps us design our application and well and the nice benefit that it also gives us lot’s of good unit tests.

     

    Categories: Javascript, Testing

    Leave a Reply

    Your email address will not be published. Required fields are marked *