Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ebook) Visual Studio .NET Mastering Visual Basic.pdf
Скачиваний:
120
Добавлен:
17.08.2013
Размер:
15.38 Mб
Скачать

SUMMARY 809

Note There are many more advanced debugging tools available in Visual Studio .NET. A great list of these tools can be found in the Debug menu, under the Window submenu. (Look at the menu when you have a program running). You can get memory dumps, disassembled versions of your program, traces of the procedure call stack, a list of running threads, and other views of your program.

Summary

Testing and debugging is as critical a step in the complete development process as the design and coding steps. It’s obvious that your code won’t leave the shop with any syntax errors (since you can’t compile if you have any), but tracking down runtime errors and logic errors are just as important. All facets and functions of the program need to be put through a rigorous test procedure to help shake out these problems.

One excellent method of testing software involves asking users who have no preconceived notions about its functionality to test it for you. For example, if you’re writing software for the accounting department to use, ask members of the marketing department to test it for you. These users will have much less familiarity with the goals of the software, as well as the expected inputs and outputs. This gives them a larger chance of entering unexpected data, which can lead to unhandled exceptions in your code.

Another hidden benefit of using testers from another department is for some quick usability studies. Again, these users will be unfamiliar with the day-to-day operation of the accounting department, and the task flow of your software won’t be intuitively obvious to them. This makes for a good test of how easy your software is to use.

Copyright ©2002 SYBEX, Inc., Alameda, CA

www.sybex.com

Chapter 18

Recursive Programming

This chapter is slightly different from the previous ones because it doesn’t describe specific Visual Basic techniques or controls. Instead, it introduces a powerful technique for implementing efficient, compact programs. Recursion is a special topic in computer programming that’s one of the least understood among beginners and even among some advanced programmers. It’s surrounded by an aura of mystery, and most BASIC programmers ignore it. The truth is, recursive programming is no more complicated than any other programming approach, once you understand how it works and when to use it.

Some readers may think that the material in this chapter is of little use to the average programmer. Recursive procedures are extremely useful, however, and you have already seen recursive routines in the previous chapters. If you have read the previous chapters, you should have a good idea of the type of procedures that are implemented recursively. Recursion was a novel technique with earlier versions of Visual Basic, but with VB.NET it’s commonplace. Toward the end of this chapter, you’ll learn how to write applications that scan an entire folder and its subfolders. The FolderMap application is a customized Windows Explorer that you can incorporate in your applications even if you don’t quite understand how it works. In the last section of this chapter, I will review some of the recursive procedures used in earlier chapters. As you will see, some of the most practical and interesting applications involve recursive coding.

Copyright ©2002 SYBEX, Inc., Alameda, CA

www.sybex.com