[go: up one dir, main page]

0% found this document useful (0 votes)
70 views29 pages

Software Testing II

The document discusses different software testing strategies and techniques, including incremental testing, big bang testing, top-down testing, bottom-up testing, stubs, drivers, white box testing and black box testing. Incremental testing involves integrating and testing modules together in logical groupings, while big bang testing integrates all modules at once for testing. Top-down testing tests high level modules first while bottom-up tests low level modules first. Stubs and drivers are used as replacements for unavailable modules during testing. White box testing examines internal code structures and paths while black box testing focuses on inputs and outputs without considering internal code.

Uploaded by

Abrar Mohammad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views29 pages

Software Testing II

The document discusses different software testing strategies and techniques, including incremental testing, big bang testing, top-down testing, bottom-up testing, stubs, drivers, white box testing and black box testing. Incremental testing involves integrating and testing modules together in logical groupings, while big bang testing integrates all modules at once for testing. Top-down testing tests high level modules first while bottom-up tests low level modules first. Stubs and drivers are used as replacements for unavailable modules during testing. White box testing examines internal code structures and paths while black box testing focuses on inputs and outputs without considering internal code.

Uploaded by

Abrar Mohammad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Software Testing II

Software testing Strategies


• Incremental testing
• Bottom-Up Testing
• Top-Down Testing

• Big Bang testing


Big Bang testing
To test the Software as an entirely, meaning is, once the completed
package is available
Big Bang Integration Testing is an integration testing strategy wherein
all units are linked at once, resulting in a complete system
In this testing approach, once all the modules are developed and
tested individually, they are integrated once and tested together at
once.
In this type of integration testing all the components as well as the
modules of the software are integrated simultaneously, after which
everything is tested as a whole.
it is very much suitable for smaller systems.
3
Advantages and Disadvantages
• Adv
• This testing technique prevents wastage of extra efforts and time, and makes
the testing process cost effective.
• There is no need of immediate builds and efforts required for the system.
• Dis.
• If any bug is found it becomes difficult to detach all the modules on order to
find out its root cause.
• Since all the modules are tested together chances of failure increases.
• Error correction estimation of the required testing resources and testing
schedule a rather fuzzy endeavor.
Incremental testing
It is performed by connecting two or more modules together that are
logically related. Later more modules are added and tested for proper
functionality. This is done until all the modules are integrated and
tested successfully.

• Performed according to 2 basic strategies:


• Bottom-up
• Top-down
Stubs & Drivers
• While testing, sometimes we face a situation where some of the
modules are still under development. These modules for testing
purpose are replaced with some dummy programs. These dummy
programs are called stubs and drivers.
Stubs
• Stubs ( often termed a “Dummy Module “ )replaces an unavailable
lower level module, subordinate to the module tested.
• It is required for top-down testing of incomplete systems.
Drivers
• A driver is a substitute module but of the upper level module that
activates the module tested.
• The driver is passing the test data on to the tested module and
accepting the results calculated by it.
• It is required in bottom-up testing until the upper level modules are
developed.
Top-down Testing
• The 1st module tested is the main module which is the highest
level module in the software structure and the last module to be
tested are the lowest level modules.
• Top-down integration testing is an integration testing technique
used in order to simulate the behavior of the lower-level modules
that are not yet integrated. Stubs are the modules that act as
temporary replacement for a called module and give the same
output as that of the actual product.
Top-down Testing

11
Bottom-up Testing
• The order of testing is reversed: the lowest level module are tested
first with the main module will be tested last.
• Each component at lower hierarchy is tested individually and then
the components that rely upon these components are tested.
Bottom-up Testing
Incremental testing Advantages
• Usually performed on relatively small SW modules, as unit
or integration tests.
• Identification and correction of errors is much simpler and
requires fewer resources because it is performed on a
limited volume of SW.

14
Software testing classification - code visible
level
• Black box ( functionality ) testing:
• Identifies bugs only according to SW malfunctioning as
they are revealed in its erroneous output.
• Incases that outputs are found to be correct, black box
testing disregarded the internal path of calculations and
processing performed.
• White box ( structural ) testing:
• Examines internal calculation paths in order to identify
bugs.

15
White box and black box testing for the various
classes of tests

