Datasheet

7
Chapter 1: Preliminary Concerns
Tests Are Only for Use with Agile Software Development
Unit testing and Test Driven Development are fundamental processes for XP and many other Agile
Software Development methodologies. Just because one process uses a great tool doesn’t mean it wont
fit into your process.
If your manager doesn’t like the word Agile, dont refer to the practice of creating unit tests as an Agile pro-
cess. Just call it unit testing. As a web developer, you may be familiar with Lorem Ipsum. Lorem Ipsum is
used as a placeholder for text and is from the Latin work of Cicero’s De Finibus Bonorum et Malorum.
Lorem Ipsum is intended to have no meaning because customers often focus on the text rather than the
layout of the text. Use this trick on your manager. Some managers are not comfortable with Agile processes
because of a lack of knowledge or misunderstandings about how the processors work .
Tests Have to Be Created Before the Code Is Written
Test Driven Development (TDD) is a process that we will explore briefly later in this book in Chapter 3,
but for now all you need to know is that it’s a process where a unit test for a given functionality is cre-
ated before the code for the functionality is written.
For a TDD purist, this is not a myth and a test has to be created before the code is created. For someone
who is new to testing, TDD can be hard. Before a developer thinks about getting into TDD they should
first learn what makes a good unit test. In Chapter 4, we will explore what makes good tests and
explore both unit testing and TDD.
It’s hard to maintain tests. As you begin creating tests for your code, your test suites often become
quite large and unwieldy. If your tests are written poorly then they will be hard to maintain just as
with other code. With the correct architecture and considerations in the correct place as described
in this book, you should find that your tests and the overall system are easier to maintain.
Having a large suite of tests that fully test your application is an investment. Its your job as a developer
to convince your manager of the importance of having a test suite that fully tests your application.
You can’t automate user interface code. In the past, creating code to automate user interface
code has been difficult. Tools such as the MS Test Web Test and WatiN make automated user
interface testing possible.
If a manager states that automated user interface testing is not possible, simply point them to the tools.
Be aware, though, that automated user interface tests are often brittle and require more time for mainte-
nance than unit tests. In Chapter 5 you will explore automated user interface testing. With the correct
knowledge and time, automated user interface testing can be achieved.
Unit tests remove the need for manual testing. Although unit tests will become a valuable
resource for your system, they alone do not replace the need for the system to also be manually
tested. Unit tests verify isolated blocks, but we need to ensure that the system works as a whole.
Manual testing involves ensuring that the system works as expected when everything is deployed
correctly. When manually testing the system, not only will you be ensuring that the UI is rendered
correctly, but you will also be verifying that the application and UI are actually useable.
Although you can automate different parts of the application, it is not yet possible to automate so that the
application can be understood by the end-user and is easy to use. This is a very important stage and has to
96640c01.indd 7 9/25/09 7:18:28 AM