Question 7: Test case development [9]

Provide detailed test cases, and justifications for your specific choices of test cases, for the disk analyzer program specified below.
(Question 8 deals with how you'll organize/apply these test cases.)

(Space is provided on the following page for your answer.)

The overall purpose of the program is to perform disk space analysis on the contents of a directory - e.g. the user could call it on their home directory to get an analysis of where their disk space is being used.

The user provides, as command line arguments, the name of the directory to be analyzed and a value between 0 and 100 representing a usage threshold, e.g. 25 would mean 25%.

The program explores the directory and its subdirectory tree, displays the total space used by the directory, and then for each file and each subdirectory that uses more than the specified percent of the total space in the directory the program will display:

  • the name of the file or directory,
  • the total space used by the file or directory (directory space includes all its subdirectories)
  • the percent this represents of the total.
For example, suppose it was called as follows: diskAnalzyer ~ 20
and suppose the total space taken up by the user's directory was 150m.
Then the program would display the path/name, size, and % of every file or subdirectory in the user's account that was at least 30m (20% of 150).
E.g.
      ~ total space: 150m
      43.0% (64.5m): ~/.mozilla/
      40.0% (60.0m): ~/.mozilla/cache/
      35.0% (52.5m): ~/.mozilla/cache/oops.txt

Of course, the program should provide suitable error messages (and NOT crash) if it is provided with invalid command line arguments, and when it encounters files or directories it does not have permission to access.