Tuesday, September 30, 2014

Software Testing Basics

1. Can you explain the PDCA cycle and where testing fits in?
Software testing is an important part of the software development process. In normal software development there are four important steps, also referred to, in short, as the PDCA (Plan, Do, Check, Act) cycle.
Software Testing Image
Let's review the four steps in detail.
  1. Plan: Define the goal and the plan for achieving that goal.
  2. Do/Execute: Depending on the plan strategy decided during the plan stage we do execution accordingly in this phase.
  3. Check: Check/Test to ensure that we are moving according to plan and are getting the desired results.
  4. Act: During the check cycle, if any issues are there, then we take appropriate action accordingly and revise our plan again.

So developers and other stakeholders of the project do the "planning and building," while testers do the check part of the cycle. Therefore, software testing is done in check part of the PDCA cyle.

Monday, September 29, 2014

Constructors and Destructors - C++

1. 
A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.
A.constructorB.destructor
C.functionD.object
2. 
A union that has no constructor can be initialized with another union of __________ type.
A.differentB.same
C.virtualD.class
3. 
Which of the following gets called when an object goes out of scope?
A.constructor
B.destructor
C.main
D.virtual function
4. 
Which of the following statement is correct?
A.Destructor destroys only integer data members of the object.
B.Destructor destroys only float data members of the object.
C.Destructor destroys only pointer data members of the object.
D.Destructor destroys the complete object.
5. 
__________ used to make a copy of one class object from another class object of the same class type.
A.constructor
B.copy constructor
C.destructor
D.default constructor

Sunday, September 28, 2014

Constructors and Destructors - C++

1. 
Which constructor function is designed to copy objects of the same class type?
A.Create constructor
B.Object constructor
C.Dynamic constructor
D.Copy constructor
2. 
Which of the following statement is correct?
A.Constructor has the same name as that of the class.
B.Destructor has the same name as that of the class with a tilde symbol at the beginning.
C.Both A and B.
D.Destructor has the same name as the first member function of the class.
3. 
Which of the following statement is incorrect?
A.Constructor is a member function of the class.
B.The compiler always provides a zero argument constructor.
C.It is necessary that a constructor in a class should always be public.
D.Both B and C.
4. 
When are the Global objects destroyed?
A.When the control comes out of the block in which they are being used.
B.When the program terminates.
C.When the control comes out of the function in which they are being used.
D.As soon as local objects die.
5. 
Copy constructor must receive its arguments by __________ .
A.either pass-by-value or pass-by-reference
B.only pass-by-value
C.only pass-by-reference
D.only pass by address

Saturday, September 27, 2014

Constructors and Destructors - C++

1. 
A constructor that accepts __________ parameters is called the default constructor.
A.oneB.two
C.noD.three
2. 
What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?
A.Compile-time error.
B.Preprocessing error.
C.Runtime error.
D.Runtime exception.
3. 
Can a class have virtual destructor?
A.YesB.No
4. 
Destructor has the same name as the constructor and it is preceded by ______ .
A.!B.?
C.~D.$
5. 
For automatic objects, constructors and destructors are called each time the objects
A.enter and leave scope
B.inherit parent class
C.are constructed
D.are destroyed

Friday, September 26, 2014

Objects and Classes - C++

1. 
Which of the following can access private data members or member functions of a class?
A.Any function in the program.
B.All global functions in the program.
C.Any member function of that class.
D.Only public member functions of that class.
2. 
Which of the following type of data member can be shared by all instances of its class?
A.PublicB.Inherited
C.StaticD.Friend
3. 
Which of the following also known as an instance of a class?
A.Friend Functions
B.Object
C.Member Functions
D.Member Variables
4. 
Constructor is executed when _____.
A.an object is created
B.an object is used
C.a class is declared
D.an object goes out of scope.
5. 
Which of the following statements about virtual base classes is correct?
A.It is used to provide multiple inheritance.
B.It is used to avoid multiple copies of base class in derived class.
C.It is used to allow multiple copies of base class in a derived class.
D.It allows private members of the base class to be inherited in the derived class.

Thursday, September 25, 2014

Objects and Classes - C++

1. 
Which of the following statements is correct when a class is inherited publicly?
A.Public members of the base class become protected members of derived class.
B.Public members of the base class become private members of derived class.
C.Private members of the base class become protected members of derived class.
D.Public members of the base class become public members of derived class.
2. 
Which of the following statements is correct about the constructors and destructors?
A.Destructors can take arguments but constructors cannot.
B.Constructors can take arguments but destructors cannot.
C.Destructors can be overloaded but constructors cannot be overloaded.
D.Constructors and destructors can both return a value.
3. 
Which of the following access specifies is used in a class definition by default?
A.ProtectedB.Public
C.PrivateD.Friend
4. 
Which of the following statement is correct with respect to the use of friend keyword inside a class?
A.A private data member can be declared as a friend.
B.A class may be declared as a friend.
C.An object may be declared as a friend.
D.We can use friend keyword as a class name.
5. 
Which of the following keywords is used to control access to a class member?
A.DefaultB.Break
C.ProtectedD.Asm

Wednesday, September 24, 2014

Objects and Classes - C++

1. 
What happens when we try to compile the class definition in following code snippet?
class Birds {};
class Peacock : protected Birds {};
A.It will not compile because class body of Birds is not defined.
B.It will not compile because class body of Eagle is not defined.
C.It will not compile because a class cannot be protectedly inherited from other class.
D.It will compile succesfully.
2. 
Which of the following statements is incorrect?
A.Friend keyword can be used in the class to allow access to another class.
B.Friend keyword can be used for a function in the public section of a class.
C.Friend keyword can be used for a function in the private section of a class.
D.Friend keyword can be used on main().
3. 
Which of the following statement is correct regarding destructor of base class?
A.Destructor of base class should always be static.
B.Destructor of base class should always be virtual.
C.Destructor of base class should not be virtual.
D.Destructor of base class should always be private.
4. 
Which of the following two entities (reading from Left to Right) can be connected by the dot operator?
A.A class member and a class object.
B.A class object and a class.
C.A class and a member of that class.
D.A class object and a member of that class.
5. 
How can we make a class abstract?
A.By making all member functions constant.
B.By making at least one member function as pure virtual function.
C.By declaring it abstract using the static keyword.
D.By declaring it abstract using the virtual keyword.