Test 3 - Production

CS 325, Software Engineering Concepts, Spring 2000


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

  1. Is it possible to practice structured programming using conditional gotos (if bool then goto label) as the only control structure? Explain your answer.


    Structured programming imposes a one entry, one exit structure on code. Normally, this is done with with stylized versions of the if and while statements. However, it is straightforward to implement the stylized versions of if and while using conditional gotos, so it is possible to practice structured programming using conditional gotos.


  2. The Law of Demeter applies to object-oriented programming, but explain how would you interpret it relative to a procedural language such as C?


    The Law of Demeter restricts the ways in which a method may gain access to an object. An analogous interpretation of the Law of Demeter for functions would restrict the ways in which a function access variables. In particular, programmers would be discouraged from accessing global variables from within procedures, and rely instead on parameters and local variables.


  3. Are Halstead metrics more appropriately collected using static or dynamic analysis techniques? Explain your answer.


    The basic Halstead metrics are

    nopr the number of unique operators used in a program
    nopn the number of unique operands used in a program
    Nopr the total number of operators used in a program
    Nopn the total number of operands used in a program
    These are all metrics that can be determined by scanning the program text; that is they are static metrics and can be discovered using static analysis techniques.


  4. How is unit testing influenced by the decision to implement top down or bottom up? Explain your answer.


    Unit testing involves testing each unit (procedure, object, module) in isolation after it's been created. Because the unit is tested in isolation, the choice of top down or bottom up implementation exerts no significant influence over unit testing.



This page last modified on 24 March 2000.