The states shown in a state transition diagram do not necessarily correspond to the processes shown in a control flow diagram for the same system.
ATrue
BFalse
States describe behaviour modes and need not map one-to-one to processes in a flow diagram.
2.
★ Final term Spring 2010Lecture 20
In sequence Diagrams objects are organized in a ----------line
Ahorizontal
Bvertical
Chorizontal and vertical
Dnon of the above
In a sequence diagram the objects are laid out along a horizontal line and time runs vertically.
3.
★ Final term Spring 2010Lecture 23
Every view is potentially Hierarchical in this regard which of the view are Hierarchical ?
AFunctional View
BDevelopment View
CConcurrency view
DAll of given
Every architectural view can be decomposed hierarchically, so all of them are hierarchical.
4.
★ Final term Spring 2010Lecture 23
the development view describes the -----------organization of the software in its development environment,
AStatic
BDynamic
CStill
DStatic & Dynamic
The development view shows the static organization of software modules in the development environment.
5.
★ Final term Spring 2010Lecture 24
Like analysis models, many different kinds of -----------models are developed
AArchitectural
BSystem
CDesign
DLogical
Many different kinds of architectural models are developed, just as with analysis models.
6.
★ Final term Spring 2010Lecture 24
In the N-Tier Architecture the idea is to enhance scalability and -------------- by distributing both the data and the application using multiple server machines.
APerformance
BEfficiency
CUsability
Dnone of the all
Spreading data and application logic over several servers improves scalability and performance.
7.
★ Final term Spring 2010Lecture 25
idea behind zero install architecture is to develop a system where no installation on the ---------- is needed.
AClient side
BServer Side
CClient & Server Side
DNon of the all
Zero install architecture removes the need to install anything on the client machine.
8.
★ Final term Spring 2010Lecture 27
-------------- being the first pure Object Oriented language in which observer pattern was used in implementing its Model View Controller
ASmalltalk
BPASCAL
CJAVA
DC++
Smalltalk first used the observer pattern to implement MVC.
9.
★ Final term Spring 2010Lecture 29
Source files can have the extension ---------------------
Ac++ .
B.C
C.cpp
Dall of the given
C++ source files may use .c++, .C or .cpp extensions.
10.
★ Final term Spring 2010Lecture 29
Classes should be declared in individual header files with the file name matching the ---------- name.
Aclass
Bmethod
Cobject
Dnon of the all
Each class goes in its own header file named after the class.
11.
★ Final term Spring 2010Lecture 30
All comments should be written in-----------
AEnglish
BFrench
CC++
DJAVA
The guideline is that all comments are written in English.
12.
★ Final term past paperLecture 32
Modularity is a tool that can help us in increasing the size of individual functions, making them less readable .
ATrue
BFalse
Modularity reduces the size of individual functions and makes them more readable.
13.
★ Final term Spring 2010Lecture 33
One of the Guidelines to avoid common mistakes is to never use --------- except for declaration
A,
B;
C=
D||
The comma operator should not be used except in declarations because it hides side effects.
14.
★ Final term Fall 2008Lecture 34
One of the causes of the portability issues is the order of ----------- varies from one implementation to other.
AEvaluation
Bnumbers
Cvariables
Dsymbols
The order of evaluation of operands differs between implementations.
15.
★ Final term Spring 2010Lecture 35
A number of invisible execution paths can exist in simple code in a language that allows --------------
Aexceptions
Bdefects
Cerrors
Dall of them
Exceptions create hidden execution paths in otherwise simple code.
16.
★ Final term Fall 2008Lecture 35
------------- is a powerful technique that separates error-handling code from normal code.
AException handling
BCode handling
Cvariable handling
Dpointer handling
Exception handling separates error-handling code from the normal code.
17.
★ Final term Spring 2010Lecture 36
Verification and validation are the processes in which we check a product against its --------- and the --------------- of the users who will be using it
Aspecifications, expectations
Bstatements, expectations
Cspecifications , arguments
Dstatements, arguments
Verification checks the product against its specification and validation against user expectations.
18.
★ Final term Spring 2010Lecture 36
In software quality assurance work there is no difference between software verification and software validation
ATrue
BFalse
Verification checks against the specification, validation against user expectations, so they differ.
19.
★ Final term Spring 2010Lecture 38
Two tests are considered to be equivalent if it is believed that: if one discovers a defect, the other probably will too, and if one does not discover a defect, ---------------------------------.
Athe other probably may
Bnon of them
Cthe other probably won’t either
Dthe other probably will
Equivalent tests behave alike: if one misses a defect the other probably misses it too.
20.
★ Final term Fall 2006Lecture 39
The testing technique that requires devising test cases to exercise the internal logic of a software module is called
Abehavioral testing
Bblack-box testing
Cgrey-box testing
Dwhite-box testing
Tests designed from a module's internal logic are white-box tests.
21.
★ Final term Spring 2010Lecture 40
Unit testing is roughly equivalent to ---------- testing for hardware in which each chip is tested thoroughly after manufacturing
ACircuit level
BChip Level
Ccomponent level
Dsystem level
Unit testing is compared to chip-level testing of hardware.
22.
★ Final term Spring 2010Lecture 40
Software should be tested more like hardware, with Built-in self testing: such that each unit can be tested -------------
Afreely
Bindependently
Cdependtly
Dcompletely
Built-in self testing lets each unit be tested independently.
23.
★ Final term Spring 2010Lecture 42
First hand accounts of the problem are always useful in Debugging process.
ATrue
BFalse
Accounts from people who saw the failure give the debugger direct evidence of the symptoms.
24.
★ Final term Spring 2010Lecture 42
In the debugging process a stack trace is a very useful tool.
ATrue
BFalse
A stack trace shows the sequence of calls that led to the failure, which helps locate the bug.
25.
★ Final term Spring 2010Lecture 43
Which one of the given below is not a symptom of memory overrun?
AProgram crashes quite regularly after a given routine is called, that routine should be examined for a possible overrun condition.
BIf the routine in question does not appear to have any such problem the most likely cause is that another routine, called in the prior sequence, has already trashed variables or memory blocks.
CChecking the trace log of the called routines leading up to one with the problem will often show up the error.
DCompiler warnings.
Memory overruns show up at run time; compiler warnings are not one of the listed symptoms.
26.
★ Final term Fall 2008Lecture 44
Holistic medicine, concerns itself with the state of the body as a whole, not the ----------- that is currently attacking it.
Areason
Bdisease
Csource
Dnon of the given
Holistic medicine treats the whole body rather than only the disease attacking it.
27.
★ Final term Spring 2010
The first step in any OOA process model is to____________________
Abuild an object-relationship model
Bdefine collaborations between objects
Celicit customer requirements
Dselect a representation language
Object-oriented analysis starts by gathering the customer requirements before any modelling is done.
28.
★ Final term Spring 2010
A necessary supplement to transform or transaction mapping needed to create a complete architectural design is __________________________.
Aentity relationship diagrams
Bthe data dictionary
Cprocessing narratives for each module
Dtest cases for each module
The program structure from mapping must be supplemented by a processing narrative for each module.
29.
★ Final term Spring 2010
What types of errors are missed by black-box testing and can be uncovered by white-box testing?
Abehavioral errors
Bsubtle logic errors
Cperformance errors
Dinput error
White-box testing exercises internal paths, so it finds logic errors that are invisible from the interface.
30.
★ Final term Spring 2010
Which test criteria should be applied in a phase of testing?
Afunctional validity
Binterface integrity
Ccorrectness
Dall of the given
Each testing phase checks functional validity, interface integrity and correctness.
31.
★ Final term Spring 2010
The order in which bytes of one word are stored is ----------- dependent
AHardware
BSoftware
Clanguage
Dsystem
Byte order (endianness) is decided by the hardware architecture.
32.
★ Final term Spring 2010
It was lady named ----------------- who actually coin the term “bug" for the first time.
AElisay Chistopher
BAdmiral Grace Hopper
CAna Nicholson
DJane Hopper
Grace Hopper popularised the term bug after a moth was found in the Mark II.
33.
★ Final term Spring 2010
The first “bug” was actually a moth, which flew through an open window and into one of the Mark --------- 's relays.
AII
BI
CIII
DIV
The moth was found in a relay of the Harvard Mark II computer.
34.
★ Final term Spring 2010
Software architecture elements are further divided into categories which in total are -----------
A2
B3
C4
D5
Architectural elements are data, processing and connecting elements: three categories.
35.
★ Final term Spring 2010
Be very careful when you use functions with side effects – functions that change the values of the -------------
Aparameters
Bvariables
Cconstants
DNone of given
A function with side effects is one that changes the values of its parameters.
36.
★ Final term Spring 2010
Which of the following is not a characteristic of software?
ASoftware is tangible
BA change to a piece of code may implicitly affect the functions of the rest of the code.
CSoftware is configurable.
DSoftware does not wear and tear.
Software is intangible, so being tangible is not one of its characteristics.
37.
★ Final term Spring 2010
The two main documents produced during this phase are Requirement Statement and Requirement Specification. They are also called Requirement Definition and ----------
AFunctional Specification
BMathematical specification
CSystem Specification
DNone of the given
Requirement Statement and Specification are also called Requirement Definition and Functional Specification.
38.
★ Final term Spring 2010
A decision table should be used
ATo document all conditional statements
BTo guide the development of the project management plan
COnly when building an expert system
Dwhen a complex set of conditions and actions appears in a component
Decision tables are meant for components with a complex combination of conditions and actions.
39.
★ Final term Spring 2010
Which of the following is a/are tool used in requirement analysis?
AFlow Graphs
BData Flow Diagrams
CActivity Networks
DModule Dependency Diagrams
Data flow diagrams model how data moves through the system during requirement analysis.
40.
★ Final term Spring 2010
MVC stands for ---------------
AModel View Controller
BModern View Center
CModel View Center
DModern View Controller
MVC is the Model View Controller pattern.
41.
★ Final term Spring 2010
A --------------- is a code that explains itself without the need of comments and extraneous documentation
ASelf documenting code
BSelf telling Code
CSelf Documenting Design
DNon of the above
Code that explains itself without comments is called self-documenting code.
42.
★ Final term Spring 2010
Bugs that won't "stand still" (almost random) are the --------- to deal with.
Aleast difficult
Bmost difficult
Cvery easy
Deasy
Bugs that cannot be reproduced reliably are the hardest to find and fix.
43.
★ Final term Spring 2010
In refining the DFD during transaction mapping it is unnecessary to create a PSPEC since only the CSPEC is relevant to this type of architectural style.
ATrue
BFalse
Process specifications are still needed when refining a DFD for transaction mapping.
44.
★ Final term Spring 2010
Association is a type of relation
AWeak
BStronger
CNormal
DNone of above
Association is a weak relationship compared with aggregation and composition.
45.
★ Final term Spring 2010
Variable names must be in mixed case starting with upper case.
ATrue
BFalse
Variable names use mixed case starting with lower case; upper case starts type names.
46.
★ Final term Spring 2010
CRUD include following:-
ACreate
BUpdate
CRead
DAll of above
CRUD stands for Create, Read, Update and Delete.
47.
★ Final term Spring 2010
Bugs Finding is done by which of the teams in Software Development lifecycle?
ADevelopment Team
BTesting Team
CAnalysis & Design Team
DProcess Team
The testing team finds bugs; the development team fixes them.
48.
★ Final term Spring 2010
Software Bugs have multiple names, which one of the below is not the name of Software Bugs --------------
ABugs
BDefects
CErrors
DMistakes
Bugs are also called defects, errors or faults; "mistakes" is not one of the listed names.
49.
★ Final term Spring 2010
Project --------------- defines the concept and range of the proposed solution, and limitations identify certain capabilities that the product will not include
AScope
BAgreement
CPlan
DNone of the given
Project scope defines the concept and range of the solution, while limitations say what is excluded.
50.
★ Final term Spring 2010
In the N-Tire Architecture the idea is to enhance scalability and --------------- by distributing both the data and the application using multiple server machines.
APerformance
BEfficiency
CUsability
Dnon of the all
N-tier architecture distributes data and application over servers to improve scalability and performance.
51.
★ Final term Spring 2010
The cyclomatic complexity metric provides the designer with information regarding the number of
ACycles in the program
BErrors in the program
CIndependent logic paths in the program
DStatements in the program
Cyclomatic complexity counts the independent paths through the program's flow graph.
52.
★ Final term Spring 2010
Which of the followings is not a testing type?
ASubsystem testing
BAlpha testing
CBeta Testing
DGamma Testing
Subsystem, alpha and beta testing exist; there is no gamma testing type.
53.
★ Final term Spring 2010
Which piece of code is self-documented?
Aif (x == 0) // this is the case when we are allocating a new number
Bif (AllocFlag == 0)
CIf (AllocFlag == NEW_NUMBER)
DNone of the given
Meaningful variable and constant names make the condition clear without a comment.
54.
★ Final term past paper
If(!(block < activeBlock)) is equvivalent to .
AIf ((block < activeBlock))
BIf ((block == activeBlock))
CIf ((block >= activeBlock))
DNone of the given
Not (block < activeBlock) is the same as block >= activeBlock.
55.
★ Final term past paper
Bit fields allow the packing of data in a structure. Using Bit fields we can .
ARead 9 bit integers
BAvoid memory leakages
CAvoid memory overflow
DAvoid syntax errors
Bit fields let a program read non-standard formats such as 9-bit integers.
56.
★ Final term past paper
Complex expressions .
AMake the code easy to modify
BMake the code difficult to modify
CMake the code easy to understand
DDoes not effect understandability
Complex expressions are hard to read and therefore hard to modify safely.
57.
★ Final term past paper
x = 0; // x is floating pt Which rewritten form of above line of code is more in line with the self-documentation philosophy than the code above .
Ax = false
Bx = NULL
Cx = 0.0;
Dx = '\0'
Writing 0.0 shows directly that x is a floating-point variable.
58.
★ Final term past paper
using proper paranthesis normally makes the code .
Aeasy to read
Beasy to understand
Cless ambiguous
DAll of the given options
Parentheses make expressions easier to read and understand and remove ambiguity.
59.
★ Final term past paper
The use of comments should be minimized by making the code self-documenting by appropriate name choices and an explicit logical structure .
ATrue
BFalse
Good names and clear structure reduce the need for comments.
60.
★ Final term past paper
80/20 rule states that:
Ayou spend 80 percent of your time in 20 percent of the code
Byou spend 20 percent of your time in 80 percent of the code
CWe should try to optimized 80 percent or at least 20 percent of the code
DNone of the given options.
Most execution time is spent in a small part of the code, so optimise that part.
61.
★ Final term past paper
Be very careful when you use functions with side effects – functions that change the values of the ________ .
AObjects
BClasses
CStructures
DVariables
Side-effect functions change the values of variables (their parameters) as well as returning a result.
62.
★ Final term past paper
The C/C++ language has not specified whether ____ is arithmetic or logical .
ARight shift >>
BRight shift
C&&
D||
Whether >> on signed values fills with the sign bit (arithmetic) or zero (logical) is implementation defined.
63.
★ Final term past paper
When a small set of functions (which use each other) is so overwhelmingly the bottleneck, there are two alternatives:
Ause a better algorithm OR re-write the code
Bdebug the code OR place assertions in code
Cremove the functions OR add more functions
Dchanged programming language OR compiler at least
For a dominating bottleneck, either choose a better algorithm or rewrite that code.
64.
★ Final term past paper
Some bit field members are stored: I) left to right II) right to left III) in circular array .
Aonly (I) is true
BOnly (II) is true
CBoth (I) and (II) are true
DAll of the options (I, II and III) are true
Depending on the implementation, bit fields are stored left to right or right to left.
65.
★ Final term past paper
A test case involves
AInput/output specification plus a statement of the function under test
BSteps to perform the function
CExpected results that the software application produces
DAll of the given options
A test case states the inputs/outputs and function, the steps and the expected results.
66.
★ Final term past paper
A __________ is a variance from a desired product attribute .
AException
BError
CMistake
DDefect
A defect is defined as a variance from a desired product attribute.
67.
★ Final term past paper
The C/C++ language does not define the alignment of items within .
AStructures
Bclasses
Cunions
DAll of the given options
Alignment inside structures, classes and unions is left to the implementation.
68.
★ Final term past paper
Consider the following statement: int a,b=10; Which of the following is correct:
Avariable "a" is initialized to 10
BVariable "b" is initialized to 10
CBoth variables "a" and "b" are initialized to 10
Dvariables can not be initialized this way
Only b gets the initializer; a is declared without a value.
69.
★ Final term Spring 2010
Quantitative methods for assessing the quality of proposed architectural designs are readily available.
ATrue
BFalse
Quantitative methods for assessing architectural design quality are not yet readily available.
70.
★ Final term Spring 2010
Test cases should be designed long before testing begins.
ATrue
BFalse
Tests should be planned and designed long before testing begins, from the requirements.
71.
★ Final term Spring 2010
Which of the following are characteristics of testable software?
Aobservability
Bsimplicity
Cstability
Dall of the given
Observability, simplicity and stability all make software easier to test.
72.
★ Final term Spring 2010
Comparison testing is typically done to test two competing products as part of customer market analysis prior to product release.
ATrue
BFalse
Comparison (back-to-back) testing runs independent versions of the same software, not competing products.
73.
★ Final term Spring 2010
By collecting software metrics and making use of existing software reliability models it is possible to develop meaningful guidelines for determining when software testing is done.
ATrue
BFalse
Metrics and reliability models give a statistical basis for deciding when testing is complete.
74.
★ Final term Spring 2010
Configuration reviews are not needed if regression testing has been rigorously applied during software integration.
ATrue
BFalse
Configuration reviews check that all configuration items are complete; regression testing does not replace them.
75.
★ Final term Spring 2010
Requirement engineering mainly deals with the -------------- of the system
Adefinition phase
Bdevelopment phase
Cmaintenance
Dnon of the above
Requirement engineering belongs to the definition phase of the system.
76.
★ Final term Spring 2010
40-60% of all defects found in software projects can be traced back to poor -----------
ARequirements
BDesign
CCoding
DTesting
Studies show 40-60% of defects come from poor requirements.
77.
★ Final term Spring 2010
A system ------------- is the period in which tremendous pressure is on developers end to fix the problem and make the system running again
AUptime
BDowntime
CCurrentime
Dfuturetimr
During downtime the system is not working, so developers are under pressure to fix it.
78.
★ Final term Spring 2010
Three tier architecture contains ------------- layers
APresentation
BApplication
CDatabase
DAll of the above
Three-tier architecture has presentation, application and database tiers.
79.
★ Final term Spring 2010
1. Variables should be initialized where they are declared and they should be declared in the -------------- scope possible.
ASmallest
Blargest
Cmedium
DNone of the given
Variables should be declared in the smallest possible scope.
80.
★ Final term Spring 2010
------------------ are two important tools that can help in managing and mastering the complexity of a program.
Aabstraction and encapsulation
Babstraction and Inheritence
Cabstraction and Polymorphism
DNone of given
Abstraction and encapsulation help manage the complexity of a program.
81.
★ Final term Spring 2010
Consider the following comment. “The software which I bought won’t run on windows and when it runs I can’t use WORD at the same time”. Which of the following do you think are violated by the newly bought software?
Adependability, interchangeability
Bplatform independence, interoperability
Creliability, dependency
Dinteroperability, reliability
Not running on Windows violates platform independence; not working alongside Word violates interoperability.
82.
★ Final term Spring 2010
……………… is a diagramming technique used to identify the types of objects in the system and the static relationships that exist among them?
AClass Diagram
BDocument flow diagrams
CData flow diagrams
DFlow charts
A class diagram shows object types and the static relationships among them.
83.
★ Final term Spring 2010
Which of the following testing involve purely black box testing?
Aunit testing, beta testing
Bacceptance testing, interface testing
Cbeta testing, acceptance testing
Dintegration testing, interface testing
Beta and acceptance testing are done by users who see only the external behaviour.
84.
★ Final term Spring 2010
In the context of requirements analysis, partitioning results in the elaboration of data, function, or behavior.
ATrue
BFalse
Partitioning a problem decomposes and elaborates its data, function or behaviour.
85.
★ Final term Spring 2010
Class variables should be declared public. This concept violates which of the following.
AInformation hiding
BEncapsulation
CInformation hiding and Encapsulation
DNone of given
Public class variables break both information hiding and encapsulation.
86.
★ Final term Spring 2010
Real-time applications add a new and potentially difficult element to the testing mix
Aperformance
Breliability
Csecurity
Dtime
Real-time systems add time (timing constraints) as a new element to test.
87.
★ Final term Spring 2010
Top-down integration testing has as it's major advantage(s) that
Alow level modules never need testing
Bmajor decision points are tested early
Cno stubs need to be written
Dnone of the given
Top-down integration tests the high-level control and decision modules first.
88.
★ Final term Spring 2010
isAuthorized, assess Performance,get item for UPC, get cashier for number, are the examples of
AServices
BAttributes
CLinks
DNon of the above
These are operations objects provide, i.e. services in the Coad object model.
89.
★ Final term Spring 2010
Hungarian Notation was first discussed by Charles Simonyi of------------------
AMicrosoft.
BOracle
CApple Macintosh
DNon of the all
Charles Simonyi, who introduced Hungarian notation, worked at Microsoft.
90.
★ Final term Spring 2010
The language does not specify whether ------------- is signed or unsigned.
Achar
Binteger
Cdouble
Dconstant
C/C++ leave the signedness of plain char to the implementation.
91.
★ Final term Spring 2010
Bugs Fixing is done by which of the teams in Software Development lifecycle?
ADevelopment Team
BTesting Team
CAnalysis & Design Team
DProcess Team
The development team fixes bugs; the testing team finds them.
92.
★ Final term Spring 2010
Stakeholders are different people who would be interested in the -----------
ASoftware
BSystem
CProduct
DAll of the given
Stakeholders are the people who have an interest in the software being built.
93.
★ Final term Spring 2010
Which of the following is an/are advantage(s) of object oriented analysis & design over structured system analysis & design?
AEase of modeling real world events
BReusability
CMaintainability
DAll of given
OOAD models real-world entities naturally and improves reuse and maintainability.
94.
★ Final term Spring 2010
UML (unified modeling language) analysis modeling focuses on the _________________ .
Abehavioral model and environment model.
Bbehavioral model and implementation model.
Cuser model and environmental model
Duser model and structural model
UML analysis modelling focuses on the user model view and the structural model view.
95.
★ Final term Spring 2010
In the architecture trade-off analysis method the architectural style should be described using the
Amodule view
Bprocess view
Call of the given
Ddata flow view
ATAM describes the style using module, process and data flow views.
96.
★ Final term Spring 2010
Which of these are objectives for software testing?
Adetermine the productivity of programmers
Beliminate the need for future program maintenance
Celiminate every error prior to release
Duncover software errors
The objective of testing is to uncover errors in the software.
97.
★ Final term Spring 2010
Rooko mut jane do depicts one of risks associated with inadequate requriements gathering, the name of that risk is ----------------------
AAmbiguous requirements
BCreeping Requirements
CMinimal Specification
DNon of the above
The phrase can be read with opposite meanings, so it illustrates ambiguous requirements.
98.
★ Final term Spring 2010
object-oriented framework that is a set of cooperative classes that make up reusable ---------- of a system
ACode
BDesign
CAnalysis
Dnon of the all
A framework is a set of cooperating classes that make up a reusable design.
99.
★ Final term Spring 2010
When planning for performance, one should always remember the ---------- rule
A80/20
B20/80
C80/22
D80/90
The 80/20 rule: most time is spent in a small part of the code.
100.
★ Final term Spring 2010
Performance & Usability are examples of ---------------------- requirements
ABusiness
BFunctional
CNon-Functional
DUser
Performance and usability describe qualities of the system, so they are non-functional.
101.
★ Final term Spring 2010
Static analyzers are software tools for --------------- processing.
Aanalysis text
Bsource text
Cdesign text
Dnon of the given
Static analyzers process the program source text without executing it.
102.
★ Final term Spring 2010
According to a survey, when a software application is in the maintenance phase, --------- of its lifecycle cost is attributed towards the defects which are found in the software application after installation
A20 %
B25 %
C30%
D35%
The survey figure is that about 20% of lifecycle cost goes to defects found after installation.
103.
★ Final term Spring 2010
Bugs that won't "-----------------" (almost random) are the most difficult to deal with.
Astand still
Bdynamic
Crunning
Dstand tall
The handout phrase is bugs that won't "stand still" are the most difficult to deal with.
104.
★ Final term Spring 2010
If you are initializing a variable at the time of declaration, do not declare another ----------- in the same statement.
Avariable
Bobject
Cclass
DNone of given
Declaring another variable in an initializing declaration causes confusion, e.g. int a, b = 10.
105.
★ Final term Spring 2010
During Requirement Engineering process which of the following is/are document(s) used for fact finding?
ACompany’s employee list
BSamples of the company databases
CThe company’s mission statement and plan
DAll of given
Employee lists, database samples and mission statements are all documents studied for fact finding.
106.
★ Final term Fall 2008
Object-oriented domain analysis is concerned with the identification and specification of reusable capabilities within an application domain.
ATrue
BFalse
Domain analysis identifies reusable classes and capabilities across an application domain.
107.
★ Final term Fall 2008
Fourth generation techniques
AAllow software to be developed without any testing.
BEliminate the need for costly requirements gathering activities.
CCan reduce the time required to develop software.
DAre best used by non-programmers to build small systems.
Fourth generation tools generate code from high-level specifications and so shorten development time.
108.
★ Final term Fall 2008
Data design actually begins during the creation of the analysis model, not the architectural model.
ATrue
BFalse
Data design starts with the data objects defined in the analysis model.
109.
★ Final term Fall 2008
A useful technique for evaluating the overall complexity of a proposed architecture is to look at the component
Anumber and size of components
Bflow dependencies and sharing dependencies
Csize and cost
Dnone of the given
Architectural complexity is judged by the dependencies (flow and sharing) between components.
110.
★ Final term Fall 2008
The three basic principles that guide maintainability are: simplicity, clarity, and__________________ .
AGenerality
BReliability
CAll of the given choices
DNone of the Given choices
Simplicity, clarity and generality are the principles behind maintainable code.
111.
★ Final term Fall 2008
In order to make a program self documented a number of attributes required. Which one is the attribute/s of self documented program
AAll of the given choices
BSize of each function
CChoice of variable
DModularity
Function size, choice of names and modularity all make a program self-documenting.
112.
★ Final term Fall 2008
Floating point constants should always be written with decimal point and at least
Aone decimal
Btwo decimal
Cthree decimal
Dnone of the given
Floating-point constants should have a decimal point and at least one decimal, e.g. 1.0.
113.
★ Final term Fall 2008
Graph-based testing methods can only be used for object-oriented systems
ATrue
BFalse
Graph-based testing applies to any software that can be modelled as a graph of objects or nodes.
114.
★ Final term Fall 2008
A class is a -------------- of objects
ATemplate
BStereotype
CCollection
DNon of the above
A class is a template from which objects are created.
115.
★ Final term Fall 2008
A public Interface provides a way for ______ with other Classes.
ACommunication
BAccessibility
CReaching
DAll of the above
The public interface is how an object communicates with other classes.
116.
★ Final term Fall 2008
Flow Charts represents
Asequence Activity
Brandom activity
Cparallel activity
Dnon of the above
Flow charts show activities in sequence and cannot express parallel activity.
117.
★ Final term Fall 2008
Software architecture defines the high level structure of the software by putting together a number of architectural ---------- in an organized fashion.
AElements
Bparts
Ccomponents
Dnon of the all
Architecture organizes architectural elements into a high-level structure.
118.
★ Final term Fall 2008
Type conversions must always be done -------------
AExplicitly
Bimplicitly
Csimultaneously
Dnon of them
Type conversions should be explicit so the reader sees them.
119.
★ Final term Fall 2008
Types that are -----------to one file only can be declared inside that file.
ALocal
BGlobal
CPrivate
DGeneral
Types used only in one file can be declared locally in that file.
120.
★ Final term Fall 2008
The use of do while loops should be -------------
AAvoided
Bencouraged
Cpracticed
Dnon of them
do-while loops put the condition at the bottom and are less readable, so they are avoided.
121.
★ Final term Fall 2008
The goal of testing is to expose ---------- defects in a software system before it is put to use.
ALatent
Balready present
Ccurrent
Druntime
Testing aims to expose latent (hidden) defects before the system is used.
122.
★ Final term Spring 2006
The component-based development model is
AOnly appropriate for computer hardware design.
BNot able to support the development of reusable components.
CDependent on object technologies for support.
DNot cost effective by known quantifiable software metrics.
Component-based development relies on object technologies to build and assemble reusable components.
123.
★ Final term Spring 2006
Use-Cases are scenarios that describe
AHow software is to be used in a given situation.
BHow CASE tool will be used to construct the system.
CTo build plan for a software product.
DThe test cases for a software product.
A use case describes how an actor uses the system in a particular situation.
124.
★ Final term Spring 2006
In which software development problem solving stage are the results delivered?
AStatus quo
BProblem definition
CTechnical development
DSolution integration
In the problem-solving loop, solution integration delivers the results to those who need them.
125.
★ Final term Spring 2010
Variables should be initialized where they are declared and they should be declared in the -------------- scope possible.
ASmallest
Blargest
Cmedium
DNone of the given
Declaring variables in the smallest possible scope limits where they can be misused.
126.
★ Final term Fall 2006
The linear sequential model of software development is also known as the
AClassical life cycle model
BFountain model
CSpiral model
DChaos model
The linear sequential (waterfall) model is also called the classic life cycle model.
127.
★ Final term Fall 2006
The object-behavior model indicates how the system
Afunctions in the operating environment
Bobjects collaborate with one another
Cresponds to external stimuli
Dresponds to internal stimuli
The object-behaviour model shows how an OO system responds to external events or stimuli.
128.
★ Final term Fall 2006
Class responsibilities are defined by
Aits attributes only
Bits collaborators
Cits operations only
Dboth its attributes and operations
A class's responsibilities are what it knows (attributes) and what it does (operations).
129.
★ Final term Fall 2006
Software risk always involves two characteristics
Afire fighting and crisis management
Bknown and unknown risks
Cuncertainty and loss
Dstaffing and budget
A risk is uncertain (may not happen) and causes loss if it does.
130.
★ Final term Fall 2006
The four layers defined for object-oriented design are the same as design layers used for conventional software design.
Which of the followings can not be used to relate use cases with each other?
AExtends
BInclude
CUses
DExclude
Use cases are related by extends, includes and uses; there is no exclude relationship.
No MCQs match this filter.Is filter mein koi MCQ nahi.
1.
★ Final term Spring 20102 marks
What is Software Testing?
Show answerJawab dekhein
Software testing is the process of executing a program (or part of it) with the intent of finding errors. It examines the software against its specification and the users' expectations to expose latent defects before the system is put to use.
2.
★ Final term Spring 2010Lecture 402 marks
Write unit testing qualitative benefits.
Show answerJawab dekhein
Assessment-oriented: writing unit tests forces the developer to deal with design issues such as cohesion and coupling. Confidence-building: we know early which units work as designed, and code is easier to change because it can be re-tested quickly.
3.
★ Final term Spring 20102 marks
Where Term Compute can be used in Methods?
Show answerJawab dekhein
The term "compute" should be used in names of methods where something is calculated, e.g. valueSet.computeAverage() or matrix.computeInverse(). It tells the reader that a potentially time-consuming computation is done and that the result may be worth caching.
4.
★ Final term Spring 20102 marks
Which of the following is a/are non-functional requirement of an e-learning system?
(a) User friendliness
(b) Time taken to download study materials through the system should not be too long.
(c) On-line assignment submission facility
(d) On-line chatting facility
(e) Robustness
Show answerJawab dekhein
(a) user friendliness, (b) download time (performance) and (e) robustness are non-functional requirements. (c) assignment submission and (d) chatting are functional requirements (services the system provides).
5.
★ Final term Spring 2010Lecture 403 marks
Write unit testing principles.
Show answerJawab dekhein
Unit testing principles: each unit (function, class, module) is tested by its developer during implementation; a unit is tested in isolation, using stubs and drivers for the parts it depends on; test cases cover normal and boundary inputs and compare actual output with expected results; tests should be independent of each other, repeatable and preferably automated; tests are re-run after every change (regression).
6.
★ Final term Spring 20103 marks
The use of do .... while loops should be avoided. Explain why ?
Show answerJawab dekhein
In a do-while loop the condition is at the bottom, so the reader must read the whole body before knowing when the loop ends, and the body always runs at least once even when it should not. This makes the code less readable and more error-prone. A while or for loop states the condition at the top and is clearer, so do-while loops should be avoided.
7.
★ Final term Spring 2010Lecture 383 marks
Give 3 Equivalence partitioning guidelines
Show answerJawab dekhein
1) If an input condition specifies a range, define one valid and two invalid classes (below and above the range). 2) If an input condition requires a specific value, define one valid and two invalid classes. 3) If an input condition specifies a member of a set, define one valid and one invalid class. (Also: a Boolean input gives one valid and one invalid class.)
8.
★ Final term July 20122 marks
How we can make self-documented code ?
Show answerJawab dekhein
By choosing meaningful names for variables, constants, functions and classes; using named constants instead of magic numbers; keeping functions small and modular; using a clear, explicit logical structure with proper layout, indentation and parentheses; so that the code explains itself and needs few comments.
9.
★ Final term July 2012Lecture 422 marks
What is software debugging ?
Show answerJawab dekhein
Debugging is the process of locating the cause of a known failure (bug) in the program and correcting it. Testing shows that a defect exists; debugging finds where and why it occurs and removes it, then the fix is re-tested.
10.
★ Final term July 2012Lecture 352 marks
What is the greatest advantage of exception handling ?
Show answerJawab dekhein
Its greatest advantage is that it separates error-handling code from the normal code, so the normal logic stays clear and readable while errors are still caught and handled in one place.
11.
★ Final term July 20123 marks
The use of do.... while loops should be avoided, why is that ?
Show answerJawab dekhein
In a do-while loop the condition is at the bottom, so the reader must read the whole body before knowing when the loop ends, and the body always runs at least once even when it should not. This makes the code less readable and more error-prone. A while or for loop states the condition at the top and is clearer, so do-while loops should be avoided.
12.
★ Final term July 20123 marks
What is test case and test data?
Show answerJawab dekhein
A test case is a specification of a test: the input/output specification plus a statement of the function under test, the steps to perform it and the expected results. Test data are the actual input values used to execute a test case (for example 5 and -3 for an add function).
13.
★ Final term July 2012Lecture 413 marks
What are Inspection pre-conditions ?
Show answerJawab dekhein
Before an inspection: a precise specification must be available; team members must be familiar with the organization's standards; syntactically correct code must be available; an error checklist should be prepared; management must accept that inspection increases costs early in the process; and management must not use inspection results to evaluate staff.
14.
★ Final term July 20123 marks
Define the external entities in the statement “Air traffic control system”.
Show answerJawab dekhein
External entities are things outside the system that interact with it. For an air traffic control system they include the aircraft (pilots), air traffic controllers, the radar/sensor systems that send position data, and other airports or neighbouring control centres and the weather service that exchange information with it.
15.
★ Final term 2012Lecture 72 marks
Suppose an E-Bill systems which send the monthly bill of the customer on regular basis via E-mail every month. What is the “Sink” of the system?
Show answerJawab dekhein
A sink is the external entity that receives data from the system. Here the sink is the customer, who receives the monthly bill by e-mail.
16.
★ Final term Spring 2010Lecture 322 marks
Define Modularity.
Show answerJawab dekhein
Modularity is dividing a program into separate, small, well-defined modules (functions, classes), each doing one task. It reduces the size of individual functions, makes code more readable and easier to understand, test, reuse and maintain.
17.
★ Final term Spring 20102 marks
Differentiate between Architectural Design and System Architecture in one line.
Show answerJawab dekhein
Architectural design is the process (activity) of identifying the subsystems and the framework for their control and communication, while system/software architecture is the result of that process: the high-level structure of the system made of components and their relationships.
18.
★ Final term Spring 2010Lecture 422 marks
What is meant by Software Debugging?
Show answerJawab dekhein
Debugging is the process of locating the cause of a known failure (bug) in the program and correcting it. Testing shows that a defect exists; debugging finds where and why it occurs and removes it, then the fix is re-tested.
19.
★ Final term Spring 2010Lecture 303 marks
Why comments are required to be indented and how it should be done, explain with one example?
Show answerJawab dekhein
Comments should be indented relative to their position in the code so that they line up with the code they describe; this keeps the layout readable and shows which block the comment belongs to. Example:
while (true) {
// Do something
something();
}
is correct, whereas putting "// Do something" at the left margin inside the loop breaks the logical structure.
20.
★ Final term Spring 20103 marks
What are the different phases of testing? Draw a diagram. (No write up required)
Show answerJawab dekhein
Phases (in order): unit testing -> module (component) testing -> subsystem/integration testing -> system testing -> acceptance testing. Unit and module testing are component testing (done by developers), subsystem and system testing are integration testing, and acceptance (user) testing comes last; alpha and beta testing are forms of acceptance testing.
21.
★ Final term Fall 20043 marks
How do Software characteristics differ from Hardware characteristics?
Show answerJawab dekhein
Software is intangible and is developed or engineered, not manufactured; cost is in design and development, not production. Software does not wear out with use (hardware has a bathtub failure curve), but it deteriorates because of changes made during maintenance. Software is highly configurable and easy to change, and a change to one part can implicitly affect the rest of the code; most software is still custom-built rather than assembled from standard components as hardware is.
22.
★ Final term Spring 2006Lecture 38
definition & example of Equivalence Partitions
Show answerJawab dekhein
An equivalence partition (class) is a set of input values that the program is expected to treat in the same way, so testing one value from the class is taken as testing the whole class: if one value finds a defect, the others probably will too, and if it does not, the others probably will not either. Partitions are made for valid and invalid inputs. Example: if an input age must be between 18 and 60, the classes are age < 18 (invalid), 18 to 60 (valid) and age > 60 (invalid); test values could be 10, 35 and 70.
23.
★ Final term Spring 2006
What is the importance of Self Documented Code in Software Engineering?
Show answerJawab dekhein
Self-documenting code explains itself through meaningful names, clear layout and an explicit logical structure, without depending on comments and extra documents. It makes code easier to read and understand, so it is easier to maintain, modify and debug; it reduces the need for comments, which can become outdated and are not syntax checked; and it helps new team members and maintainers, which lowers maintenance cost.
24.
★ Final term Spring 2006
Explain why encapsulation, inheritance, and polymorphism are three important characteristics of object-oriented systems.
Show answerJawab dekhein
Encapsulation packages data and the operations on it together and hides the internal details behind an interface, so changes stay localized and objects are protected from misuse. Inheritance lets a class reuse and extend the attributes and operations of a more general class, giving reuse and a natural generalization-specialization hierarchy. Polymorphism lets the same message (operation name) be handled differently by objects of different classes, so new classes can be added without changing the code that uses them. Together they give modular, reusable, extensible and maintainable systems.
25.
★ Final term Spring 2006
List the problems we risk facing if software engineering principles are not applied to software development.
Show answerJawab dekhein
Projects run over budget and over schedule; the software does not meet the users' requirements; it is unreliable, buggy and of poor quality; it is hard to maintain and change, so maintenance costs grow; projects may be cancelled; and the complexity of large systems cannot be managed. These problems together are known as the software crisis.
26.
★ Final term Spring 2006
What are the differences between Thin Client and Fat Client architecture?
Show answerJawab dekhein
In a thin-client model all application processing and data management are done on the server; the client only runs the presentation software. This places a heavy processing load on both the server and the network. In a fat-client model the server is responsible only for data management, while the client runs the application logic and the presentation. This uses client processing power and reduces server and network load, but the system is more complex to manage, since new versions of the application must be installed on every client.
27.
★ Final term Spring 2006Lecture 43
Following is the list of bugs’ symptoms; identify the bug classes in each case.
a) System slowdowns.
b) The program doesn't crash, but the flow of the program takes odd branches through the code.
c) If your program simply locks up, repeatedly displays the same data over and over, or infinitely displays the same message box.
Show answerJawab dekhein
a) Memory leak (memory is allocated and not freed, so the system slows down). b) Logical error. c) Loop error (an infinite or improperly ended loop).
28.
★ Final term Spring 20102 marks
What is called self documenting code?
Show answerJawab dekhein
Self-documenting code is code that explains itself through meaningful identifier names, named constants and clear structure, so the reader does not need comments or separate documentation such as flow charts or UML diagrams to understand it.
29.
★ Final term Spring 2010Lecture 412 marks
What is an Inspection Checklist?
Show answerJawab dekhein
An inspection checklist is a list of common errors for the programming language in use (for example uninitialised variables, array bounds, unmatched parameters, missing loop termination). It is prepared before the inspection and used by the inspectors to drive the review of the code.
30.
★ Final term Spring 2010Lecture 352 marks
Give 2 examples of exceptional code paths.
Show answerJawab dekhein
With exceptions, any call or operator can create a hidden path. For example in
if (e.Title() == "CEO" || e.Salary() > 10000)
1) e.Title(), e.Salary() or operator == might throw an exception, leaving the if-statement early;
2) in cout << e.First() << " " << e.Last() << " is overpaid" << endl; any of the << operator calls might throw.
Also, passing e by value means the copy constructor might throw.
31.
★ Final term Spring 20102 marks
The following written statement depicts which requirement from the requirement engineering process
"Constraints on the services or functions offered by the system such as timing constraints, constraints on the development process, standards, etc."
Show answerJawab dekhein
Non-functional requirements. They constrain the services or functions of the system (timing, development process, standards) rather than describing the services themselves.
32.
★ Final term Spring 2010Lecture 303 marks
Give three general rules for avoiding split lines.
Show answerJawab dekhein
When a statement must be split over lines: 1) break after a comma; 2) break after an operator; 3) align the new line with the beginning of the expression on the previous line.
33.
★ Final term Spring 2010Lecture 393 marks
Explain about 3 coverage schemes in white box testing.
Show answerJawab dekhein
Statement coverage: test cases are chosen so that every statement in the code is executed at least once.
Branch coverage: every branch (true and false outcome) of every decision is executed at least once, so the statement sequences after each decision are tested.
Path coverage: every possible path from the entry to the exit of the program is executed; this is the most thorough and usually needs many test cases.
34.
★ Final term Spring 20102 marks
What does this mean "Object Creation and Life Time"?
Show answerJawab dekhein
It is a difference between aggregation (whole-part) and association. In aggregation, when the whole object is created all its parts must also be created before it can do useful work, and the parts die with the whole. In association, the lifetimes of the two objects are independent; the only rule is that an object must exist before a message is sent to it.
35.
★ Final term Spring 20102 marks
How one can avoid hazards caused by side effects while writing code. List the two guidelines.
Show answerJawab dekhein
1) Never use the comma operator except in declarations, and do not declare another variable in a statement that initialises one.
2) Never use multiple assignments in the same statement.
Also be careful with functions that change their parameters, and avoid functions that both change a parameter and return a value.
36.
★ Final term Spring 2010Lecture 402 marks
Give 2 Unit Testing Tips.
Show answerJawab dekhein
1) Keep unit tests conveniently located: in small projects embed the test in the module itself; in large projects keep tests in the package directory or a /test subdirectory.
2) Make the tests accessible to developers, as they show how to use the module and serve as regression tests for future changes (a main routine with conditional compilation can run them).
37.
★ Final term Spring 2010Lecture 303 marks
How Comments should be indented relative to their position in the code? Give an example
Show answerJawab dekhein
Comments should be indented to the same level as the code they describe, not placed at the left margin.
while (true) {
// Do something
something();
}
NOT:
while (true) {
// Do something
something();
}
38.
★ Final term Spring 2010Lecture 393 marks
Consider the following code fragment.
while a
{
while b
c
d
}
If you were to test this code, what would be the test technique to adopt?
Show answerJawab dekhein
White box (structural) testing. Draw the flow graph of the nested loops and design test cases for statement, branch and path coverage, using cyclomatic complexity to find the basis paths: each loop should be tested for zero, one and many iterations, starting with the inner loop while the outer loop runs a minimal number of times.
39.
★ Final term Spring 2010
Where the term compute method use.
Show answerJawab dekhein
The prefix compute is used in method names where something is calculated, e.g. valueSet.computeAverage(); matrix.computeInverse();
40.
★ Final term Spring 2010Lecture 39
Describe three coverage schemes related to white box testing
Show answerJawab dekhein
Statement coverage: every statement is executed at least once.
Branch coverage: every outcome of every decision is executed at least once.
Path coverage: every path from entry to exit is executed; most thorough but needs many test cases.
41.
★ Final term Spring 2010Lecture 43
Memory over-runs and their symptoms
Show answerJawab dekhein
A memory overrun is using memory that does not belong to you, e.g. writing past an array's end or copying a string longer than its buffer.
Symptoms: the program crashes regularly after a particular routine is called; if that routine looks correct, an earlier routine in the call sequence has probably already trashed variables or memory; the trace log of routines leading up to the failure often reveals it.
42.
★ Final term Spring 20091 marks
Write the procedure how names representing Abbreviations and acronyms should be described in coding style guide.
Show answerJawab dekhein
Abbreviations and acronyms should not be written in upper case when used in a name: exportHtmlSource(); not exportHTMLSource(); openDvdPlayer(); not openDVDPlayer();
43.
★ Final term Spring 20091 marks
Define a system downtime.
Show answerJawab dekhein
System downtime is the period when the system is not working, during which developers are under great pressure to fix the problem and get the system running again.
44.
★ Final term Spring 2009Lecture 242 marks
What is layered architecture
Show answerJawab dekhein
A layered architecture organises the system into layers, each providing services to the layer above; inner layers are closer to the hardware (as in an operating system). An outer layer only needs the interface of the inner layer, so an inner layer can change without affecting outer layers as long as its interface stays the same, which improves portability and maintainability.
45.
★ Final term Spring 2009Lecture 392 marks
What is Infeasible path?
Show answerJawab dekhein
An infeasible path is a path in a program's flow graph that can never be executed for any input data, because the conditions along it contradict each other.
46.
★ Final term Spring 2009Lecture 343 marks
List three guidelines that can help you in writing portable code.
Show answerJawab dekhein
1) Stick to the standard (ANSI/ISO C++, STL instead of vendor extensions).
2) Program in the mainstream, e.g. always write function prototypes.
3) Do not assume sizes of data types, order of evaluation, or the signedness of char.
47.
★ Final term Spring 20093 marks
Write the General Form for documenting patterns.
Show answerJawab dekhein
A pattern is documented with: its name; the motivation or context it applies to; prerequisites to satisfy before using it; a description of the program structure it defines; the participants needed to complete it; its consequences, both positive and negative; and examples.
48.
★ Final term Spring 20102 marks
What are the six elements that are present in every computer-based system?
Show answerJawab dekhein
Software, hardware, people, database, documentation and procedures.
49.
★ Final term Spring 2010Lecture 382 marks
What are the true statements with respect to equivalence partitioning?
(a) Input data and output results often fall into different classes where all members of a class are related.
(b) It is a method to partition the requirements into equivalent classes during the requirement analysis process.
(c) Test cases should be chosen to be representative of each equivalence partition.
(d) It is recommended that only boundaries are checked in each partition.
(e) It is recommended that boundaries as well as mid points are checked in each partition.
Show answerJawab dekhein
(a), (c) and (e) are true. (b) is false: equivalence partitioning partitions inputs for test design, not requirements during analysis; (d) is false because mid-points should be tested as well as boundaries.
50.
★ Final term Spring 2010Lecture 303 marks
Why Special characters like TAB and page break must be avoided? Explain
Show answerJawab dekhein
TAB and page-break characters are interpreted differently by different editors, printers, terminal emulators and debuggers, so in a multi-programmer, multi-platform environment they break the layout and cause problems; spaces should be used instead.
51.
★ Final term Spring 20103 marks
Explain the different phases of Testing with the help of a Diagram. You are required to only draw the diagram.
Show answerJawab dekhein
Unit testing -> Module testing -> Sub-system testing -> System testing -> Acceptance testing. The first two are component testing (done by developers), sub-system and system testing are integration testing, and acceptance testing is user testing.
52.
★ Final term Spring 2011Lecture 402 marks
What is unit testing?
Show answerJawab dekhein
Unit testing is testing of individual code units (functions, modules, classes) by their developers during implementation, checking normal and boundary inputs against expected results, before the units are integrated.
53.
★ Final term Spring 20113 marks
Define Textual Analysis?
Show answerJawab dekhein
Textual analysis is the oldest technique for identifying objects and their relationships, developed by Abbott and extended by Graham and others. Parts of speech in the text of the specification are identified and modelled: nouns become candidate objects/classes, verbs become operations or relationships, and adjectives become attributes.
54.
★ Final term Spring 20113 marks
How one can avoid hazards caused by side effects?
Show answerJawab dekhein
1) Never use the comma operator except in declarations; if a variable is initialised in a declaration, do not declare another one in the same statement.
2) Never use multiple assignments in one statement.
3) Be careful with functions that change their parameters, and avoid functions that change a parameter and also return a value.
55.
★ Final term Spring 2011
What is testing and also describe successful testing?
Show answerJawab dekhein
Software testing is the process of examining a software product against its requirements: executing it on test data and comparing its output with the documented behaviour, in order to find defects before the software is put to use.
Objective: testing tries to refute, not verify, the software: its goal is to expose latent defects before the system is used. A tester tries to break the system; testing shows the presence of defects, never their absence, because exhaustive testing is impossible. It only increases confidence in the software.
Successful test: a test is successful if it discovers an error (Myers: if you look for problems you find more of them). Success is measured by the ability to find bugs, not to show there are none.
56.
★ Final term Spring 2011
Mention two General naming conventions for Java?
Show answerJawab dekhein
1) Type names are nouns in mixed case starting with upper case: Line, FilePrefix.
2) Variable names are mixed case starting with lower case: line, filePrefix.
(Also: constants all upper case with underscores, method names are verbs starting with lower case.)
57.
★ Final term Spring 2011Lecture 433 marks
Memory and resource leak symptoms
Show answerJawab dekhein
Memory and resource leaks happen when memory or resources (files, handles) are allocated and never released.
Symptoms: system slowdowns, and crashes that occur 'randomly' over a long period of time.
58.
★ Final term Spring 2011Lecture 40
UNIT TESTING?
Show answerJawab dekhein
Unit testing is testing of individual code units (functions, modules, classes) by their developers during implementation, checking normal and boundary inputs against expected results, before the units are integrated.
59.
★ Final term Spring 2011Lecture 39
WHITE BOX TESTING?
Show answerJawab dekhein
White box (structural) testing tests the internal structure of the program: test cases are derived from the code so that its statements, branches and paths are exercised (statement, branch and path coverage), typically using the flow graph and cyclomatic complexity.
60.
★ Final term Spring 2011
OBJECTIVE OF TESTING AND SUCCESSFUL TEST?
Show answerJawab dekhein
Objective: testing tries to refute, not verify, the software: its goal is to expose latent defects before the system is used. A tester tries to break the system; testing shows the presence of defects, never their absence, because exhaustive testing is impossible. It only increases confidence in the software.
Successful test: a test is successful if it discovers an error (Myers: if you look for problems you find more of them). Success is measured by the ability to find bugs, not to show there are none.
61.
★ Final term Spring 2011Lecture 43
LOOP ERROR BUG?
Show answerJawab dekhein
Loop errors occur around loop constructs; the subtypes are infinite loops, off-by-one loops and improperly exited loops.
Symptoms: the program locks up or repeatedly shows the same data or message box (infinite loop); a calculated total is wrong by the last data point, or the last points of a graph are not connected (off-by-one); a process ends unexpectedly when it should have continued (improper exit).
62.
★ Final term Spring 2011
BALANCING ACT IN SOFTWARE ENGINEERING?
Show answerJawab dekhein
Software engineering is a balancing act: the engineer must trade off competing qualities such as cost, efficiency, reliability, user-friendliness and maintainability, deciding which matter most for the particular software, because they cannot all be maximised at once.
63.
★ Final term Spring 2011Lecture 30
HOW COMMENTS BE INDENTED?
Show answerJawab dekhein
Comments are indented to the same level as the code they describe:
while (true) {
// Do something
something();
}
64.
★ Final term Spring 2011Lecture 30
WHY SPECIAL CHARACTERS TAB AND BREAK PAGE BE AVOIDED?
Show answerJawab dekhein
TAB and page-break characters are interpreted differently by different editors, printers, terminal emulators and debuggers, so in a multi-programmer, multi-platform environment they break the layout and cause problems; spaces should be used instead.
65.
★ Final term Spring 2011Lecture 29
INCLUDE FILES AND INCLUDE STATEMENT?
Show answerJawab dekhein
Header files must contain a guard against multiple inclusion, written in upper case from the module name, file name and the h suffix:
#ifndef MOD_FILENAME_H
#define MOD_FILENAME_H
:
#endif
It prevents compilation errors and should be at the top of the file so parsing stops at once. Include statements should be sorted and grouped (system/library headers first, then project headers), with paths relative to the project, and placed only at the top of the file.
66.
★ Final term Spring 2011Lecture 42
Define debugging?
Show answerJawab dekhein
Debugging is the process of locating and fixing the cause of a known defect after testing has revealed a failure; debugging techniques are the way to reach the code that is malfunctioning.
67.
★ Final term Spring 2011
Define testing?
Show answerJawab dekhein
Software testing is the process of examining a software product against its requirements: executing it on test data and comparing its output with the documented behaviour, in order to find defects before the software is put to use.
68.
★ Final term Spring 2011
Software development processes?
Show answerJawab dekhein
Software development is the process of balancing the different characteristics of software (cost, efficiency, reliability, user-friendliness, maintainability); finding a good balance is an art learned from experience. It is carried out through a process of activities such as requirements, design, coding, testing and maintenance, following a process model (e.g. waterfall, iterative).
69.
★ Final term Spring 2011Lecture 41
Inspection pre-conditions?
Show answerJawab dekhein
A precise specification must be available; team members must be familiar with the organisation's standards; syntactically correct (compiling) code must be available; and an error checklist should be prepared to guide the inspection.
70.
★ Final term Spring 2011Lecture 40
describe two Unit Testing Tips
Show answerJawab dekhein
1) Keep unit tests conveniently located: in small projects embed the test in the module itself; in large projects keep tests in the package directory or a /test subdirectory.
2) Make the tests accessible to developers, as they show how to use the module and serve as regression tests for future changes (a main routine with conditional compilation can run them).
71.
★ Final term Spring 2011Lecture 38
Equivalence Classes
Show answerJawab dekhein
Two tests are equivalent if, when one finds a defect, the other probably will too, and if one does not, the other probably will not either. The input domain is divided into such classes (partitions), and one representative test case is taken from each, so the system is tested effectively with fewer cases. Partitions must be clearly distinct; finding them is subjective.
72.
★ Final term Spring 2011Lecture 40
Define Unit testing
Show answerJawab dekhein
Unit testing is testing of individual code units (functions, modules, classes) by their developers during implementation, checking normal and boundary inputs against expected results, before the units are integrated.
73.
★ Final term Spring 2011Lecture 20
What is the syntax used for naming objects in a sequence diagrams?
Show answerJawab dekhein
Objects are named [instanceName][:className], e.g. myAccount:Account or :Account. Class names should match the class diagram, and instance names are included when objects are referred to in messages or when several objects of the same class appear.
74.
★ Final term Spring 2011Lecture 39
Define these terms: Branch Coverage, Statement Coverage.
Show answerJawab dekhein
Statement coverage: test cases execute every statement of the code at least once.
Branch coverage: test cases execute every branch (true and false outcome) of every decision at least once, so the statement sequences after each decision are tested.
75.
★ Final term Spring 2011Lecture 34
Bit fields do suffer from a lack of portability between platforms. Why?
Show answerJawab dekhein
Because: plain int bit fields may be signed or unsigned depending on the compiler; many compilers limit a bit field to the size of an int, which may be 16 or 32 bits; some compilers store bit-field members left to right and others right to left; and when a field does not fit, it may be stored across the word boundary or moved to the next word.
76.
★ Final term Spring 2011
Write down at least two (3) guideline that can avoid hazards caused by side effects.
Show answerJawab dekhein
1) Never use the comma operator except in declarations; if a variable is initialised in a declaration, do not declare another one in the same statement.
2) Never use multiple assignments in one statement.
3) Be careful with functions that change their parameters, and avoid functions that change a parameter and also return a value.
77.
★ Final term Spring 2011
Differentiate between Black box testing and white box testing.
Show answerJawab dekhein
Black box (functional) testing treats the component as a black box and tests its behaviour against the requirements using inputs and expected outputs, without looking at how the inputs are transformed (e.g. equivalence partitioning, boundary values).
White box (structural) testing looks inside the code and derives test cases from its structure to cover its statements, branches and paths.
78.
★ Final term Spring 2011
What do we mean by ambiguous requirements. Explain with the help of an example.
Show answerJawab dekhein
A requirement is ambiguous when different readers of the same document interpret it differently; this comes from the imprecision of natural language. Example: the Urdu phrase 'Rooko mut jane doo' means 'Rooko, mut jane doo' (stop him, don't let him go) or 'Rooko mut, jane doo' (don't stop him, let him go), depending on where the comma is placed. Ambiguous requirements cause misunderstandings and mismatched expectations, wasting time and effort and producing an unwanted product.
1.
★ Final term Spring 2010Lecture 435 marks
Discuss the symptoms and an example of memory overrun bug class.
Show answerJawab dekhein
A memory overrun happens when a program writes past the end (or before the start) of a memory block it owns, corrupting other variables or memory. Symptoms: the program crashes quite regularly after a given routine is called, so that routine should be examined for an overrun; if that routine looks correct, another routine called earlier has probably already trashed variables or memory blocks; checking the trace log of the routines called before the failing one often shows the error. Example: char name[5]; strcpy(name, "Muhammad"); copies 9 bytes into a 5-byte array and overwrites the memory after it, so a later, unrelated routine fails.
2.
★ Final term Spring 20105 marks
Write at least 5 General Naming conventions for C++ or Java
Show answerJawab dekhein
1) Names representing types (classes) are nouns in mixed case starting with upper case, e.g. Line, SavingsAccount. 2) Variable names are in mixed case starting with lower case, e.g. line, savingsAccount. 3) Named constants are all upper case with underscores, e.g. MAX_ITERATIONS. 4) Names of methods/functions are verbs in mixed case starting with lower case, e.g. getName(), computeTotal(). 5) Abbreviations and acronyms are not written in upper case inside names, e.g. exportHtmlSource(). 6) Boolean variables and methods use the "is" prefix, e.g. isSet, isVisible. 7) Plural names are used for collections, and the prefix n for number of objects, e.g. points, nPoints. 8) Private class variables have an underscore suffix (C++), e.g. length_.
3.
★ Final term Spring 20105 marks
Explain at least 2 code structures.
Show answerJawab dekhein
Code (control) structures and their guidelines: 1) if-else: put the nominal case in the if-part and the exception in the else-part; keep conditions simple (assign complex conditions to well-named Boolean variables) and always use braces. 2) Loops: only loop-control statements belong inside for(); use for(;;) for an empty (infinite) loop; avoid do-while loops because the condition is at the bottom; keep loop bodies short. 3) switch: every case ends with break (explicitly comment fall-through) and a default case is always included. Avoid goto because it breaks structured code.
4.
★ Final term July 20125 marks
What is the Software testing objective? Also define a successful test ?
Show answerJawab dekhein
Objective: testing is the process of executing a program with the intent of finding errors; its goal is to expose latent defects before the system is put to use, by checking it against its specification and users' expectations. A good test case is one that has a high probability of finding an as-yet undiscovered error. A successful test is one that uncovers an as-yet undiscovered error (a test that finds no error has not shown the program is correct).
5.
★ Final term July 2012Lecture 435 marks
What are loop errors symptoms and explain with example ?
Show answerJawab dekhein
Loop errors include infinite loops, off-by-one errors and improperly exited loops. Symptoms: the program simply locks up, repeatedly displays the same data over and over, or infinitely displays the same message box. Example: for (int i = 0; i <= 10; i++) a[i] = 0; on an array of 10 elements runs one time too many (off-by-one), and while (i < n) { sum += a[i]; } never ends because i is not incremented.
6.
★ Final term 20125 marks
What is infeasible path? Give an example.
Show answerJawab dekhein
An infeasible path is a path in the program's flow graph that can never be executed for any input, because the conditions along it contradict each other. Such paths cannot be covered by any test case. Example:
if (x > 5) a = 1;
if (x < 3) b = 2;
The path that takes the true branch of both conditions is infeasible, since x cannot be greater than 5 and less than 3 at the same time.
7.
★ Final term 2012Lecture 435 marks
What are Non-reproducible Bugs? Give an example.
Show answerJawab dekhein
Non-reproducible bugs are bugs that do not appear every time the same steps are repeated; they seem almost random and are the most difficult to deal with. They are often caused by uninitialized variables or pointers, memory overruns, timing/race conditions between threads, or dependence on the environment. Example: a program uses an uninitialized local variable as a loop counter; it works when the memory happens to hold 0 and fails on other runs. Strategy: fill memory with a known pattern, log program state, and find the sequence of events that triggers the bug.
8.
★ Final term Spring 20105 marks
Why and how complex expressions should be written in multiple short statements, Explain it with example
Show answerJawab dekhein
Complex expressions are hard to read, understand and modify, and they hide errors (for example operator precedence or order-of-evaluation problems). They should be broken into several simple statements, using temporary well-named variables and parentheses. Example: instead of
if ((a > b && c < d) || (e == f && !g)) ...
write
bool firstCase = (a > b) && (c < d);
bool secondCase = (e == f) && !g;
if (firstCase || secondCase) ...
Similarly, x = a[i++] + b[i++]; should be split into separate statements so the order of evaluation is clear.
9.
★ Final term Spring 20105 marks
What is the Usefulness of Testing?
Show answerJawab dekhein
Testing executes the software to find errors before the system is delivered. It exposes latent defects, checks that the product meets its specification (verification) and the users' expectations (validation), builds confidence in the quality and reliability of the software, reduces the cost of fixing defects (they are cheaper to fix before installation than in maintenance), and provides information about the quality of the product. Testing can show the presence of errors, not their absence.
10.
★ Final term Spring 20105 marks
What are the static analyzers, give a checklist of the requirements?
Show answerJawab dekhein
Static analyzers are software tools for source text processing. They parse the program text without executing it, try to discover potentially erroneous conditions and bring them to the attention of the verification and validation team. They are very effective as an aid to inspections. Checks (checklist): data faults (variables used before initialization, variables declared but never used, variables assigned twice with no intervening use, possible array bound violations, undeclared variables); control faults (unreachable code, unconditional branches into loops); input/output faults (variables output twice with no intervening assignment); interface faults (parameter type or number mismatches, non-usage of function results, uncalled functions); storage management faults (unassigned pointers, pointer arithmetic).
11.
★ Final term Fall 2004Lecture 2610 marks
What are Design Patterns? Explain them briefly.
Show answerJawab dekhein
A design pattern is a description of communicating objects and classes that are customized to solve a general design problem in a particular context. It names, abstracts and records a proven solution to a recurring design problem, so designers can reuse successful designs and share knowledge about their design instead of solving each problem from scratch. A pattern has four essential elements: the pattern name (a vocabulary for designers), the problem (when to apply it and its context/forces), the solution (the elements, their relationships, responsibilities and collaborations, given as a template rather than concrete code) and the consequences (results and trade-offs). The GoF template describes a pattern by name, intent, motivation, applicability, structure, participants, collaborations, consequences, implementation and known uses. Examples: Observer (when one object changes, all its dependents are notified and updated automatically; used in MVC), Singleton (a class has only one instance with a global point of access) and Façade (one unified interface to a set of interfaces in a subsystem).
12.
★ Final term Fall 200410 marks
Consider the following Code Segment:
Input: sequence of numbers, size, number
Variable: count=0
Do while (end of sequence)
If (sequence[i] == prime Number)
Count = count++
Else
Count = count to
END IF
END DO
If (count == size)
“sequence of number is a prime number sequence”
if (count is odd)
a ← finalMax(sequence)
y ← a X number
else
a ← finalMin(sequence)
y ← a X number
display y
else
“sequence of number is not a prime number sequence”
END IF
END PROGRAM
• Draw the Flow Graph for the Code Segment.
• Find Cyclomatic Complexity of the Flow Graph.
(HINT: for the above code segment, ignore any syntax or grammatical errors.)
Show answerJawab dekhein
Flow graph (nodes): 1 = input and count = 0; 2 = do-while test (end of sequence?); 3 = if sequence[i] is prime; 4 = count++ (true branch); 5 = else branch; 6 = end if, back to node 2; 7 = if (count == size) after the loop exits; 8 = print "prime number sequence" and test if (count is odd); 9 = a = finalMax(sequence), y = a x number; 10 = a = finalMin(sequence), y = a x number; 11 = display y; 12 = print "not a prime number sequence"; 13 = end program. Edges: 1-2, 2-3, 2-7, 3-4, 3-5, 4-6, 5-6, 6-2, 7-8, 7-12, 8-9, 8-10, 9-11, 10-11, 11-13, 12-13 (16 edges, 13 nodes). Cyclomatic complexity V(G) = E - N + 2 = 16 - 13 + 2 = 5. Check: there are 4 predicate nodes (loop condition, prime test, count == size, count is odd), so V(G) = 4 + 1 = 5, and the graph has 5 regions. So 5 independent paths must be tested.
13.
★ Final term Fall 20045 marks
what is Black Box and White Box Testing. Describe briefly.
Show answerJawab dekhein
Black box (functional) testing treats the program as a box whose inside is not seen: test cases are derived only from the specification, by giving inputs and comparing outputs with expected results. It finds missing or incorrect functions, interface errors and behaviour/performance errors; techniques include equivalence partitioning and boundary value analysis. White box (structural, glass box) testing uses knowledge of the internal code: test cases are designed to exercise the program's statements, branches, conditions and independent paths (e.g. basis path testing with cyclomatic complexity), so it uncovers logic errors and unreachable code that black box testing misses.
14.
★ Final term Fall 2004Lecture 3810 marks
Following is the prototype of a function to find the index of the minimum value in an array.
int min(int array[ ], int arraySize);
(a) Identify equivalence partitions to devise black-box test cases for this function. (5 Pts)
(b) Write test cases against each partition identified in part (a). (5 Pts)
Show answerJawab dekhein
(a) Partitions on arraySize: valid arraySize >= 1 that matches the number of elements; invalid arraySize = 0 (empty array); invalid arraySize < 0. Partitions on the array contents (for a valid size): array with a single element; minimum is the first element; minimum is the last element; minimum is in the middle; minimum value occurs more than once; array containing negative values; all elements equal. (b) Test cases: {5}, size 1 -> index 0; {3, 7, 9}, size 3 -> 0; {9, 7, 3}, size 3 -> 2; {9, 2, 7}, size 3 -> 1; {4, 1, 6, 1}, size 4 -> 1 (first occurrence, as specified); {-2, -8, 5}, size 3 -> 1; {6, 6, 6}, size 3 -> 0; any array with size 0 -> error/invalid value returned; any array with size -3 -> error/invalid value returned.
15.
★ Final term Fall 2004Lecture 436 marks
What are Boolean Bugs? Describe briefly.What are symptoms of Boolean Bugs?
Show answerJawab dekhein
Boolean bugs are errors in Boolean (true/false) logic: wrong relational or logical operators, wrong precedence, negated or inverted conditions, mixing = with ==, or mixing & and && (bitwise vs logical). They occur because Boolean expressions are easy to get wrong, and they cause the program to take the wrong branch. Symptoms: when the program does exactly the opposite of what it should (the result is the opposite of what was expected), or when a condition is always true or always false so some code never runs. Example: if (x = 5) instead of if (x == 5) is always true.
16.
★ Final term Fall 2004Lecture 2210 marks
What is Software Architecture? What is its importance? Describe briefly.
Show answerJawab dekhein
Software architecture is the high-level structure of a software system: the system decomposed into components (architectural elements: processing, data and connecting elements), the externally visible properties of those components and the relationships/interactions between them, organized according to an architectural style. It is the result of the architectural design process, which identifies the subsystems and the framework for their control and communication. Importance: it is a vehicle for communication among stakeholders (a shared, high-level view of the system); it captures early design decisions that strongly affect performance, robustness, security, maintainability and distributability, so it allows analysis of whether the system can meet its non-functional requirements before it is built; it guides the division of work and development, since teams can build subsystems against defined interfaces; it supports large-scale reuse, because a good architecture can be reused across systems with similar requirements; and it helps manage complexity and change over the system's life.
17.
★ Final term Spring 2006Lecture 3815 marks
Following is the prototype of a function to find the square root of a number.
double sqrt (int num);
a) Identify equivalence partitions to devise black-box test cases for this function. (10 Pts)
b) Write test cases against each partition identified in part (a). (5 Pts)
Show answerJawab dekhein
(a) Partitions for num: valid - positive integers that are perfect squares; valid - positive integers that are not perfect squares; valid boundary - zero; valid boundary - one; valid boundary - the largest int value; invalid - negative integers (no real square root); invalid - non-integer input (e.g. a real number or character), which the int parameter does not accept. (b) Test cases: num = 16 -> 4.0; num = 2 -> about 1.414; num = 0 -> 0.0; num = 1 -> 1.0; num = INT_MAX -> its square root (about 46340.95 for 32-bit int); num = -4 -> error indication/exception; num = 4.5 or 'a' -> rejected (compile-time type error or input validation error).
18.
★ Final term Spring 2006
Draw the corresponding object model diagram for the following system description.
(Note: Use the UML Object Model Notation)
“An online banking system allows customers to manage their account. Each account has a balance. Customers can deposit to or withdraw from their account. Each deposit or withdrawal is called a transaction. A transaction always has a value and a date. At any time a customer can see a statement, which is a listing of each transaction.”
Show answerJawab dekhein
Classes: Customer; Account (attribute: balance; operations: deposit(), withdraw()); Transaction (attributes: value, date); Deposit and Withdrawal as subclasses of Transaction (generalization-specialization); Statement (operation: show/list transactions). Relationships: Customer 1 -- 1..* Account (a customer manages his account(s)); Account 1 -- 0..* Transaction (an account records its deposits and withdrawals); Customer 1 -- 0..* Statement (a customer views statements) and Statement 1 -- 0..* Transaction (a statement lists the transactions; aggregation); Deposit and Withdrawal inherit from Transaction (UML hollow-triangle arrow to Transaction).
19.
★ Final term Spring 2010Lecture 345 marks
List five guidelines that can help you in writing portable code.
Show answerJawab dekhein
1) Stick to the standard: use ANSI/ISO standard C++ and the STL instead of vendor-specific extensions.
2) Program in the mainstream: e.g. always write function prototypes such as double sqrt(double);.
3) Do not assume sizes of data types: e.g. j = 20000; k = 30000; i = j + k; overflows when int is 2 bytes.
4) Do not depend on order of evaluation of operands and side effects, which differs between compilers.
5) Do not assume the signedness of char: store getchar() results in an int before comparing with EOF.
Others: do not depend on arithmetic vs logical right shift, byte order, or bit-field layout.
20.
★ Final term Spring 2010Lecture 405 marks
Below is the chunk of code :
result = squareRoot(argument);
assert (abs (result * result - argument) < epsilon);
Write the Contract for square root routine keeping in view unit testing.
Show answerJawab dekhein
Contract: the routine accepts an argument >= 0 and returns a result such that abs(result*result - argument) < epsilon.
Unit tests based on it: 1) pass a negative argument and check that it is rejected; 2) pass zero and check it is accepted (boundary value); 3) pass values between zero and the largest allowed argument and check that the difference between the square of the result and the argument is less than epsilon.
21.
★ Final term Spring 20105 marks
Parentheses should always be used as they reduce complexity. Explain it with the help of a single example.
Show answerJawab dekhein
Parentheses make grouping explicit, so the reader and programmer do not depend on remembered precedence rules, which cause hard-to-find logic errors when unrelated operators are mixed.
Example: if (x & MASK == BITS) is evaluated as x & (MASK == BITS) because == has higher precedence than &, so MASK is compared with BITS first and the 0/1 result is ANDed with x. Writing if ((x & MASK) == BITS) states the intended meaning without ambiguity.
22.
★ Final term Spring 2010Lecture 295 marks
Narrate the manner for the organization of Class and Interface declarations
Show answerJawab dekhein
In this order: 1) class/interface documentation; 2) the class or interface statement; 3) class (static) variables in the order public, protected, package (no modifier), private; 4) instance variables in the same order; 5) constructors; 6) methods (in no specific order).
23.
★ Final term Spring 2010Lecture 435 marks
Discuss the symptoms and an example of coding error bug class.
Show answerJawab dekhein
A coding error is a simple mistake in writing code, such as not checking error returns, not checking valid conditions, ignoring other parts of the system, wrong parameter passing or wrong return-type coercion.
Symptoms: unexpected errors in black box testing, and compiler warnings; they usually come from lack of attention to detail.
Example:
void convertToString(int InInteger, char* OutString, int* OutLength)
{
switch(InInteger){
case 1: OutString = "One"; OutLength = 3; break;
...
case 9: OutString = "Nine"; OutLength = 4; break;
}
}
It does not handle inputs such as 0 or values above 9, it never initialises the outputs, and it assigns to the pointer parameters instead of through them (*OutLength), so the caller gets garbage.
24.
★ Final term Spring 2010Lecture 345 marks
Why Code portability is so important? Give out 3 ways / Guide lines to improve the code portability with examples (5+5)
Show answerJawab dekhein
Many applications must run on several platforms. If code is written without portability in mind, porting needs major rework, which is costly and error-prone; careful coding lets it be moved with little effort.
Guidelines: 1) Stick to the standard: use ANSI/ISO C++ and the STL, not vendor extensions. 2) Program in the mainstream: always write prototypes, e.g. double sqrt(double); rather than double sqrt();. 3) Do not assume data type sizes: j = 20000; k = 30000; i = j + k; overflows if int is 2 bytes. Also: do not rely on order of evaluation, and do not assume char is signed (use int c = getchar(); if (c == EOF)).
25.
★ Final term Spring 2010
write a note on Usefulness of testing
Show answerJawab dekhein
Testing executes the software on test data and compares results with documented requirements. Its purpose is to find and fix as many defects as possible before the software is delivered and the client runs acceptance tests. Without testing, the client may demand free fixes, cancel the contract or even sue; a few defective deliveries can end the business relationship. Testing cannot prove there are no defects, but it raises confidence in the product.
26.
★ Final term Spring 2010Lecture 42
Good clues, Easy Bugs explain this term.
Show answerJawab dekhein
Some bugs leave good clues and are easy to find. The best clue is a stack trace: source line numbers in it are the most useful debugging information; then the values of arguments (improbable values such as zero, very large, negative, or strange strings); and a debugger can show local and global variable values to show what went wrong.
27.
★ Final term Spring 20095 marks
Discuss any five the General naming conventions for an object oriented language
Show answerJawab dekhein
1) Type names are nouns in mixed case starting with upper case: Line, FilePrefix.
2) Variable names are mixed case starting with lower case: line, filePrefix.
3) Constants are all upper case with underscores: MAX_ITERATIONS, COLOR_RED.
4) Method and function names are verbs in mixed case starting with lower case: getName(), computeTotalWidth().
5) C++ template types are a single upper-case letter: template<class T>.
Others: refer to C++ globals with ::, give private class variables a _ suffix (length_), do not upper-case abbreviations (exportHtmlSource()), name generic variables after their type (setTopic(Topic topic)), write names in English, and do not repeat the object name in a method name (line.getLength()).
28.
★ Final term Spring 20095 marks
What are the Software testing objective? Also define a successful test.
Show answerJawab dekhein
Objective: testing tries to refute, not verify, the software: its goal is to expose latent defects before the system is used. A tester tries to break the system; testing shows the presence of defects, never their absence, because exhaustive testing is impossible. It only increases confidence in the software.
Successful test: a test is successful if it discovers an error (Myers: if you look for problems you find more of them). Success is measured by the ability to find bugs, not to show there are none.
29.
★ Final term Spring 2009Lecture 3810 marks
What should be the sets of inputs that should be used to test the system effectively and efficiently? Give an example.
Show answerJawab dekhein
Since exhaustive testing is impossible, the input domain is divided into equivalence classes: sets of inputs the system is expected to treat the same way, so that if one test in a class finds a defect the others probably would too. One representative input is chosen from each valid and each invalid class, plus values on the boundaries of each class.
Example: for a function that accepts a month number 1-12, classes are: valid 1-12 (test 6), invalid below 1 (test 0 or -5), invalid above 12 (test 13); boundary tests 1 and 12. For a list function, classes include an empty list, a list with one element and a list with many elements.
30.
★ Final term Spring 2009Lecture 4210 marks
Discuss Art and Science of Debugging.
Show answerJawab dekhein
Debugging looks like an art but is really a scientific process. With experience of defect types, programmers build heuristics and reuse them to find similar bugs faster. The process is: reproduce the failure, gather clues (stack traces, variable values, first-hand accounts), form a hypothesis about the cause, test it, then fix and retest. A key difficulty is 'you miss the obvious': authors have a bias towards their own code and overlook simple mistakes, so after applying their own heuristics they should get 'another pair of eyes' (a colleague) to review the code.
31.
★ Final term Feb 2005Lecture 436 marks
What are Loop Errors? Describe briefly. What are symptoms of Loop Errors?
Show answerJawab dekhein
Loop errors occur around loop constructs; the subtypes are infinite loops, off-by-one loops and improperly exited loops.
Symptoms: the program locks up or repeatedly shows the same data or message box (infinite loop); a calculated total is wrong by the last data point, or the last points of a graph are not connected (off-by-one); a process ends unexpectedly when it should have continued (improper exit).
32.
★ Final term Aug 2004Lecture 436 marks
What are the symptoms of pointer errors?
Show answerJawab dekhein
Pointer errors are uses of uninitialised pointers, pointers to deleted memory that are still used, and invalid pointers that point to valid memory not holding the expected data.
Symptoms: the program crashes or behaves unpredictably; stack corruption, memory allocation failures and variables that change oddly; changing one line moves the place where the problem appears; the problem disappears when a print statement or new variable is added.
33.
★ Final term Spring 2011Lecture 435 marks
Describe Loop Errors and symptoms?
Show answerJawab dekhein
Loop errors occur around loop constructs; the subtypes are infinite loops, off-by-one loops and improperly exited loops.
Symptoms: the program locks up or repeatedly shows the same data or message box (infinite loop); a calculated total is wrong by the last data point, or the last points of a graph are not connected (off-by-one); a process ends unexpectedly when it should have continued (improper exit).
34.
★ Final term Spring 20115 marks
Write Note on Partitioning?
Show answerJawab dekhein
Architectural partitioning distributes responsibilities among subsystems so the system has fewer side effects and is easier to test, extend and maintain.
Horizontal partitioning: separate branches of the module hierarchy for each major function, with control modules coordinating communication between them.
Vertical partitioning (factoring): the architecture is layered by decision making, with decision-making (control) modules at the top and worker modules at the bottom.
35.
★ Final term Spring 20115 marks
Tools and Methods used in software engineering
Show answerJawab dekhein
Methods give the technical 'how-to' for software tasks such as requirements analysis, design, coding, testing and maintenance; more than one method may exist for a task and different ones suit different situations.
Tools give automated or semi-automated support for the process and the methods, e.g. CASE tools, compilers, debuggers, version control and testing tools.
Together with the process and the quality focus, methods and tools form the layers of software engineering.
36.
★ Final term Spring 20115 marks
Five guidelines using for Code
Show answerJawab dekhein
1) Type names are nouns in mixed case starting with upper case: Line, FilePrefix.
2) Variable names are mixed case starting with lower case: line, filePrefix.
3) Constants are all upper case with underscores: MAX_ITERATIONS, COLOR_RED.
4) Method and function names are verbs in mixed case starting with lower case: getName(), computeTotalWidth().
5) C++ template types are a single upper-case letter: template<class T>.
Others: refer to C++ globals with ::, give private class variables a _ suffix (length_), do not upper-case abbreviations (exportHtmlSource()), name generic variables after their type (setTopic(Topic topic)), write names in English, and do not repeat the object name in a method name (line.getLength()).
37.
★ Final term Spring 2011
Discuss five points, how a "variable" is efficiently used in a program?
Show answerJawab dekhein
1) Initialise variables where they are declared and declare them in the smallest possible scope.
2) Use each variable for one purpose only; never give one variable two meanings.
3) Avoid global variables; make class variables private and give access through methods.
4) Give variables meaningful names (large scope: longer names; scratch/loop variables: short names like i, j).
5) Avoid implicit tests against 0, e.g. write if (nLines != 0) rather than if (nLines); keep loop variables out of other uses and declare related variables in separate statements.
38.
★ Final term Spring 2011
You have learnt about Static analyzers, What are static analyzers? Give a checklist for static analysis.
Show answerJawab dekhein
Static analyzers are tools that parse the program source text without running it and report potentially erroneous conditions to the V&V team.
Checklist of checks: data faults (variables used before initialisation, declared but unused, assigned twice without use, array bound violations, undeclared variables); control faults (unreachable code, unconditional branches into loops); input/output faults (variables output twice with no intervening assignment); interface faults (parameter type or number mismatches, unused function results, uncalled functions); storage management faults (unassigned pointers, pointer arithmetic).
39.
★ Final term Feb 2005Lecture 3915 marks
Consider the following code:
if ((a+b > c) && (a+b > b) && (b+c > a)) {
if ((a==b) && (a==c)) type = 1;
if ((a!=b) && (a != c) && (b != c)) type = 2;
if (((a==b) && (a !=c)) || ((a==c) && (a!=b)) || ((b==c) && (a!=c)))
type = 3;
}
else
type = 0;
(a) Draw the flow graph for this code segment. (5 Pts)
(b) Calculate the Cyclomatic Complexity for this code. (2 Pts)
(c) Identify one infeasible path if any. (1 Pts)
(d) Identify all feasible paths. (2 Pts)
(e) Write white-box test cases for all the feasible paths (5 Pts)
Show answerJawab dekhein
(a) Nodes (treating each if as one decision): 1 = outer if; 2 = type = 0 (else); 3 = if1; 4 = type = 1; 5 = if2; 6 = type = 2; 7 = if3; 8 = type = 3; 9 = end. Edges: 1-3 (T), 1-2 (F), 3-4 (T), 3-5 (F), 4-5, 5-6 (T), 5-7 (F), 6-7, 7-8 (T), 7-9 (F), 8-9, 2-9.
(b) 4 decision nodes, so V(G) = 4 + 1 = 5 (also E - N + 2 = 12 - 9 + 2 = 5). If every simple condition is counted as its own decision the value is higher.
(c) Infeasible: 1-3-4-5-6-7-9 (both if1 and if2 true: all sides equal and all sides different at once). Also 1-3-5-7-9 (valid triangle that matches none of the three types) is infeasible.
(d) Feasible paths: P1 1-2-9 (not a triangle); P2 1-3-4-5-7-9 (equilateral); P3 1-3-5-6-7-9 (scalene); P4 1-3-5-7-8-9 (isosceles).
(e) P1: a=1, b=2, c=5 -> type = 0. P2: a=3, b=3, c=3 -> type = 1. P3: a=3, b=4, c=5 -> type = 2. P4: a=3, b=3, c=4 -> type = 3.
40.
★ Final term Feb 20059 marks
Give brief answers to the following:
1. How do Software characteristics differ from Hardware characteristics? (3 Pts)
2. Describe the general process of creating a Data Flow Diagram (DFD). (3 Pts)
3. What are the attributes of a good Software Test? (3 Pts)
Show answerJawab dekhein
1) Software is developed or engineered, not manufactured; its cost is in engineering, not production. Software does not wear out: hardware follows a bathtub failure curve, while software failures come from design defects and from side effects of changes. Most software is custom built, while hardware is assembled from standard components.
2) Identify the external entities (sources and sinks) and the main inputs and outputs; draw a context (level 0) diagram with one process; then decompose it into lower-level DFDs showing processes, data stores and data flows, keeping inputs and outputs balanced between levels and naming every process and flow, until each process is simple enough to specify.
3) A good test has a high probability of finding an error; it is not redundant; it is the 'best of breed' (the test most likely to find errors among similar ones); and it is neither too simple nor too complex.
41.
★ Final term Feb 2005Lecture 2410 marks
Write a short note on Repository Model Architectural Configuration.
Show answerJawab dekhein
In the repository (data-centred) model, subsystems share data through a central repository (database). Subsystems do not talk to each other directly; they read and write the shared data. Advantages: it is an efficient way to share large amounts of data; subsystems need not know how data is produced; centralised management of backup, security and access control; the shared data model is easy to publish and new tools can be added easily. Disadvantages: all subsystems must agree on one data model, which is a compromise; evolving the data model is hard and costly; the same policies are forced on all subsystems; and it is hard to distribute efficiently. It suits systems such as CASE toolsets and management information systems.
42.
★ Final term Feb 2005Lecture 3810 marks
Following is the prototype of a function to find the index of the key value in an array. It returns -1 if the key is not found.
int search(int array[ ], int arraySize, int key);
(a) Identify equivalence partitions to devise black-box test cases for this function. (5 Pts)
(b) Write test cases against each partition identified in part (a). (5 Pts)
Show answerJawab dekhein
(a) Partitions: arraySize invalid (negative); empty array (arraySize = 0); one-element array with key present / key absent; many-element array with key at the first position, at the last position, in the middle, key absent; key appearing more than once.
(b) Test cases: {array=[], size=-1, key=3} -> error/-1; {[], 0, 3} -> -1; {[5], 1, 5} -> 0; {[5], 1, 3} -> -1; {[4,7,9,2], 4, 4} -> 0; {[4,7,9,2], 4, 2} -> 3; {[4,7,9,2], 4, 9} -> 2; {[4,7,9,2], 4, 8} -> -1; {[4,7,4,2], 4, 4} -> 0 (first match, as specified). Values at the boundaries of the int range can also be used as keys.
43.
★ Final term Feb 2005Lecture 2710 marks
Write a short note on Observer Pattern.
Show answerJawab dekhein
Observer defines a one-to-many dependency between objects so that when one object (the subject) changes state, all its dependents (observers) are notified and updated automatically. The subject keeps a list of observers and provides attach/detach operations and a notify operation; each observer implements an update interface and, when notified, queries the subject for its new state. Subject and observers are loosely coupled: the subject knows only the observer interface, observers can be added or removed at run time, and changes are broadcast. It is used in Smalltalk's Model-View-Controller, where views observe the model. A drawback is that unexpected or cascading updates can be costly.
44.
★ Final term Fall 2006Lecture 3815 marks
Following is the prototype of a function to find the cube root of a number.
double function(int a);
a) Identify equivalence partitions to devise black-box test cases for this function.
b) Write test cases against each partition identified in part (a).
Show answerJawab dekhein
(a) Valid partitions (a cube root exists for every integer): positive integers; zero; negative integers; perfect cubes vs non-perfect cubes; boundary values at the largest and smallest int. Invalid partitions: non-integer inputs (e.g. 2.5, characters) that the int parameter does not accept.
(b) Test cases: a = 27 -> 3.0; a = 10 -> about 2.154; a = 0 -> 0.0; a = 1 -> 1.0; a = -8 -> -2.0; a = -10 -> about -2.154; a = INT_MAX -> about 1290.16 (32-bit int); a = INT_MIN -> about -1290.16; a = 2.5 or 'x' -> rejected or converted by the compiler, check behaviour. For each valid case check that result*result*result is within epsilon of a.
45.
★ Final term Fall 2006Lecture 4315 marks
Following are given Symptoms of different Bugs. Identify them:
1.
- System slowdowns
- Crashes that occur "randomly" over a long period of time
2.
- Results are the opposite of what is expected.
- Output looks strange, but has no obvious symptoms of corruption
3.
- Unexpected errors in black box testing.
- The errors that unexpectedly occur are usually caused by coding errors.
Draw a Business Process Diagram according to the following Processes:
1. A patient may come to visit In Patient Department (IPD) or out patient department (OPD)
2. System determines if he is a company patient or a private patient.
3. For a company patient, system verifies him.
4. For an OPD patient, system will issue a chit to the patient and inform him about his number and the consultant to whom he has to consult and he will have to wait for his turn.
5. After verifying an IPD patient, system will create a visit and allocate him a room or a bed etc. If system cannot allocate this, then it will inform the patient. Otherwise the patient is checked in and his information is maintained in the system.
6. System displays information about the expenses of the required service to the patient so that he is informed of his expected expenditure.
7. Some advance payment is also received against the required service and this amount is adjusted in the final settlement.
8. All this information is supplied to cash office that eventually deals with payments, etc.
9. Upon receiving the cash, for OPD patient, a chit will be issued. For IPD patient, an admission form will be filled and this information will be maintained in the system. A receipt will be issued to the patient.
10. For credit transaction, corresponding voucher will be prepared.
11. So the model depicts process before the start of the treatment.
12. A patient may ask to change his service on event of an unsatisfied response from the hospital staff or any other reason. System may cancel his record and pay his amount back.
13. Similarly, a doctor may ask a patient to change his status from OPD to IPD.
Show answerJawab dekhein
Diagram description (swimlanes Patient, Reception system, Cash office; start event 'patient arrives'):
1) Gateway: OPD or IPD visit. 2) Gateway: company or private patient; company patient -> 'verify company patient'.
3) OPD branch: 'issue chit with number and consultant' -> 'patient waits for turn'.
4) IPD branch: 'create visit' -> 'allocate room/bed'; gateway: allocated? No -> 'inform patient' -> end; Yes -> 'check in patient and store information'.
5) Both branches -> 'display expected expenses' -> 'receive advance payment' -> 'send information to cash office'.
6) Cash office: gateway cash or credit; credit -> 'prepare voucher'; cash -> OPD: 'issue chit', IPD: 'fill admission form and store it'; then 'issue receipt' -> end event 'ready for treatment'.
7) Exception/alternative flows: 'patient requests change of service' -> 'cancel record and refund amount'; 'doctor changes status OPD to IPD' -> loops back to the IPD branch.
47.
★ Final term Fall 2006Lecture 3920 marks
Consider the following code:
sorted = false;
while (!sorted) {
//1
sorted = true;
for (i=0; i < N-1; i++) { //2
if a[i] > a[i+1] {
swap(a[i], a[i+1]); //3
sorted = false;
}
//4
}
//5
}
//6
a) Draw the flow graph for this code segment. [10]
b) Calculate the cyclomatic complexity for this code [5]
c) Identify one infeasible path if any. [5]
Show answerJawab dekhein
(a) Nodes: 1 = while (!sorted) test; 2 = sorted = true; i = 0; for test i < N-1; 3 = if a[i] > a[i+1]; 4 = swap, sorted = false; 5 = i++ (end of for body); 6 = exit. Edges: 1-2 (while true), 1-6 (while false), 2-3 (for true), 2-1 (for false, back to while), 3-4 (if true), 3-5 (if false), 4-5, 5-2 (back to for test).
(b) Three decisions (while, for, if), so V(G) = 3 + 1 = 4 (E - N + 2 = 8 - 6 + 2 = 4).
(c) Infeasible: 1-6 on the first test (skipping the loop), since sorted is initialised to false so the loop body always runs at least once. Also any path that performs a swap (3-4) in a pass and then exits the while loop at the end of that same pass is infeasible, because the swap sets sorted = false.
48.
★ Final term Fall 2006Lecture 1310 marks
Write Some of the key advantages which make the object-oriented technology significantly attractive than other technologies? Discuss the difference between Object oriented and Function Oriented approach also elaborate the difference using diagram.
Show answerJawab dekhein
Advantages: easier modelling of real-world entities, reuse of classes and components, easier maintenance and extension because changes stay local (encapsulation), information hiding, and natural support for iterative development.
Difference: in the function-oriented approach the system is decomposed into functions that share global data/state; data and functions are separate, so a change in data can affect many functions. In the object-oriented approach the system is a set of interacting objects, each encapsulating its own data and the operations on it; objects communicate by messages, so state is decentralised and changes are localised.
Diagram description: function-oriented = several functions (F1, F2, F3) all connected to one shared data store; object-oriented = several objects, each a box holding its own data and operations, linked by message arrows.
49.
★ Final term Aug 200410 marks
Write a short note on Facade pattern.
Show answerJawab dekhein
Facade is a structural design pattern that provides one unified, simpler interface to a set of interfaces in a subsystem. Clients talk to the facade object, which delegates requests to the right subsystem classes. It hides subsystem complexity, reduces the number of objects clients deal with, weakens coupling between clients and the subsystem (so the subsystem can change without changing clients) and supports layering, while still letting advanced clients use subsystem classes directly if needed. Example: a compiler facade with a compile() operation that hides the scanner, parser and code generator.
50.
★ Final term Aug 20049 marks
Give brief answers to the following:
1. How does software differ from the artifacts produced by other engineering disciplines? (3 Pts)
2. What is meant by the term software reliability? (3 Pts)
3. Describe the principle of information hiding as it applies to software design. (3 Pts)
Show answerJawab dekhein
1) Software is intangible and logical rather than physical; it is developed (engineered) rather than manufactured, so cost lies in development not production; it does not wear out, but deteriorates through changes; it is easy to change, which makes it complex and hard to control; and most of it is custom built.
2) Software reliability is the probability that the software operates without failure in a specified environment for a specified time; it reflects how dependably the system delivers its services.
3) Information hiding means each module hides its internal design decisions (data structures, algorithms) from other modules and exposes only a well-defined interface. Other modules use only that interface, so internal changes do not spread, which reduces coupling and side effects and makes testing and maintenance easier.
51.
★ Final term Aug 2004Lecture 3915 marks
Consider the following code:
if ((a >= b) && (a >= c)) max = a;
if ((b >= a) && (b >= c)) max = b;
if ((c >= a) && (c >= b)) max = c;
(a) Draw the flow graph for this code segment. (5 Pts)
(b) Calculate the cyclomatic complexity for this code (2 Pts)
(c) Identify one infeasible path if any. (1 Pts)
(d) Identify all feasible paths (2 Pts)
(e) Write white-box test cases for all the feasible paths (5 Pts)
Show answerJawab dekhein
(a) Nodes: 1 = if1; 2 = max = a; 3 = if2; 4 = max = b; 5 = if3; 6 = max = c; 7 = end. Edges: 1-2 (T), 1-3 (F), 2-3, 3-4 (T), 3-5 (F), 4-5, 5-6 (T), 5-7 (F), 6-7.
(b) Three decisions, so V(G) = 3 + 1 = 4 (E - N + 2 = 9 - 7 + 2 = 4).
(c) Infeasible: F F F (1-3-5-7), because one of a, b, c is always the largest, so at least one condition is true.
(d) Feasible (if1, if2, if3): TFF, FTF, FFT, TTF, TFT, FTT, TTT.
(e) TFF: a=3,b=2,c=1 -> max=3; FTF: a=1,b=3,c=2 -> 3; FFT: a=1,b=2,c=3 -> 3; TTF: a=3,b=3,c=1 -> 3; TFT: a=3,b=1,c=3 -> 3; FTT: a=1,b=3,c=3 -> 3; TTT: a=2,b=2,c=2 -> 2.
52.
★ Final term Aug 2004Lecture 2510 marks
Write a short note on zero-install client-server configuration.
Show answerJawab dekhein
Zero install is a web-based client-server configuration in which nothing is installed on the client except a standard web browser. The application is downloaded from the web server when needed, so there is no per-client installation or upgrade: new versions are deployed once on the server. It combines the easy deployment of thin clients with richer client processing, lowers maintenance cost, and lets users work from any machine with a browser. Its drawbacks are dependence on the network and the browser's capabilities and possible performance limits.
53.
★ Final term Spring 200510 marks
What is meant by Maintainable Code? Describe it briefly.
Show answerJawab dekhein
Maintainable code is code that other programmers can easily read, understand, correct and change without introducing new defects. It is achieved by clear layout and consistent coding style, meaningful names and self-documenting code, useful comments, modular design with small, cohesive, loosely coupled functions, information hiding, avoiding side effects and tricky constructs, using named constants instead of magic numbers, and handling errors consistently. Since most software cost is spent on maintenance, maintainability is one of the most important qualities.
54.
★ Final term Spring 20055 marks
Explain how effective modular design is achieved through functional independence of the individual modules?
Show answerJawab dekhein
Functional independence means each module does one well-defined job and has little interaction with other modules. It is measured by cohesion (how strongly a module's parts relate to one task, which should be high) and coupling (how much modules depend on each other, which should be low). Independent modules have simple interfaces, are easier to develop separately, test and maintain, and limit error propagation and side effects, so changes stay local and modules can be reused.
55.
★ Final term Spring 2005Lecture 435 marks
What are the symptoms of Boolean Bugs?
Show answerJawab dekhein
Boolean bugs come from the gap between precise Boolean logic and everyday English: people say 'and' when they mean the Boolean 'or' and vice versa, or return true/false with the wrong meaning.
Symptoms: the program does exactly the opposite of what is expected (e.g. it will not continue until more than one item is selected while telling you to select only one); for true/false problems, debug output reports an error in a function but the caller continues as if nothing happened.
56.
★ Final term Spring 2005Lecture 3815 marks
Following is the prototype of a function to find the square root of a number.
double sqrt (int num);
(a) Identify equivalence partitions to devise black-box test cases for this function. [10 marks]
(b) Write test cases against each partition identified in part (a). [5 marks]
Show answerJawab dekhein
(a) Valid partitions: zero (boundary); positive perfect squares; positive non-perfect squares; the largest int. Invalid partitions: negative integers (no real square root, must be rejected); non-integer input (e.g. 2.5, characters) that does not match the int parameter.
(b) Test cases: num = 0 -> 0.0; num = 1 -> 1.0; num = 16 -> 4.0; num = 2 -> about 1.414 (check result*result within epsilon of 2); num = INT_MAX -> about 46340.95 (32-bit int); num = -1 and num = -16 -> rejected with an error; num = 2.5 or 'a' -> rejected or converted, check behaviour.
57.
★ Final term Spring 200510 marks
Draw the corresponding object model diagram for the following system description.
(Note: Use the UML Object Model Notation)
"A bank account is either, a current account, a deposit account, or a mortgage account. All bank accounts can be opened and closed and all bank accounts have a balance. Deposit accounts pay interest. For current accounts it is possible to set up an overdraft facility. All mortgage accounts have a 'term' (the number of years the mortgage runs). A bank customer (who is characterized by name and address) can have one or more accounts."
Show answerJawab dekhein
Classes: Customer {name, address}; BankAccount {balance; open(), close()}; subclasses of BankAccount via generalization (hollow triangle to BankAccount): CurrentAccount {setUpOverdraft()}, DepositAccount {payInterest()}, MortgageAccount {term}. BankAccount can be shown as abstract since every account is one of the three kinds.
Association Customer 'has' BankAccount with multiplicity 1 on the Customer end and 1..* on the BankAccount end.