Datasheet
8
Chapter 1: Preliminary Concerns
be performed manually. Without this stage you could create a perfectly working application, however, the
end-user may never be able to use it because they simply don’t understand the layout and process.
Unit testing is the latest development fad. In the last two years, testing has become a very hot
topic with new blogs appearing every few days featuring “experts” who preach that if you don’t
write tests you are writing shoddy code. With the quick rise in popularity, it’s understandable
why one would perceive this development practice as a fad. This simply is not true with many
of the concepts being promoted today originating many years earlier.
As with the Testing Is Expensive myth, most managers listen to facts. Gather facts and present a strong
case about why testing is important. In most situations, someone who is telling you that your code is
shoddy because you don’t practice a certain testing development practice is not someone you should
trust in blind faith. The true experts understand why testing is important and will not try to force-feed it
to you. They understand why code is written without tests and will help guide you in the right direction
if you let them.
Developers only need to write unit tests. Unit tests are great to have as they help you design
code that is testable and the tests act as a safety net when making architectural changes. However,
they should never be considered as a substitution to integration tests, functional tests, and accep-
tance tests. When a tester/developer understands the purpose of each type of test, thinking that
only unit tests are needed will not be an issue.
If someone tells you this, you can assume they do not fully understand the differences between unit
tests, functional tests, and acceptance tests. Explain to them the differences, what each type of test is,
and where they apply.
Testing is easy. Creating tests is very easy, but creating tests that are meaningful is another
story. As with many other disciplines learned throughout your development career, the ability
to create good tests will come with time and experience. One of the best ways to learn how to
create good tests is to do pair programming with a developer who is experienced with creating
tests. There are many schools of thought on pair programming: what it is and how best to per-
form this method of software development. The method I found that works best for me is to
work together with another software developer on the same workstation with two monitors,
two keyboards and two mice attached. One developer writes the test and the other implements
the code to make the test pass. If one developer doesn’t agree with exactly what the other is try-
ing to accomplish, they are able to take control of the work station and explain their reasoning.
I find that sitting face-to-face works best to keep conversation flowing.
If you have convinced your manager that creating tests is a good practice, it should not be very hard for
you to convince them that you need to learn how to create good tests. Chapter 2 includes a section on what
makes good tests. Also, there are many training classes put on by top-notch trainers to assist in this area.
Iterative Processes
Have you worked at a company that only performed employee performance reviews yearly? I’m sure
most developers have, but during the yearly review have you had a manager say, “On June 13, 2008, you
forgot to shut off the kanooter value, and every Friday since then you have not been shutting it off!” or
something similar? I’m sure many developers have been in this situation. If the manager had indicated
that you were doing something wrong you could have taken measures to correct the issue. This same
96640c01.indd 8 9/25/09 7:18:28 AM