Professional Visual Studio 2005 Team System (Programmer to Programmer)

All software development projects have a finite schedule and budget. It is up to the software test engineers and the project managers to decide what tests to implement to reach the goal of producing stable and reliable software.

There is quite a bit of debate within the developer community as to the merits of manual testing versus automated testing. Extreme Programming (XP) practitioners typically favor automated testing in the interest of saving time. Automated tests can verify results, but are constrained within a set of predefined problems. Manual testing can undoubtedly uncover problems that are not easily found using standard testing tools.

We will look at the features of both automated tests and manual tests. You can then make an informed decision as to what tests will give you the best results for the projects on which you are working.

Test automation

Automated tests are very handy because you can implement them as part of the build process using Team Foundation Build (you can learn more about Team Foundation Build in Chapter 24). For obvious reasons, manual tests are not designed to be used within an automated test environment. Team System has several built-in automated tests, including load tests, generic tests, and unit tests. Test automation makes a great deal of sense for medium to large software projects.

Automated tests are easily deployed, can quickly be executed by the build server, and are highly suited for repetitive tasks (you can run automated tests hundreds of thousands of times with ease). Therefore, it makes regression testing a snap. (Regression testing is the process of retesting your application to make sure you don't introduce bugs while in the process of fixing other bugs.) Automated tests hook into Team Foundation Build, enabling you to focus on other tasks. You can have a farm of build servers running through a battery of automated tests, enabling your testers to deal with "show-stopping" problems.

However, testing is an iterative process — you should constantly look at the effectiveness of your tests and adjust as needed during the lifetime of your project. By refining the test process, you can document best practices to carry forward in future projects.

Test automation works really well for long-term projects. One of the main reasons for this is cost — designing an automated test framework and elaborate test cases takes a lot of work hours to implement. This is not to say that it isn't a good idea to automate tests in smaller projects. In fact, many Agile practitioners swear by automation. In some cases, a manual bug fix may take just a few minutes to correct. In the end, the decision should be based on the effective prioritization of your time and cost.

Use automated tests to review your application structure and code. Automated tests are not really effective for usability (and other user-centric issues). It would be very difficult (and impractical) for a human tester to manually generate a code coverage report for an application with millions of lines of code (such as the Windows operating system). This is an area where automated tests really shine — machines can perform tests such as code coverage and static and dynamic code analysis with little to no personnel required.

There are, however, tools that bridge the gap. One example is the Framework for Integrated Testing (FIT) by Ward Cunningham and related tools (such as FITnesse). FIT excels at running acceptance and regression tests. FIT allows a customer or tester to use a Microsoft Word document to model how an application should behave. Using "fixtures" (code written by programmers), FIT compares the values in the HTML table with the software. It makes it easy for a nontechnical user to interact with a complex application. You can learn more by visiting the following website: http://www.fit.c2.com/.

Here is a short list of some of the processes you may want to automate:

Manual testing

Manual testing is the process of testing software by hand and writing down the steps to reproduce bugs and errors. Before you start manually testing an application, you should formulate a solid set of test cases. Automated tests are predefined in scope, and can only confirm or deny the existence of specific bugs. However, an experienced tester has the advantage of being able to explore facets of the application and find bugs in the most unlikely places. Because software isn't completely written by machines (yet), human error can creep into the design and structure of an application. It takes the eye of a good tester to find these flaws and correct them.

Accuracy is one of the main challenges of running effective manual tests. If your tester isn't using careful documentation and a solid methodology, he or she may miss bugs. Manual tests are well suited for small or one-shot development projects. Again, cost becomes an issue; due to small budgets and lack of resources, it may be impractical to implement large-scale custom testing frameworks. Small projects usually have aggressive development schedules, so you have to make the best use of your time.

Even if you are an Agile developer, you shouldn't disregard manual testing. As mentioned before, some tasks shouldn't be automated. For example, the most effective way of tracking down user interface and usability problems in your application is by using manual testing techniques.

In most development environments, manual tests are performed as a prelude to automated tests. Manual testing practices may also be incorporated into the bug documentation process. Here are some of the tasks you can't easily automate:

Категории