Mastering Web Application

(Rick Simeone) #1

Building and Testing


Automated testing


Software development is hard. As developers, we need to juggle customer
requirements and pressure of deadlines, work effectively with other team
members, and all this while being proficient with multitude of software
development tools and programing languages. As the complexity of software
rises so is the number of bugs. We are all human and we will make mistakes,
tons of them. Lower-level, programming errors are only one type of defect that
we need to constantly fight. Installation, configuration and integration issues
will also plague any non-trivial project.


Since, it is so easy to introduce different types of bugs in a project we need
effective tools and techniques to battle those errors. The software development
industry as the whole realizes more and more that only rigorously applied
automated testing can guarantee quality, on-time deliverables.


Automated testing practices were firstly popularized by the agile development
methodologies (eXtreme Programming, XP). But, what was new and revolutionary
several years ago (and to a certain point controversial) is now a widely accepted,
standard practice. These days, there is really no excuse for not having a
comprehensive, automated test battery.


Unit tests are our first defense line in the battle against programming bugs.
Those tests as the name implies are focused on small units of code, usually
individual classes or clusters of closely collaborating objects. Unit tests are a tool
for a developer. They help us assert that we got the lower-level constructs right,
and that our functions produce expected results. But unit tests bring much more
benefits beyond simple, one-off code verification:



  • They help us find problems early in the development process when the
    debugging and fixing is the least costly.

  • A well-written set of tests can be executed on each and every build providing
    a non-regression test suite. This gives us peace of mind and allows us to
    introduce code changes with great confidence.

  • There is arguably no better and more lightweight development
    environment than just an editor and a test runner. We can move
    quickly without building, deploying and clicking through the
    application to verify that our change is correct.

Free download pdf