You are on page 1of 5

Browsing Through Directories Parameters: int adder : 1 to go to next directory -1 for going to previous directory 0 when entering Browsing

mode Class Variables: directories: A dictionary of the format <string, List<string>> to store the directories of the current address. searchedDirectories: A dictionary of the format <string, List<string>> to store the directories of the latest search result. browseIndex: Index of the file that is going to be selected in the view. Initially set to 0. displayingSearchResult: A flag to indicate whether searched results are being displayed or not browsingDictionary: constructed from directories or searchedDirectries as and when needed.

Test Cases: We have 13 independent paths through the code. Following are the paths and their corresponding test cases: 1) 0-1-2-3-4-7-8: adder =0, displayingSearchResults = false and browsingDictionary contains no folder 2) 0-1-2-3-4-7-9-10-12-13: adder =0, displayingSearchResults = false, browsingDictionary contains one or more folder, browseIndex >= 0 and auditoryMode = false 3) 0-1-2-3-4-7-9-10-12-14: adder =0, displayingSearchResults = false, browsingDictionary contains one or more folder, browseIndex >= 0 and auditoryMode = true 4) 0-1-2-3-4-7-9-10-11-12-13: adder =0, displayingSearchResults = false, browsingDictionary contains one or more folder, browseIndex < 0 and auditoryMode = false 5) 0-1-2-3-4-7-9-10-11-12-13: adder =0, displayingSearchResults = false, browsingDictionary contains one or more folder, browseIndex < 0 and auditoryMode = true 6) 0-1-2-3-5-7-8: adder =0 , displayingSearchResults = true and searchedDirectories contains no folder 7) 0-1-2-3-5-7-9-10-11-12-13: adder =0 , displayingSearchResults = true, searchedDirectories contains one or more folders, browseIndex >= 0 and auditoryMode = false 8) 0-1-2-3-5-7-9-10-11-12-14: adder =0 , displayingSearchResults = true, searchedDirectories contains one or more folders, browseIndex < 0 and auditoryMode = true 9) 0-1-6-7-8: adder !=0 , browsingDictionary contains no folder 10) 0-1-6-7-9-10-12-13: adder !=0, browsingDictionary contains one or more folders, browseIndex >= 0 and auditoryMode = false 11) 0-1-6-7-9-10-12-14: adder !=0, browsingDictionary contains one or more folders, browseIndex >= 0 and auditoryMode = true

12) 0-1-6-7-9-10-11-12-13: adder !=0, browsingDictionary contains one or more folders, browseIndex < 0 and auditoryMode = false 13) 0-1-6-7-9-10-11-12-14: adder !=0, browsingDictionary contains one or more folders, browseIndex < 0 and auditoryMode = true

Browsing Through Files Parameters : int adder : 1 to go to next file -1 for going to previous file 0 when entering Browsing mode bool returning : indicates whether returning to browsing mode from switching application (required so that we dont create browsingDictionary again) Class variables files : A dictionary of the format <string,<List<string>> to store the files of the current address. searchedFiles: A dictionary of the format <string,<List<string>> to store the Files of the latest search result. browseIndex : Index of the file that is going to be selected in the view. Initially set to 0. displayingSearchResults : A flag to indicate whether searched results are being displayed or not enumerating Files : A flag to indicate whether enumeration of files is going on browsingDictionary : constructed from files or searchedFiles as and when needed.

Test Cases 1) adder =0 ,retuning = false, searchedResuts = false and browsingDictionary contains no file 2) adder =0 ,retuning = false, searchedResuts = false and browsingDictionary contains 1 or more file with enumeratingFile =false 3) adder =0 ,retuning = false, searchedResuts = false and browsingDictionary contains 1 or more file with enumeratingFile =true 4) adder =0 retuning = false , searchedResuts = true and browsingDictionary contains no file 5) adder =0 , retuning = false , searchedResuts = true and and browsingDictionary contains 1 or more files with enumeratingFile = false. 6) adder =0 , retuning = false , searchedResuts = true and and browsingDictionary contains 1 or more files with enumeratingFile = true. 7) adder !=0 or returning = true , browsingDictionary contains no item 8) adder !=0 or retuning = true , browsingDictionary contains 1 or more file with enumeratingFile = false.

9) adder !=0 or retuning = true , browsingDictionary contains 1 or more file with enumeratingFile = true 10) browsing dictionary has 1 or more folders and browseindex =0 and adder =-1 (should go the the last directory in the view) 11) browsing dictionary has 1 or more folders and browseindex =0 and adder = 1 (should go to the next directory if present) Switching Application Parameters : Nil Class variables maxProcess: Total no. of files opened through our Application. currentProcess: The index of the current file that is opened. 0 indicates SmartEars browseIndex: Index to denote the last selected file in browsing mode filesOpened : denotes that the current view item is a file. Test Cases Following test cases cover the two possible paths through the code: 1) 0-1-3-5-7-9: a) Invoking Switch Application when there are no opened files b) Invoking Switch Application from a file with currentProcess = maxProcess 2) 0-1-2-4-6-8-9: a) Invoking the function from SmartEars window with one file open b) Invoking function with multiple files opened and currentProcess < maxProcess

