OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< Previous | Contents | Next >

Test Cases

To perform useful testing, it's important to develop and apply good test cases. This is done by carefully choosing input data or operating conditions that reflect edge and cor- ner cases. In our code fragment (which is very simple), we want to know how the code performs under three specific conditions:

1. dir_name contains the name of an existing directory

2. dir_name contains the name of a non-existent directory

Testing


3. dir_name is empty

By performing the test with each of these conditions, good test coverage is achieved.

Just as with design, testing is a function of time, as well. Not every script feature needs to be extensively tested. It's really a matter of determining what is most important. Since it could be so potentially destructive if it malfunctioned, our code fragment deserves careful consideration during both its design and testing.


Top OS Cloud Computing at OnWorks: