CEG 460: Software Engineering

Winter 2010 // Final Exam // 120 minutes // 100 points

  1. Develop a solution to the Next Permutation Problem as source code (10 points) in C++/C#/Java. Focus on assertions (20 points). We discussed requirements analyis in class; so skip it.

  2. (10+10 points) Explain "unit testing" and "integration testing."
  3. (a)   (5*4 points) Explain the meaning of the following OCL notations.
    c->forAll(var | expr)
    c->exists(var | expr)
    s1->intersection(s2)
    seq->first()
    
    (b) (10 points) The following is a valid OCL snippet from a specification. Explain its meaning. Point out what is OCL notation and what is defined in the Controller class, etc.
    context Controller::enterKey(k : Key) : Boolean 
    post: let allValidKeys : Set = self.checker.validKeys() 
        if allValidKeys.exists(vk | k = vk) then 
           getNumOfTrials() = getNumOfTrials()@pre 
        else
           getNumOfTrials() = getNumOfTrials()@pre + 1 
    
    post: getNumOfTrials() >= getMaxNumOfTrials() implies 
              self.isBlocked() and self.alarmCtrl.isOn() 
    
  4. (a)  (10 points) ACM Software Engineering Code of Ethics discusses the code under several categories. Briefly discuss any two.

    (b)   (10 points) You have been hired by a company to develop a new web browser. You have been asked to add a feature that works as follows. Every time a user clicks on a link, before loading the associated page a message is sent to your company that includes the date and time, the selected URL, and the serial number of the specific browser. What are the ethics implications, if any, of this request and how would you respond?


Copyright 2010 Prabhaker Mateti • Mar 18, 2010