Software Engineering Dr. Levine Sample Final ANSWER ANY SET OF QUESTIONS TO TOTAL 100 POINTS AS INDICATED Provide the best answer for problems 1 - 9 1) Which item should not be part of the external specification of a module a) the module name b) the module's purpose c) a description of all input, including parameters d) a description of all output, including external effects e) a specification of the algorithm f) a list of preconditions or assumptions upon entering the unit (if any) 2) In order to increase the reliability of software systems, module interfaces should be a) totally eliminated b) hidden c) made as flexible as possible d) minimized, if possible to scalar (simple) values such as bytes or numerics 3) Order the following categories of module coupling from most desirable to least desirable for reducing software complexity: a) common coupling: dependence thru global data b) control coupling: dependence through passed flags controlling module functions c) content coupling: dependence through one module directly modifying the other d) data coupling: dependence through data passed as parameters e) stamp coupling: dependence through data structures passed as parameters 4) Order the following categories of module cohesion from most desirable to least desirable to reduce software complexity: a) logical cohesion: several logically related functions in the same unit b) temporal cohesion: sequentially executed functions are placed in the same unit c) sequential cohesion: the output of one part of the unit is input to the next part d) communicative cohesion: all functions on same data set in the same unit e) functional cohesion: every portion of the unit is essential to the performance of a single function 5) A good test plan for a module will a) not require documenting the test's result b) cause execution of each instruction at least once c) test every possible value of the input data d) choose input data by randomizing values e) find all errors in the module ANSWER: b 6) The usual approach to the testing of an entire system takes a) a bottom up approach b) a top down approach c) a black box approach d) a random number of input cases 7) Software errors occur because a) the size and complexity of some systems are beyond human understanding b) customers may not know how to specify their requirements accurately c) programmers may not know how to interact with their customers in a way to obtain complete and consistent specifications d) the specification cannot be effectively implemented (perhaps performance requirements cannot be met, etc.) e) large systems usually require large numbers of people, with liveware problems such as lack of appropriate training, personnel turnover, large number of communication paths, etc. f) all of the above ANSWER: f 8) Maintenance of systems is aided by a) writing programs in C b) adequately documenting programs c) using COTs d) spending at least 50% of your development resources on system implementation e) increasing Cyclomatic complexity ANSWER: b 9) Reusable software components a) cost no more to produce than components that are designed without reuse being considered b) require library classification and maintenance for effective use c) cannot be produced with a generative approach d) cannot be produced with a compositional approach e) require programming with object oriented languages such as C++ ANSWER b: Provide a one line answer to questions 10 - 20 10) Systems are mature when they ... 11) Reverse engineering uses source code for input to derive ... 12) A user manual should contain ... 13) An operator manual should contain ... 14) It is easier to maintain a business software system than a process control system because ... 15) Three measures of system quality are ... 16) Two metrics of system complexity include ... 17) Configuration management ensures that ... 18) CASE tools can be used for ... 19) Equivalence partitioning is ... 20) A large fan-in a desirable for .. ESSAY QUESTIONS 21) Write a small essay (one or two paragraphs) on software testing. Include the goals, types, and limitations of testing. 22) Write a small essay on system maintenance. How and why is maintenance an important issue. Should maintenance needs be integrated into system design? Explain. 23-26A two dimensional array is said to have a saddle point if some point (coordinate) contains the smallest value in its row and the largest value in its column. Find the saddle point of an arbitrary input array of varying size. Assume the dimensions of the array are global constants if your language requires array parameters to have fixed size dimensions. 23) Why is the above specification incomplete? Can you add necessary requirements? 24) Write a header block for a module that performs the above function. 25) Write a test plan for the above module. 26) Create a data flow diagram for the above module. 27) (from Pressman p.606) For the following code segment: i = 1; total = 0; count ;= 0; sum = 0; do while Value [i] <> -999 and total < 100 increment Total by 1; if Value [i] >= Minimum and Value [i] <= Maximum then increment count by 1; sum = sum + value [i]; end if; end do if count > 0 then average = sum / count; else average = -999. end if; a) Compute the cyclomatic complexity two ways. b) Find a basis set of linearly independent paths. c) Prepare test cases that will force execution of each path above. 28) Redo the following code to conform to good SE principles: procedure MAIN; const cr = CHR (13); lf = CHR (10); var iptr, incount, endpt: integer; cr_last: boolean; ch : array [1..100] of char; procedure skipch; var k: integer; begin for k := iptr + 1 to incount do ch[k - 1] := ch[k]; ch[incount] := " "; incount := incount - 1; iptr := iptr - 1; end; {skipch} procedure FORMAT; begin incount := endpt; iptr := 1; cr_last := false; while ( iptr < incount) do begin if ord (ch [iptr]) < ord (" ") then begin if ch [iptr] = cr then if ( cr_last) then skipch else cr_last := true else if ch[iptr] = lf then if cr_last then cr_last := false; else skipch else skipch end else cr_last := false; iptr := iptr + 1; ch[0] := chr (incount); {stores size} endpt := incount; end; {FORMAT} begin INITIALIZE; {assume this consists of variable initialization} FORMAT; end.