Opening directory Parameters String address: address of the directory to which we have to jump to. Class Variables directories: A dictionary of the format <string,<List<string>> to store the files of the current address. searchedFiles: A dictionary of the format <string,<List<string>> to store the Folders/Files of the latest search result. displayingSearchResults : A flag to indicate whether searched results are being displayed or not

Test Cases We have 8 independent paths through the code. Following are the paths and their corresponding test cases: 1) 0-1-3-5-6-7-8-9: showingSearchResults=false, more than one conflicting names and audioMode=false 2) 0-1-3-5-6-7-8-10: showingSearchResults=false, more than one conflicting names and audioMode=true 3) 0-1-3-5-8-9: showingSearchResults=false, more than one conflicting names and audioMode=false 4) 0-1-3-5-8-9: showingSearchResults=false, more than one conflicting names and audioMode=true 5) 0-1-2-4-5-6-7-8-9: showingSearchResults=false, only one conflicting name and audioMode=false 6) 0-1-2-4-5-6-7-8-10: showingSearchResults=false, only one conflicting name and audioMode=true 7) 0-1-2-4-5-8-9: showingSearchResults=false, only one conflicting name and audioMode=false 8) 0-1-2-4-5-8-10: showingSearchResults=false, only one conflicting name and audioMode=true

*Eg hello world conflicts with hello world and hello conflicts with ../../hello (in case of search results). In this case user is prompted to select the appropriate directory from given options.

Opening file Parameters String fileName : address of the file which we have to open . Class Variables files: A dictionary of the format <string,<List<string>> to store the files of the current address. searchedFiles: A dictionary of the format <string,<List<string>> to store the Folders/Files of the latest search result. displayingSearchResults : A flag to indicate whether searched results are being displayed or not Test Cases We have 8 independent paths through the code. Following are the paths and their corresponding test cases: 1) 0-1-2-4-5-6-7-8-9: showingSearchResults=false, more than one conflicting names and audioMode=true 2) 0-1-2-4-5-6-7-8-10: showingSearchResults=false, more than one conflicting names and audioMode=false 3) 0-1-2-4-7-8-9: showingSearchResults=false, only one conflicting name and audioMode=true 4) 0-1-2-4-7-8-10: showingSearchResults=false, only one conflicting name and audioMode=false

5) 0-1-3-4-5-6-7-8-9: showingSearchResults=true, more than one conflicting names and audioMode=true 6) 0-1-3-4-5-6-7-8-10: showingSearchResults=true, more than one conflicting names and audioMode=false 7) 0-1-3-4-7-8-9: showingSearchResults=true, only one conflicting name and audioMode=true 8) 0-1-3-4-7-8-10: showingSearchResults=true, only one conflicting name and audioMode=false

Searching Test Cases Following are the paths through the code and their corresponding test case: 1) 2) 3) 4) 0-1-3-6-7-9: SmartEars Leave Search 0-1-3-6-7-8-9: SmartEars Start Search 0-1-3-2-1-3-6-7-8-10-11: A,B,C,D -> SmartEars Start Search 0-1-3-6-5-1-3-2-1-3-6-7-8-10-11: SmartEars Cancel Last Alphabet -> X,Y,Z,A -> SmartEars Start Search 5) 0-1-3-2-1-3-6-5-4-1-3-6-7-8-9: Alpha -> SmartEars Cancel Last Alphabet -> SmartEars Start Search 6) 0-1-3-2-1-3-6-7-9: Delta -> SmartEars Leave Search Create Bookmark Test Case We have 6 independent paths through the code. Following are the paths and their corresponding test cases: 1) 0-1-2-3-7-9: BookmarkFile does not exists and auditoryMode = false 2) 0-1-2-3-7-8: BookmarkFile does not exists and auditoryMode = true 3) 0-1-5-7-9: BookmarkFile exists, bookmark for current directory already exists and auditoryMode = false 4) 0-1-5-7-8: BookmarkFile exists, bookmark for current directory already exists and auditoryMode = true 5) 0-1-5-4-6-7-9: BookmarkFile exists, bookmark for current directory does not exists and auditoryMode = false 6) 0-1-5-4-6-7-8: BookmarkFile exists, bookmark for current directory does not exists and auditoryMode = true

You might also like