Data Bases
Custom Term Papers
Free Term Papers
Free Research Papers
Free Essays
Free Book Reports
Plagiarism?
Links
Top 100 Term Paper Sites
Top 25 Essay Sites
Top 50 Essay Sites
Search 97,000 Papers @ DirectEssays.com
Search 101,000 Papers @ ExampleEssays.com
Search 90,000 Papers @ MegaEssays.com
Free Essays
Term Paper Sites
Chuck III's Free Essays
Free College Essays
TermPaperSites.com
My Term Papers
Get Free Essays
Essay World
Planet Papers
Search Lots of Essays
Back to Subjects
-
Computers
Exam tests
Exam tests The following example questions should help your prepare for this year's 205 exam (exam is 50% of the total assessment for this subject). (Answers should be short. One sentence to make one point. Usually one point worth 0.5 marks). ------------------------------------------------------------------------------- Summarize the phases of the conventional "Waterfall" software engineering lifecycle. (2 marks) Phase 1: The business need, concept study, and feasibility analysis are conducted. Phase 2: The requirements of the new system are determined. And then a specification document is produced. Phase 3: Implementation of the system takes place, with designing stages followed by the implementation of individual models and then the integration and testing of these models. Phase 4: The now implemented system is updated when necessary and maintained, then is retired when a new system is implemented. Briefly explain Boehm's "Spiral Model". What failing of the "Waterfall" model does Boehm attempt to correct in his model? (2 marks) 1 Determine objectives, alternatives constraints 2 Evaluate alternatives, identify & resolve risks 3 Develop and verify a version of the product This model attempts to have a repetitive cycle of steps whereas the waterfall model was all one way. How are "Rapid Application Development" systems used to create programs? (1 mark) · picking standard component classes from a library · (sometimes) writing functions where the component has only a stub · defining system by specifying what objects (instances of component classes are present) · specifying how some act as event sources, then linking them to event handlers How is "Open Source Software" developed? Describe some achievements of this approach. (1 mark) · Open source movement depends on skilled programmers contributing their efforts for free! · Programmers employed in regular jobs, their work on the “open source” code done in their own time on own PCs. · Work done for recognition by peer group. "enumerated" types: Explain where these can be useful. Provide a suggestion for a standardized naming style for such types. (1 mark) Enums can be useful when you would like to pass a secure limited range argument to a function. The enumerated type name should start with a ‘E’ and then a noun starting with a capital letter, the actual types should start with a ‘e’ with the rest of the word capitalised. Explain how data structures are created in the static data segment, the stack, and the heap. How does their allocation relate to their lifetime? (2 marks) Static data structures are allocated memory and their lifetime lasts for the entire execution. Automatic data structures are placed on the stack when a function is called. Their lifetime is as long as the lifetime of the function. Dynamic data is allocated to the heap, when a program specifically asks for this occurrence. Its lifetime is programer controled. What data are placed in the "static data segment"? When and how are they initialized? (1 mark) Static variables are placed in the static data segment. These data are initialised before the program starts, in some special cases may be initalised when a function is called for the first time. What is a "filescope" variable? (1 mark) A filescope variable is a variable which, once declared, any function defined later in the same file can access the variable. Global variables: What are their disadvantages? How should you organize their use if you really must have them? In what way can C++ constructs assist in the management of globals? (2 marks) Their disadvantages are in that any function can access them and therefore change there contents. They should be declared in any implementation file, outside of a function. The use of the c++ keyword extern in the declarations in the header file for the global variables assist in the management of globals. Explain how poor naming practices for variables can lead to "holes" in the scope of a variable. (1 mark) If an int tom, has function scope a hole can be made inside this function by the declaration of char tom inside of a while loop scope. This poor naming convention leads to very difficult debugging and maintenance coding. Explain why a compiler may have to insert "padding" bytes into C/C++ structs. (1 mark) Many CPU architectures have addressing limitations, ie an 8 byte data structure must be located at an address divisible by 8. Therefore some c/c++ structures may need padding inserted by the compiler to allow for this. Explain the role of "unions" and illustrate the code for using the appropriate member of a union. (1 mark) Code using a union is typically a function that takes a union (or a union*), checks in some way to find type its working with, and then calls appropriate processing function. void DoProcessing(Example anExample) ProcessCoord(anExample.fT1.fX, anExample.fT1.fY); ProcessCharKey(anExample.fT2.fN2); Explain why "typedefs" fail to offer much type security. (1 mark) Typedef type and original type are not distinguished by compiler Sketch either the C or C++ code that would allow calling code to first create a data structure referenced by a pointer, and then pass the pointer to a function in such a way that the called function can if necessary substitute a new object for the object originally referenced by the caller's pointer. (2 marks) Explain why the following code is erroneous: // code prompting user for input and reading a string into buff Returns an automatic variable which would fall out of scope when the function is completed. while the following code is correct but would be "deprecated"; // code prompting user for input and reading a string into buff The static char buff would be placed into the static data segment and remain there until the code is finished executing. What are the problems associated with returning a pointer to a data structure? You must be certain that the data object referenced has a longer lifetime than the function that returned it. Otherwise you may get segmentation faults. What are the problems associated with returning a data structure by value? (1 mark) The copy of large structures and classes has an overhead of extra stack space and cost of copying may cause problems. Why has POSIX (the Unix standards group) found it appropriate to rework existing function libraries to provide alternatives for functions that return the address of a static data structure? Using the example of a function that used to return a pointer to a static character array, explain the preferred POSIX alternative mechanism. (1 mark) Explain when you might use a "wrapper" class. (1 mark) If you are working with system resources, you are advised to package (wrap) them inside classes. Explain the categorisation: "simple class", "static class", "manager class", "collection class", "interface" (or "protocol") class. (2 marks) · An instance of a simple class is a fixed size data structure whose size can be determined at compile time. · There is no dependency on any other application or system data object. · Only static data members and static member functions · Static data members are typically initialized · A constructor that sets those pointers to NULL (or to point to any of the auxiliary structures that can be created immediately) · A destructor that releases all separately allocated structures. Collection class is used to hold a collection of instances of some programmer defined class or struct. With interface classes the Idea is that actual classes implement an interface from which they are derived. What are the advantages and costs associated with hiding all implementation details of a class? Describe how such hiding can be achieved. (2 marks) · changes to MyClass, HisClass, HerClass have less impact on client YourClass must be recompiled, but not client classes · if details are proprietary, then you need only release compiled modules · more impact on memory manager extra indirections · The header file declaring class YourClass does not reveal any of the detail, no #includes on other header files. · The other classes are included in the implementation file of YourClass. How can a programmer define a class so that the copy constructor and operator=( ) functions are disabled? Why is it often appropriate for a class to disable these functions? When can you rely on the compiler to automatically generate these functions? When would you have to provide your own versions? The copy constructor and operator= are declared as private member functions and never implemented. Disabling them eliminates chances of some very messy errors. You can rely on the compiler when ... You would have to provide your own versions when ... define the Point::Point(int x, int y) constructor in such a way as to enable const instances of this class to be declared. (1 mark) For a class Point with data members fX, fY: i) provide a partial declaration of the class showing a member operator+() function that performs a vector addition. (1 mark) Point operator+(const Point& other) const; ii) Provide a partial declaration of the class showing a friend operator+() function that performs a vector addition. (1 mark) friend Point operator+(const Point& one, const Point& two); iii) Explain how these functions could be used in code that works with Point objects, illustrating the differences in behavior of the two (1 mark) With the first example with a member function the class will allow an integer to be added to a pointer because of the implicit conversion from integer to Point using the single argument constructor, but will not allow a Point to be added to an integer. The second method allows for the integer to be passed to the + function in either order because it is on the global operator table. Discuss the following function. What is it (member function, friend function, global function) and how does it work? istream& operator**(istream& in, AnyClass& obj) These are global functions that should invoke public “PrintOn( )” and “ReadFrom()” members of the class. Why is this the "preferred" approach for providing streamability for classes? (1 mark) Calls to these functions look like requests to member operator functions of istream or ostream: But we haven’t added new members to those classes! Constructors that take a single argument that is the value of a built in type (like int) should be regarded as potential problems. Why? (1 mark) These allow compiler to perform automatic conversions. Collection classes can be defined: i) using C++ template constructs, ii) using opaque data (void*), or iii) requiring all entries in a collection to be instances of classes derived from some base class "Object". What are the advantages and disadvantages of each of these approaches? (3 marks) Robust, can handle most structure types Can hold two different types, can get confusing Destructors. When are they needed? Why should the base class in a class hierarchy always define a virtual destructor? (1 mark) · System resources must be freed; if this won’t be automatic then a destructor must do the work. · In the case where a subclass may use dynamic memory the class must have a virtual destructor to implement. Explain the role of "virtual" functions in a C++ class hierarchy. (1 mark) Virtual functions provide a prototype for the later implementation of a member function of a class. Explain the three access control specifiers private, protected, and public as they apply to a class in a C++ class hierarchy. (1 mark) · public functions of base class are private to derived class · public and protected members of base class are protected in derived class · all public functions of base class are automatically in the public interface of derived class For class Alpha, the base class of some hierarchy, with partial definition: int GetId() const { return this-*fId } virtual double PropertyX() const = 0; explain the differences among the three example member functions with regard to redefinition in subclasses. (1 mark) GetId() - no provision for redefinition in subclasses. Area() - Define a default implementation of the which can be overridden or extended by authors of subclasses. PropertyX() - Specify the existence of the function, providing no definition and requiring that the authors of subclasses provide definitions. Explain how a class's virtual table is used for dynamic dispatch when invoking a member function of an object referenced by a polymorphic pointer. (1 mark) · The compiler adds an extra data member to classes that use virtual functions. · This extra (hidden) data member holds the address of the class’s virtual function table. · When an instance of a class is created, this data member is automatically set. What is "run time type information" (RTTI) and when might you need this information? (1 mark) · Compiler fills in an instance of a type_info class with information describing class, this is typically associated with virtual table for class · typeid operator can get at type_info object · For dynamic cast to work, it must be able to find out class of object. Explain C++'s static_cast, const_cast, dynamic_cast. (1 mark) · type will be a pointer, expression a const pointer · this is just an explicit way of saying (“I was given a const pointer, but I want to cheat”) · type generally pointer to derived type, expression pointer to base type · involves run time check on types for compatibility Why is it inappropriate to invoke virtual member functions in the constructor of a base class? (1 mark) · The wrong versions of the virtual functions would have been called. · If you have to call virtual functions, it should be done as the last operation of the constructor of the most derived class. Explain the form and role of "conditional compilation macros". (1 mark) Explain the form for "header" and "implementation" files for a module that is to represent an "abstract data type" without using C++ classes (use a simple standard abstract type as an example). (1 mark) How might such a module could be extended to be a "type manager" allowing multiple instances of the abstract data type to be created (again without using C++ classes). (1 mark) "Guards constructed using #ifndef, #define, and #endif preprocessor directives are used both to avoid compilation errors that can result from multiple inclusion of a header file, and to reduce compilation costs by avoiding unnecessary re-readings of a header file". When including a header file it may inevitably be included more than once, compilation errors such as multiple defines can occur, also the cost in time of compilation increases due to the compiler having to re-read the header file. The pre-processor directives above prevent this from happening by using an if statement to assure that the header file is read only once. Explain the roles of "verification" testing and "validation" testing of a software product. (1 mark) Testing to find all the “little” problems where the system doesn’t live up to the specification. Testing to see if the intended users are satisfied. Explain how "code walkthroughs" are conducted and how they help in the development process. (1 mark) A code walk through is conducted by, taking someone step-by-step through your code explaining what it achieves. This helps in the development process by aiding the coders efforts in finding faults within the code. Explain how a "code coverage" tool assists in testing code. (1 mark) The “code coverage” tool allows you to check that you have exercised each branch in program. This is very useful in the testing stage to make sure that a test file executes every section of the code. Explain the following "software architectures": pipeline, repository system, client-server, and layered system. (2 marks) · Intermediate output from “program 1” becomes input to “program 2”, hence via other intermediary programs until get final output. · can be via temporary disk files (program-1 writes to “temp/000123.dat”, program-2 reads from this file, …) · or Unix “pipe” (an in-memory buffer that avoids transfers to and from disk) · An elaborate optimising compiler could employ some form of repository structure · store more information characterising elements of program · this information accessed and updated by optimising components that need more global knowledge of the program being built · The first client is running program one and it communicates to with the server program · The Server program then sends the information to the second client( a copy of program one) · communications involve an “applications protocol” (a set of requests / commands that client can send to server, and a set of standard forms of reply) · term most typically used to describe a way of organizing library support routine. · each layer relies on services provided by the layer below. What are the advantages and disadvantages of compilation to "byte codes" and use of a byte code interpreter as compared to full compilation to machine code. (2 marks) · “Byte code” interpreters mimic the normal edit, compile, execute cycle – but the compile (and link) steps are typically simplified and relatively fast. · The interpreter is now a simulator for an idealized computer. · The compiler produces code for this simple idealized computer. · Simulated machine relatively simple, so can write moderately efficient simulator for any given computer. · Write one compiler, language now on every computer with simulator. What is the role of the "linker" in the normal compile-link approach to producing executable programs? (1 mark) · Linker has task of threading such files together. · copy code to end of “executable” file being built · work out relative addresses of all “entry” points ¨ check whether any previous file has externs matched by these entrys · if so, go back and fill in addresses where specified · see if can resolve against any already known entrys What is meant by a) "static linking", b) "shared libraries", c) "dynamic linking", and d) "incremental linking"? (2 marks) · The program gets a copy of each of the library functions that it uses. · This code is added to the executable file and, naturally gets loaded into memory with the rest of the program. · Shared libraries are set up so that a program using their functions doesn’t make its own copy, it just keeps a reference. · When a program gets loaded, any references to functions from shared libraries are resolved – if a required function is already in memory, it is mapped into the processes address space; if a function isn’t in memory, it is loaded. · A process already in memory can add on new pieces of code as it runs. · So you can have applications where · there is a document object that owns “displayable items” · you can add new kinds of displayable items provided you can supply the code needed to get them to report their size and draw themselves. · this code is linked in at run time. · Many development environments now provide an incremental linker – this may be able to relink simply the file that has changed. · leave some space after each function · keep some of the linkage information defining entries etc · If the extent of change to functions in file is small, incremental linker may be able to replace old by new. Explain what is meant by a variable or function having a name with a) "static linkage", b) "external linkage (1 mark) · If you want a function (or variable) to be available only to other functions in the same module, you make its name have “static” linkage. · If you want names to be available to other modules, you give them external linkage. What is the structure of a typical "object" file as produced by a compiler? What is the structure of a file representing an "executable program (1 mark) · Entry list (list of functions in this file) · Typically the executable is built by “gluing” the object files together in the order specified in the makefile. If the programmer wishes to use a source level debugger, the compiler must provide additional data. What data? Where do these extra data go in the object and executable files? (1 mark) To use the debugger, the compiler’s symbol table be saved. This allows debugger to work out relations between final memory locations and variables defined in source code. The symbol table is stored in intermediate files, “object” files and final executable. What data are held in "kernel space" for a process? (1 mark) Explain the nature of the hardware memory hierarchy and how this can impact on program execution. (1 mark) •Modern computer will have hierarchy of memories of different speeds: –cache maybe 1 Megabyte (not all dedicated to –main memory 256 Megabyte (shared by many –virtual store 1Gigabyte•Relative access times: –3 seconds, 20 seconds, 11 days•Different pages of your program (say 4k bytes for page size) may at any one time be in different levels. Explain the "client-server" relations embodied in the X- graphics system. (1 mark) •(Application programs are “clients”, X-interpreter program running on Xterminal is display “server”) –X- makes relatively simple use of TCP/IP, most of X- communications are “datagrams” (fixed size blocks of bytes that correspond directly with data structures used in Xterminal and host programs). What is X's "window manager" and what is its role? (1 mark) •“WindowManager” part of software –determines things like frames for windows, background, some rules for aspects like resizing, “keyboard focus”, ... –different window managers can be selected, •“WindowManager” usually is itself a client application running on the host. •X-windows system provides mechanisms for communication amongst programs using the same Xterminal. •WindowManager uses these communication facilities to control some aspects of other X- programs running on same terminal. How does an Xterminal communicate with a X-based graphics application. (1 mark) •Communication between Xterminal and host computer uses TCP/IP: –TCP/IP protocol for reliable connection oriented stream links between programs –used for most Internet traffic Explain the roles in the X graphics programming system of i) X-lib, ii) the Xt- intrinsics, and iii) the widget collections (such as Motif). (1 mark) Explain the "fork" and "exec" Unix system calls and how these are used to create processes. (1 mark) •It is a cloning operation ––– it duplicates the memory representation of the original process (a small part of the OS system data relating to open files etc is shared rather than duplicated) What (in the context of Unix processes) is a "pipe"? How can a pipe be created for communications between processes? Why is "re-plumbing" of the file descriptor table often necessary in the context of pipes? What are the limitations of pipes for process intercommunication? (2 marks) What is the role of "environment variables" in Unix? How can a program determine the values of environment variables? (1 mark) Explain the role and working of the "make" utility, cover issues such as targets, dependencies, rules, macros. (2 marks) Explain briefly how a source code control tool (such as SCCS or RCS) utilizes "archive" files. What data are held in such files? What services does the source control tool offer to a development group? (2 marks) Explain a "delta" (in the context of a source code control system). How and why might a development group end up with a revision tree with multiple branches? What are "3 way merges" and where does the need for these arise?(2 marks) –you employ revision 1.2 in a released product –you have created revision 1.3 as part of work toward next release–you get bug reports on release 1.2 –you need to create patched versions so that you can maintain that release, these are separate from work toward new release –a set of differences between revisions is called a delta –a delta is represented as a set editing commands needed to convert from one revision to the next) •Have common “ancestor” file (revision 1.2) •Have two “descendant” files with different changes. •Want a new “descendant” file with combined changes. "A class is a module". Comment on the appropriateness of this proposition. (1 mark) •Header file – simply a class declaration –definitions of member functions –definitions of any static data for class –too many separate modules–do you really want: •class List in List.h, List.cc •class ListLink in ListLink.h, ListLink.cc •class ListIterator in ListIterator.h, ListIterator.cc•Classes typically form small groups –get “reused” not completely individually, but as groups Better to say a module is a component A component will most often comprise a group of classes along with any associated free functions •A module is a separately compilable part of a C/C++ program. –two files:"header" file and the "implementation" file. •defines the services that the module provides. •the code that is used to supply those services. Explain and illustrate how functions defined in each class in a group of partially abstract classes can specify a standard pattern of interaction among instances of these classes. (2 marks) Explain the role of the "Wizard" (or "Expert" or "Architect") component as typically incorporated in a development environment for the creation of applications based on a framework class library. (1 mark) Explain the "counted pointer idiom" (low level C++ design pattern). (2 marks) •The overall context is the management of heap memory for dynamically allocated structures •Remember that unlike Java, C++ doesn’t have automated garbage collection; it is the programmer’s responsibility to delete dynamic structures when they are no longer required.•Once an object has been created in the heap via the new operator, its address can be passed around as a pointer value. •Copying of pointer values can lead to many different pointers referencing the same dynamic structure. Such structures result in “sharing” of the referenced object by the objects (or currently executing functions) that have pointers referencing the object. •In most cases, this “sharing” is an artefact. •In a few cases (such as those considered by Meyers) you may actually desire “sharing”. •The solution uses objects from two classes –The original instance of the class that got allocated in the heap and which ended up getting “shared” •Keeps track of the references to the “shared” object –Organizes deletion of shared object when the last pointer referencing it is removed –Prevents deletion until the last reference is removed •Forwards all requests for actions to the shared object •When one of these pointers is destroyed (the object of which it is a part is deleted, or the function in which it is a local variable is exited) the issue arises Should the referenced structure be deleted?•If a (formerly shared) structure is not deleted from the heap when the last pointer referencing it is destroyed, you have a memory leak. •If a shared structure is deleted when there are other valid pointers still holding its address, these pointers become dangling references - problems will occur immediately on use of any of these pointers to attempt to access the deleted structure. Explain the "Observer Design Pattern". (2 marks) •Define a one-to many dependency among objects so that when one object changes state, all its dependents are notified and updated automatically. –Common in interactive programs to have some “data structure” object with aspects displayed in several different views (selection of views defined by user); when data object changed, would like dependent views updated to reflect new state; as views vary, don’t want to hard-wire relations between data object and dependent views Each “design pattern” systematically names, explains, and evaluates an important recurring design in object-oriented systems. Our goal is to capture design experience in a form that people can use effectively.Gamma et al How are "use cases" employed in the development of the design of a program using classes. (1 mark) •“Use case” analysis focuses on how “actors” (ie humans for the most part) use your overall system to accomplish tasks. •What object picked up student request? •What object created to represent that request? •Where (to which object) was that object sent? How is "scenario analysis" used in the process of refining a design. (1 mark) •Run through scenarios of how program might work, listening to expert’s explanation Sketch an "object interaction diagram" that illustrates how, in your graphics display version of your solution to assignment one, your program handled a user's request to add an item to its queue. (2 marks) Sketch a process level "Data flow diagram" that illustrates the form of your group's solution to assignment 3. (1 mark) Explain what is meant in each case when a module is said to have "Temporal Cohesion", "Incidental Cohesion". (1 mark) –“temporal cohesion” •functions invoked at a similar stage (time) in the processing The functions in the module don’t “belong” together. Explain what is meant by "coupling" between modules; describe "control coupling", "common coupling", and "data coupling". (2 marks) •Parameter passed (as argument in function call) to control behaviour of other module •Functions in the different modules go rummaging around in the same global data structures What does the McCabe Cyclomatic Index attempt to measure? How should this metric be used? (1 mark) – a crude measure of “cognitive complexity” and error proneness of code •The cyclomatic complexity index basically measures the number of different conditional tests in a program. •Used to find functions that tend to be error prone if their cyclomatic index value is large; such functions should be split into smaller simpler functions. Explain how the COCOMO model provides a means of estimating the cost (in person-years of work) of a project given an estimate of its size in KDSI. Note four of the modifiers used in the COCOMO estimation process. (2 marks) Explain how "Function Point" analysis may be used to generate an initial estimate of the size of a project in KDSI. Note four of the factors considered as important when estimating the "Technical Complexity Factor" modifier for an unadjusted function point score for a project. How do you estimate KDSI from an adjusted function point score? (3 marks) 4 Factors considered important when estimating TecHnical complexity factor •FP values often converted into estimated “KDSI”.•Rough conversion values get quoted, –one function point is 50 lines (0.05 KDSI) for a high level language, –one function point is 300 lines (0.3KDSI) if programming in assembler Briefly summarize the Software Engineering Institute's Capability Maturity Model (CMM) for software developers. Identify some of the features characteristic of each of the five maturity levels. (2 marks) Bibliography:
Word Count: 5416
Copyright © 1998-2008
College Term Papers
, INC All Rights Reserved.
DMCA Notifications and Requests