Test 4 - Testing

CS 325, Software Engineering Concepts, Spring 2001


Explanations should take around 40 words. Some slack will be given to 50 or 60 word explanations (however, don't press your luck too many times on this); explanations a page or more long will lose five points.

  1. A colleague of yours had the following bright idea: rather than test for faults, test for failures. However, your colleague is unsure which of the two testing methods - structural or functional - is more appropriate for failure testing. Recognizing your expertise in software engineering, your colleague comes to you for your opinion. What do you say?


    Your colleague is apparently trying to save testing time by skipping the search for errors and looking directly for failures. Because failures are program-internal manifestations of faults, structural testing would be the appropriate method to try out your colleague's ideas.


  2. Give two explanations about why it may be a good idea to test code that has known errors in it.


    One reason is to test the quality of the tests designed for that code. If the tests can't find any of the errors, then it's probably a good idea to reconsider the criteria and generation methods associated with the test data.

    A second reason to test for known errors is that testing for a specific type of known error may reveal unknown errors of the same type. For example, testing for known buffer-overflow errors may reveal other, unknown buffer overflows.

    A third reason, related to the first, is that testing for a known number of errors can provide an estimate of the latent errors remaining after testing. If the test suite found 80% of the known errors, then it would be reasonable (or at least not unreasonable) to use 20% when estimating the latent-error count.


  3. As a member of the test department, you have been asked to sit in on a system-design review. Explain what kind of coupling are you looking for and why.


    You are looking for low coupling among modules (of whatever kind) because low coupling leads to easier testing. The lower the coupling, the greater the independence among modules. A set of relatively independent modules is easer to test than is a set of inter-dependent modules.


  4. You are part of a team developing a system that plays tic-tac-toe, and it is your responsibility to come up with a test plan for the following subsystem:
    bool winning_move(tic_tac_toe_board b, player p)
    
    that returns true if player p (either X or O) has winning move given the board b and false otherwise. Explain the test method and test cases you would use (and don't forget the 40 word limit).


    The key is to note that there are at most (39)*2, or around 40,000, possible inputs to winning_move(). This suggests that exhaustive testing is appropriate, and because the tests would involve only inputs and outputs, the tests would be functional.



This page last modified on 14 April 2001.