Software Testing: Test Case Design, Defect Analysis, and Planning

Verified

Added on  2019/09/22

|6
|1487
|255
Homework Assignment
AI Summary
This document provides comprehensive solutions to a software testing assignment. The assignment covers various aspects of software testing, including designing test cases for feature combinations, verifying input parameter ranges, testing systems with character inputs, and identifying test case attributes. It also delves into the behavior of static variables within functions, the concept of out-of-scope variables, and the creation of a test plan for a new gadget. Furthermore, the document addresses black box testing for cell phones, data transfer synchronization, defect resolution procedures, and an estimation problem involving gasoline usage in New York City. The solutions are well-structured, providing expected and actual results, along with explanations, making it a valuable resource for understanding and mastering software testing concepts.
Document Page
0 | P a g e
questionnaire solution
STUDENT
05 OCTOBER, 2016
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
NAME, 05 OCTOBER, 2016
1. A device supports two features: Feature A and Feature B. Both can be turned off and on.
Feature B is dependent on Feature A. Therefore, if Feature A is off, Feature B will not work.
Feature A is on by default. Design the optimal set of test cases that will test all combinations
of Feature A and Feature B.
ANSWER:
TEST CASE ID DESCRIPTION EXPECTED
RESULT
ACTUAL RESULT SUCCESS /
FAILURE
1 Feature A is
turned off and B
is on.
Feature A and B
will not work
Feature A and B
doesn’t work
Success
2 Feature A is on
and feature B
off.
Feature A will
work and B will
not work.
Feature A works
and B doesn’t
work.
Success
3 Feature A is
turned off and B
is off.
Feature A and B
will not work
Feature A and B
doesn’t work
Success
4 Feature A is on
and feature B is
on.
Feature A will
work and B will
also work.
Feature A works
and B also work.
Success
2. Unsigned integer X is an input parameter to a device. The device expects X to be within a
range, X = [a,b]. a and b are included in the range, and b is always greater than a. Create the
optimized number of tests to verify that a device can receive X. Specify a value for X in each
test case.
ANSWER:
TEST CASE ID VALUE OF X DESCRIPTION EXPECTED
RESULT
ACTUAL
RESULT
SUCCESS /
FAILURE
a b
1 1 2 b>a X will be
accepted by
device
Accepted Success
2 2 1 a>b X will not be
accepted by
device.
Rejected Success
3 1 1 a=b X will not be
accepted by
device.
Rejected Success
4 3 5 b>a X will be
accepted by
device
Accepted Success
3. A requirement states that an ASCII character X can be an input for a system. For input
characters ‘0’-‘9’, the system executes a particular function. Considering this is a black box
system, what values of X would you use to test the system?
Document Page
NAME, 05 OCTOBER, 2016
ANSWER: we assume that if the value between the value including the boundary, is entered
the, a function will be executed and result will be success. Else if other values are entered
then the result is failure.
Let the particular function = ‘abc’
The boundary values are:
1. Lower boundary = 0
2. Upper boundary = 9
The test cases for this situation are:
TEST CASE
ID
VALUE OF X DESCRIPTION EXPECTED
RESULT
ACTUAL
RESULT
SUCCESS /
FAILURE
1 -1 Values is less
than lower
Function
‘abc’ will not
be executed
‘abc’ not
executed.
Success
2 0 Lower
Boundary
value
Function
‘abc’ will be
executed.
‘abc’
executed.
Success
3 2 Value within
the boundary
Function
‘abc’ will be
executed.
‘abc’
executed.
Success
4 9 Upper
boundary
value
Function
‘abc’ will be
executed.
‘abc’
executed.
Success
5 10 Value greater
than the
upper
boundary
Function
‘abc’ will not
be executed
‘abc’ not
executed.
Success
6 8 Value within
the
boundary.
Function
‘abc’ will be
executed.
‘abc’
executed.
Success
4. What attributes are found in a typical test case? Please provide at least three examples in
table format using the tests that you created in Question 3.
ANSWER: the attributes of a test case are:
ATTRIBUTES DESCRIPTION
TEST CASE ID Each test case will have a unique ID, which
is used to identify it.
DESCRIPTION Description of what is to be tested.
EXPECTED RESULT The result that should come after testing
ACTUAL RESULT The result that actually occurs after testing
VALUE OF VARIABLE Input value of the variable or function that
Document Page
NAME, 05 OCTOBER, 2016
is being tested.
5. A static integer variable is declared inside a function. The variable increments by 1 when the
function is called. The function is called and returns 3 times. What is the value of the
variable on the third function call and what is the value when it returns? Explain your
answer.
ANSWER: since the variable it static, its lifetime will extend from the function lifetime to the
lifetime of the program. In other words, the variable holds previous values even after
function has finished. Let the variable be ‘x’.
Value of x at start of the program = 0
After 1st return value of ‘x’ = 1
After 2nd return value of ‘x’ = 2
So at the 3rd time call of the function value of x will be = 2.
And at the return of 3rd function call, value of x = 3.
6.
7. Give an example of an out of scope variable.
ANSWER: variable go ‘out of scope when they are no more accessible. For example a local
variable has scope just to the local function and cannot be used globally. The example is given
below:
int main ()
{
Add();
Void Add()
{
Int a, b, c;
a = 10;
b = 20;
c = a + b;
cout << c;
}
cout << c; //access to local variable to see.
return 0;
}
8. Your manager has just given you Gadget 4.0, the newest product from Gadget Corp, and
asks for you to write a test plan for it. You’ve never used a Gadget before. How would you
begin writing a test plan?
ANSWER: I will follow the following format for a test plan for software features:
1. Test case id
2. Feature to be tested
3. Expected output from feature
4. Actual output from the feature
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
NAME, 05 OCTOBER, 2016
5. Beneficial or not
6. Any additional Comments
The apart from this for hardware durability we will create list of hardware like screen, body,
processor, RAM etc. and their durability or comments about them.
9. You have just bought a new cell phone and would like to make sure that it works. You don’t
want to spend more than five minutes checking your phone. What tests would you perform
in this timeframe?
ANSWER: for such scenarios we will perform black box testing. In this type of testing only external
features are tested. So to test the working of phone this type of testing is best suited. One can check
all the external features like:
1. Screen
2. Body (for scratches)
3. Buttons
4. Software
5. Camera
6. Touch response
7. Sound
8. Mic etc.
10. Data is being sent between a device and a host. How would you ensure that data transfer
between the systems is in sync and that data is communicated reliably? Design and describe
your protocol which may exist on any layer or multiple layers.
ANSWER:
11. While testing a product, a defect is discovered. As part of your procedure, what would be
your next steps?
ANSWER: the next steps I would follow will be related to resolving the problem. These steps are
predefined and should be followed every time a defect occurs. These steps are:
a. Checking for associated defect management plan.
b. Finding appropriate solution
c. Solving the defect with the solution found
d. Recheck or retest the defect that occurred.
12.
13. How many gallons of gasoline do you think New York City uses in a week? Clearly state all
assumptions that you are making. (Hint: Your answer should be an estimate. You should
not compile massive amounts of data to answer this question. Come up with a number
using basic facts and educated guesses.)
Document Page
NAME, 05 OCTOBER, 2016
ANSWER: the assumptions for the situation are:
Number of houses in New York = 100000
Car per house = 1
Gasoline used in each car = 5 gallons per week.
We assume that each car gets filled once every week.
So gasoline that will be used in a week = no. of cars filled each week * gallons filled in each car
every week.
= 100000 * 5 = 500000
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]