Professional Documents
Culture Documents
Considering the following pseudo-code, calculate the MINIMUM number of test cases for statement coverage, and the MINIMUM number of test
cases for decision coverage respectively.
READ A
READ B
READ C
IF C>A THEN
IF C>B THEN
PRINT "C must be smaller than at least one number"
ELSE
PRINT "Proceed to next stage"
ENDIF
ELSE
PRINT "B can be smaller than C"
ENDIF
A. 3, 3.
B. 2, 3.
C. 2, 4.
D. 3, 2.
Given the following code, which is true about the minimum number of test cases
Read P
Read Q
Print "Large"
ENDIF
IF P > 50 THEN
ENDIF
RE: Given the following code, which is true about the minimum number of test cases required for full statement and branch coverage Read PRead
QIF P+Q > 100 THENPrint "Large"ENDIFIF P > 50 THENPrint "P Large"ENDIFa) 1 test for statement coverage, 3 for branch
1) if p = 51 Q= 50 it will cover all the statements. so one test for statement coverage.
Given the following code, which is true about the minimum number of test cases required for full statement and branch coverageRead PRead QIF
P+Q > 100 THENPrint "Large"ENDIFIF P > 50 THENPrint "P Large"ENDIFa) 1 test for statement coverage, 3 for branc
Answer: B) 1 test for statement coverage 2 for branch coverage
I believe Code Compliance Testing means to test whether the code is following the set of coding standards set prior to coding.
What are the tables in test plans and test cases? This concept is related to White box testing in...
White box and Black box testing both are dynamic testing techniques.
White box testing: testing based on the paths and internal structure and implementation of the software under test. Here we r checking the code
by some coverage processes.
Black box testing: testing based on the behavior and functionality of the software. this is also called as functional testing..
what is merits and demerits of white box and black...
Merits
In Black box testing You test for the functionality of the program components or application against its specification without knowledge of internal
logic.
InWhite box testingpath of logic in unit or component is known it consists of testing paths branch decision condition to produce predictable results.
Demerits
In Black box testing u cannot test for hidden functions for eg if in a code there is a fucntion that calcualtes x=a=B/n-1
U cannot test for 'n' in blackbox testing
In White box testing you cannot test for missing funtion for eg : whle doing white box testing u cannot test if the tool tip is shown when a cursor
moves over a button
In white box testing you actually go thru the program logic. But you never know whether a particular user requirement is being met or not or
whether a particular program functionality has been implemented or not.
In black box testing you actually verify the user requirement and
you can identify the missing ones. But if the project is huge you my not be able to provide all code coverage and the logic which
you can do in white box testing.
1. We will check the coding of the application 1. we will test the functionality of the application
4. Other wise know as Gloss boc testing unit testing 4. System testing
5. The modules are not intergrated 5. All the module gets intergrated duning the black box testing
Switch PC on
Start “outlook”
IF outlook appears THEN
Send an email
Close outlook
IF A > B THEN
C=A–B
ELSE
C=A+B
ENDIF
Read D
IF C = D Then
Print “Error”
ENDIF
what are all the tools available for white box testing?
What are the tables in testplans and testcases? This concept is related to Whitebox testing in
White box testing is used to test the internal logic of the code.for ex checking whether the path has been executed once checking whether the
branches has been executed atleast oonce .....Used to check the structure of the code
Test plan is a document that contains the scope approach test design and test strategies. It includes the following:-
1. Test case identifier
2. Scope
3.Features to be tested
4. Features not to be tested.
5. Test strategy.
6. Test Approach
7. Test Deliverables
8. Responsibilities.
9 Staffing and Training
10.Risk and Contingencies
11. Approval
While A test case is a noted/documented set of steps/activities that are carried out or executed on the software in order to confirm its
functionality/behavior to certain set of inputs.
What are the tables in testplans and testcases?...
How do you do path testing?this is related to whitebox testing.This is urgent..anybody tell me please
How do you draw flowgraph while working in realtime environment?i,e in a project..in word?or manually on a paper?should it to be shown to test
manager?
Loop Testing
Simple Loops:- The following set of tests should be applied to simple loops where 'n' is the max. no. of allowable passes:
1.Skip the loop entirely.
2.Only one pass thru the loop.
3.Two passes thru the loop.
4.m passes thru the loop where m< n.
5.n-1 n n+1 passes thru the loop.
Nested loops:-
1.Start with the innermost loop.Set all other loop to min. values.
2.Conduct simple loop tests for the innermost loop while holding the outer loops at their min.iteration values.
3.Work outward conducting tests for the next loop but keeping all othe outer loops at their min. iteration count.
4.Continue until all loops have been tested.
Concatenated Loops:-Concatenated loops can be tested using the approach defined for simple loops if the loops are independent.If the loops are
not independent use the nested loop strategy.
Unsructured loops:-Redesign the loops so they are one of the above categories.
Which of the following does not come under technical testing? a) Volume and performance testingb) Operational testingc) Deployment testingd)
Integration testing
Who Says Deployment testing does't come under technical....as there are many technical issues faced by deployment Team. The correct answer is
a) Volume n Performance.
White box testing is done by developers mostly. But if tester have the knowledge of the coding lang. in which the product is developing he/she may
also do that.
If tester knows the language then only he can do white box testing.Usually the tester has not the knowledge of the coding language.
White box testing is done by developer only. black box testing is done by tester. His major intention is finding the defects not rectifying the defect.
developer is going to rectifying the defects
white box testing is done by both Developer & tester. But tester should have codingknowledge. White box testing helps testers to find location of
bugs ! when they look insidethe code.Testers find the location of bugs where the bug is & Developer debugs & fixes the bug .finds why the bug has
occured.white box testing helps tester to write test cases remove unnecessary test cases add more required test cases which can cause software t o
crash
Developers only can carryout the whitebox testing. If the tester knows the coding means he/she can also test but testers work is to find the defects
not to rectify so developers only should do the whitebox testing .
Developers alone carryout the whitebox testing. Though the testers know the programming code their work is to find the defects not to solve so the
whitebox testing should be tested by developers.
White Box testing is done by both developers and tester.In case of projects (eg: Railways aeronautics) there are standards (eg CENELAC)to be which
demands testing to be done by a tester in such cases the white box testing is done by tester and not developer. The tester will have a knowledge of
the coding language only then is he called a white box testerThe tester does the white box testing using rational tools like Rational Test Real Time
(RTRT) .
Mostly the white box testing will be done only by the developer. Because the testing is based on coding. It is also called unit testing.
Explain Data Flow Testing? How we will do that? Step by spep procedure?
Data-flow testing looks at the lifecycle of a particular piece of data (i.e. a variable) in an application. By looking for patterns of data usage risky
areas of code can be found and more test cases can be applied.
There are four ways data can be used: defined used in a predicate used in a calculation and killed. Certain patterns using a piece of data in a
calculation after it has been killed show an anomaly in the code and therefore the possibility of a bug.
For more Details and Examples regarding the same go through the site as mentioned below
why WHITE BOX TESTING is also known by the following names?
a) GLASS BOX TESTING
b) CLEAR BOX TESTING
c) OPEN BOX TESTING
d) STRUCTURAL TESTING
White box is also known as clear box because think of something that is white ... ok ... can you "see thru" it? No. Tad-da! Welcome to Clear Box
testing.
1.why WHITE BOX TESTING is also known by the following names?
Until a few years back there is no universal standard for testing definiations or testing procedures....
So before this standarization people used to use different naming conventions to white box testing...
If you clearly look into the works you will get the meaning is standarized.
White Box _ YOu are going to test something like a white box in which you know what is present inside the box...so as the other definiations
also....I hope this gives you some idea...Coming to your second question..
Use an automated coverage monitor for the analysis of control flow-based unit testing. Compute the cyclomatic complexity to determine the least
number of test cases that should be written. This number does not consider equivalence class partitioning or boundary value analysis – which should
be done for most decision points. Draw the flowgraph for a code segment – at least until you get more used to computing cyclomatic complexity. At
a minimum write enough white box test cases to cover 100 of your statements. Get as high a coverage as possible with your decision/branch and
condition coverage.
What are the levels of testing in which white box testing takes its presence?
1.UnitTesting
2.Integretion Testing
3.Regression testing
Why does a user perform White box testing, when Black box testing is available?
B'coz White Box testing tests the unit of code / program where as Black Box testing has nothing to do with the internal code all it does is based
upon expected output it test the system.
when u perform white box testing we cheek the internal logic of the code and we know that the code is working properly in black box testing just
we are combing the diffrant modules and cheek that all the modules are integrated properly and valiadate the results
when u perform white box testing we are giveing input data and validating the out put results we know that what exactly the code is doing
In black box testing we valiadte the just output results we donot what is the code is doing
Stubs and Drivers are the small programs used in the integration testing such that these programs are placed where the output of undeveloped
modules. that is in some cases, some of the non priority module's output is needed in the project. then to get out of that situation, we write a
small program such that it generates exactly similar output of the ungenerated module. these programs are called stubs and drivers.
Here stub is used when we are testing the application in top-down approach.
and driver is used when we are testing the application in bottom-top approach.
under test and often provide test inputs control and monitor execution and report test
results
A stub is a computer program statement substituting for the body of a software module
that is or will be defined elsewhere
For ex.
public void moveMouse(int x int y) {mouse.setPosition(1);
}
developing the stub allows the programmer to call a method in the code being
developed even if the method does not yet have the desired behavior
a method for writing a set of white-box test cases that exercise the paths in the code the use of equivalence partitioning and boundary value
analysis to manage the number oftest cases that need to be written and to examine error-prone/extreme corner test cases how to measure how
thoroughly the test cases exercise the code
we need to write test cases that ensure the complete coverage of the program logic
for this we need to know the program well i.e. we should know specification and the code to be tested.Knowledge of programming language and
logic
basicly Development and funcnality and Codelogic this immporatant and may the Product or Project knowledge also
Use an automated coverage monitor for the analysis of control flow-based unit testing. Compute the cyclomatic complexity to determine the least
number of test cases that should be written. This number does not consider equivalence class partitioning or boundary value analysis – which should
be done for most decision points. Draw the flowgraph for a code segment – at least until you get more used to computing cyclomatic complexity. At
a minimum write enough white box test cases to cover 100 of your statements. Get as high a coverage as possible with your decision/branch and
condition coverage.
Whitebox Testing requires resources who are familiar with Programming Languages as this type of testing involves in understanding the code and
fixing any bugs if any. This has internal perspective and have to go deep into the code structure to perform the testing.
Whereas Black box testing does not require any knowledge on programming and they do not look at the code as this test can be performed by
anyone or even by a layman without his knowledge though.
I guess this might be the reason behind White box Testing to be expensive
Given specification: if (x>4) then y= x-1; else y= x+1, where x and y are integer variables. List all
Given specification:
if (x>4)
then y= x-1;
else y= x+1,
where x and y are integer variables. List all possible test cases that can detect the bug in the following implementation
if (x >=8) y = x-1;
else y=x+1;
Given specification:
if (x>4)
then y= x-1;
else y= x+1
where x and y are integer variables. List all possible test cases that can detect the bug in the following implementation
if (x >=8) y = x-1;
else y=x+1;
if (x >=8) y = x-1;
else y=x+1;
Cyclomatic complexity gives the number of independent paths in the program which should be tested.
We can find the cyclomatic complexity by representing the program as flowgraph notation or writing the program in procedural language.
Path coverage is the process of writing and executing the test cases that executes all the independent paths
This measure reports whether each of the possible paths in each function have been followed. A path is a unique sequence of branches from the
function entry to the exit.Path coverage has the advantage of requiring very thorough testing. Path coverage has two severe disadvantages. The
first is that the number of paths is exponential to the number of branches. For example, a function containing 10 if-statements has 1024 paths to
test. Adding just one more if-statement doubles the count to 2048. The second disadvantage is that many paths are impossible to exercise due to
relationships of data. For example, consider the following C/C++ code fragment:if (success) statement1;statement2;if (success) statement3;Path
coverage considers this fragment to contain 4 paths. In fact, only two are feasible: success=false and success=true.
this is cyclometric complexity problem for path coverage one wants to find out the number of paths involved in a program. no. of decision+1= path
coverage
A path represents the flow of execution from the start of a method to its exit.
The cyclomatic complexity of a software module is calculated from a connected graph of the module (that shows the topology of control flow
within the program):
Cyclomatic complexity (CC) = E - N + p
where E = the number of edges of the graph
N = the number of nodes of the graph
p = the number of connected components
It is a method of LOGIC COVERAGE
1)E-N+2
here E - Edges
N - Nodes
2)P+1
here P means Predicate Node i.e Node from which branches are coming out
3)C+1
here C means closed region means when 3 or more than 2 nodes combine and a closed region is formed it is called closed region
1.why WHITE BOX TESTING is also known by the following names? a) GLASS BOX TESTING b) CLEAR BOX TESTING
Given the following code, which is true about the minimum number of test casesrequired for full statement
Given the following code, which is true about the minimum number of test cases
Read P
Read Q
Print "Large"
ENDIF
IF P > 50 THEN
ENDIF
Explain Data Flow Testing? How we will do that? Step by spep procedure?Reply
Data-flow testing looks at the lifecycle of a particular piece of data (i.e. a variable) in an application. By looking for patterns of data usage risky
areas of code can be found and more test cases can be applied.
There are four ways data can be used: defined used in a predicate used in a calculation and killed. Certain patterns using a piece of data in a
calculation after it has been killed show an anomaly in the code and therefore the possibility of a bug.
For more Details and Examples regarding the same go through the site as mentioned below
http://openseminar.org/se/modules/166/index/screen.do
Who will do white box testing only developers /testers also ?
White box testing is done by developers mostly. But if tester have the knowledge of the coding lang. in which the product is developing
he/she may also do that.
If tester knows the language then only he can do white box testing.Usually the tester has not the knowledge of the coding language
white box testing only done by developer not the tester because white box testing is static as well as dynamic testing.
White box testing is done by developer only. black box testing is done by tester. His major intention is finding the defects not rectifying
the defect. developer is going to rectifying the defects
white box testing is done by both Developer & tester. But tester should have codingknowledge. White box testing helps testers to find
location of bugs ! when they look insidethe code.Testers find the location of bugs where the bug is & Developer debugs & fixes the
bug .finds why the bug has occured.white box testing helps tester to write test cases remove unnecessary test cases add more required
test cases which can cause software t o crash
White box Testing is testing the internal logic of the program.It is usually done by the developers but if the tester has the knowledge of
the coding language testers are also sometimes involved.
Developers only can carryout the white box testing. If the tester knows the coding means he/she can also test but testers work is to find th defects
not to rectify so developers only should do the whitebox testing .
Developers alone carryout the whitebox testing. Though the testers know the programming code their work is to find the defects not to
solve so the whitebox testing should be tested by developers.
White Box testing is done by both developers and tester.In case of projects (eg: Railways aeronautics) there are standards (eg
CENELAC)to be which demands testing to be done by a tester in such cases the white box testing is done by tester and not developer.
The tester will have a knowledge of the coding language only then is he called a white box testerThe tester does the white box testing
using rational tools like Rational Test Real Time (RTRT)
Mostly the white box testing will be done only by the developer. Because the testing is based on coding. It is also called unit testing.
Control flow loop can be executed () or more times reveal loop defects executes the loop body ?.
Loop Testing
Simple Loops:- The following set of tests should be applied to simple loops where 'n' is the max. no. of allowable passes:
1.Skip the loop entirely.
2.Only one pass thru the loop.
3.Two passes thru the loop.
4.m passes thru the loop where m< n.
5.n-1 n n+1 passes thru the loop.
Nested loops:-
1.Start with the innermost loop.Set all other loop to min. values.
2.Conduct simple loop tests for the innermost loop while holding the outer loops at their min.iteration values.
3.Work outward conducting tests for the next loop but keeping all othe outer loops at their min. iteration count.
4.Continue until all loops have been tested.
Concatenated Loops:-Concatenated loops can be tested using the approach defined for simple loops if the loops are independent.If the loops are
not independent use the nested loop strategy.
Unsructured loops:-Redesign the loops so they are one of the above categories.