Comments on CSC408F End of Term Test Fall 2000/2001 In general answers that regurgitated the lecture notes received lower marks than answers that actually applied the material in the course to the problem raised in the question. Vague and generic answers received lower marks than answers that addressed the specific issues raised in the question. 1. Either choice could receive full marks, IF it was accompanied by a well written justification. Personally I'd probably buy the coupling tool because cohesion is easier to deal with manually. 2. There were some good answers to this question. The KISS manager should be involved in all stages of software development. They should monitor simplicity in the specifications, design and implementation. A good answer proposed proactive steps to help keep the software simple. 4. Many people misunderstood this question and didn't discuss the process of transforming a failure into a fault. Useful information includes - a description of the environment in which the software is being operated. - a complete list of any custimizations that the user has performed on the software. - the exact release and version of the software. - the system model that was archived when the release was created. - the version control archive from the release. - the tests that were performed on the software before it was released. - the internal documentation for that particular release of the software. - the external documentation for that particular release of the software - the source code for the modules that might be causing the failure. 6. A lot of people came up with reasonable strategies. - stop (or delay) development. - deploy some developers to work on testing - start with black box testing based on requirements and specifications - develop a test plan - work with developers to build black box tests. - start with unit testing since that's easy with partially developed software. 7. Almost all of the answers to this question were very disappointing. a) 10,000,000 is a enormous number. A person can't possible check the correctness of a sort of that many numbers without proper tools. At the very minimum I'd want - a driver program to pass arguments to sort, capture the output - a test case generator to build arrays of data for input to sort - a program to check the output of sort. This involves two sub-checks isSorted( A, N ) checks that the N elements of A are in order. isPermutation( A , B , N ) checks that array B is a PERMUTATION of the elements in the array A. i.e. no data was lost or added. - a report generator to summarize testing results - a data base for storing test data, test output. b) A lot of answers obsessed about strange values for N and almost ignored the data being sorted. The only special (error) cases for N worth testing are one N < 0 , N = 0, one N > 10,000,000 A lot of answers said effectively "put some non-double data in the array" or "use an array where the number of data values is not the same as N" Both of these ideas are nonsense. - BITS ARE BITS. No matter what strange data you assign to the array being sorted (.e.g. "AB") the sort routine will treat is as a double precision number. All you are doing is using a clumsy way to assign data to the array. - the output of such a test is not well defined. sort will sort whatever data is in the array whether you put it there or not. Here's the beginning of a fairly rigorous test plan for sort for N in 1 , 2 , 3, 100 , 101 , 5000 , 21,001 , 700,000 , 1,111,111 , 4,567,891 , 6,543,210 , 9,999,999 , 10,000,000 sort an array of N elements that is already is ascending order sort an array of N elements that is laready sorted in descending order sort an array of N random elements with no duplicates. for K in 1 ,2 , 3, 101, 1000, 49,999, 2,211,112 AND K <= N sort an array of N random elements where ALL BUT K of the elements are already sorted and the unsorted elements are unique and are - at the start of the array - at the end of the array - at the middle of the array - in a block at some random location in the array - scattered randomly throughout the array repeat the tests above with all K unsorted elements being the same random value. 8. This example came from a paper on automating testing, i.e. trying to automatically generate test data to test this class. A good answer would describe what the class did a few lines at a time. The following problems should have been detected. - an ERROR in lines 11-13. returnQtrs should reset allowVend to 0 Otherwise a user could put in 4 quarters, push coin return to get the quarters back, and still get a drink. - a missing semicolon on line 15 - the use of a magic number ( 3 ) and a sloppy test on line 16 The price of a drink should be a named constant and the test should be something like if( curQtrs >= DRINK_PRICE ) - bad logic on line 22 If a user puts in more that 4 quarters, all of them get consumed by the first purchase thus ripping off the user. Assuming the underlying hardware has the capablilty (many mechanical coin boxes don't) a user friendly replacement would be curQuarters -= DRINK_PRICE ; allowVend = ( curQuarters >= DRINK_PRICE ? 1 : 0 ) ;