16
White Box Testing
• White box testing is testing of a software solution's internal structure,
design, and coding.
• the code is visible. It focuses primarily on verifying the flow of inputs
and outputs through the application, improving design and usability,
strengthening security
• White box testing is also known as Clear Box testing, Open Box testing,
Structural testing, Transparent Box testing, Code-Based testing, and
Glass Box testing.
• It is usually performed by developers.

17
What do you verify in White Box Testing?
• White box testing involves
1. Internal security holes
2. poorly structured paths in the coding processes
3. The flow of specific inputs through the code
4. Expected output
5. The functionality of conditional loops
6. Testing of each statement, object, and function on an individual basis

• The testing can be done at integration & unit levels of software


development
White Box Testing Tools
1. Parasoft Jtest
2. EclEmma
3. NUnit
4. PyUnit
5. HTMLUnit
6. CppUnit
7. Junit
White Box Testing Techniques
• A major White box testing technique is Code Coverage analysis. Code Coverage
analysis eliminates gaps in a Test Case suite. It identifies areas of a program that
are not exercised by a set of test cases. Once gaps are identified, you create test
cases to verify untested parts of the code, thereby increasing the quality of the
software product.
• Code Coverage Techniques:
• Statement Coverage - This technique is aimed at exercising all programming
statements with minimal tests. (typical coverage is 80 – 90 %)
• Branch Coverage - This technique is running a series of tests to ensure that
all branches are tested at least once.(Decision coverage and it covers both the
true and false conditions)
• Path Coverage - This technique corresponds to testing all possible paths
which means that each statement and branch is covered.
Example 1
• if (x>y)
• PRINT x is greater than y

• So the Test Set for 100% branch coverage will be:


• Test Case 1: x=5, y=2 which will return true.
• Test Case 2: x=2, y=5 which will return false.
• Both the test cases 1 and 2 are required for Branch coverage.
• With only Test cases1, it will be statement coverage.
Flow Chart
Statements Coverage
1. PrintSum(int a, int b) 1. Coverage measure = Number of
2. { executed statements / total number
of statements
3. int result = a+ b;
4. if(result > 0 )
2. List of test cases :
5. println(“Red Result”+ result); 1. TC#1 : a=3 , b=9 , coverage = 6/8
6. else if(result < 0) 2. TC#2 : a=-5, b=-8 , 7/8
7. println(“Blue Result”+ result); 3. With TC#1 & TC#2, we achieve
8. } 100% coverage
1. Coverage measure = Number of
Branch Coverage executed branches / total number of
branches
1. PrintSum(int a, int b)
2. {
2. List of test cases :
3. int result = a+ b;
1. TC#1 : a=3 , b=9 , coverage = 1/4
4. if(result > 0 ) 2. TC#2 : a=-5, b=-8 , coverage = 2/4
5. println(“Red Result”+ result); 3. TC#3 : a=0 , b=0, coverage = 2/4

6. else if(result < 0)


7. println(“Blue Result”+ result);
8. }
Path Coverage
• Path 1: 1,2,3,5,6, 7
• Path 2: 1,2,4,5,6, 7
• Path 3: 1, 6, 7
Advantages & Dis. of White Box Testing
• Adv.
1. Code optimization by finding hidden errors.
2. White box tests cases can be easily automated.
3. Testing is more thorough as all code paths are usually covered.
4. Testing can start early in SDLC even if GUI is not available.

• Dis.
• White box testing is too much time consuming when it comes to large-scale programming
applications.
• White box testing is much expensive and complex.
• It can lead to production error because it is not detailed by the developers.
• White box testing needs professional programmers
Black box testing
• It is a testing technique in which functionality of the Application Under Test
(AUT) is tested without looking at the internal code structure, implementation
details and knowledge of internal paths of the software.
• This type of testing is based entirely on software requirements and
specifications. In Black Box Testing we just focus on inputs and output of the
software system without bothering about internal knowledge of the software
program.

• The testing can be done at Acceptance & System levels of software development

27
Types of Black Box Testing
• Functional testing - This black box testing type is related to the
functional requirements of a system;
• Non-functional testing - This type of black box testing is not related to
testing of specific functionality, but non-functional requirements such
as performance, scalability, usability.
Advantages and Dis. of black box testing
• Advantages
• Allows carrying out the majority of testing classes, such as load tests and availability tests
• Requires fewer resources than those required for white box testing
• Disadvantages
• Absence of control of line coverage.
• Impossibility of testing the quality of coding and its strict adherence to the coding standards.

29

You might also like