UNIT5
UNIT5
Software Testing Strategy – Unit Testing – Integration Testing – Validation Testing – System
Testing – Debugging – White-Box Testing – Basis Path Testing – Control Structure Testing –
Black-Box Testing – Software Configuration Management (SCM) – SCM Repository – SCM
Process – Configuration Management for Web and Mobile Apps
1. Before testing starts, it’s necessary to identify and specify the requirements
of the product in a quantifiable manner. Different characteristics quality of the
software is there such as maintainability that means the ability to update and
modify, the probability that means to find and estimate any risk, and usability that
means how it can easily be used by the customers or end-users. All these
characteristic qualities should be specified in a particular order to obtain clear test
results without any error.
2. Specifying the objectives of testing in a clear and detailed manner. Several
objectives of testing are there such as effectiveness that means how effectively the
software can achieve the target, any failure that means inability to fulfill the
requirements and perform functions, and the cost of defects or errors that mean
the cost required to fix the error. All these objectives should be clearly mentioned
in the test plan.
3. For the software, identifying the user’s category and developing a profile
for each user. Use cases describe the interactions and communication among
different classes of users and the system to achieve the target. So as to identify the
actual requirement of the users and then testing the actual use of the product.
4. Developing a test plan to give value and focus on rapid-cycle testing. Rapid
Cycle Testing is a type of test that improves quality by identifying and measuring
the any changes that need to be required for improving the process of software.
Therefore, a test plan is an important and effective document that helps the tester
to perform rapid cycle testing.
5. Robust software is developed that is designed to test itself. The software
should be capable of detecting or identifying different classes of errors. Moreover,
software design should allow automated and regression testing which tests the
software to find out if there is any adverse or side effect on the features of software
due to any change in code or program.
6. Before testing, using effective formal reviews as a filter. Formal technical
reviews is technique to identify the errors that are not discovered yet. The effective
technical reviews conducted before testing reduces a significant amount of testing
efforts and time duration required for testing software so that the overall
development time of software is reduced.
7. Conduct formal technical reviews to evaluate the nature, quality or ability
of the test strategy and test cases. The formal technical review helps in detecting
any unfilled gap in the testing approach. Hence, it is necessary to evaluate the
ability and quality of the test strategy and test cases by technical reviewers to
improve the quality of software.
8. For the testing process, developing a approach for the continuous
development. As a part of a statistical process control approach, a test strategy
that is already measured should be used for software testing to measure and
control the quality during the development of software.
2. Unit Testing:
Unit Testing is a software testing technique by means of which individual units of software
i.e. group of computer program modules, usage procedures, and operating procedures are
tested to determine whether they are suitable for use or not.
Types of Unit Testing:
3.Integration Testing:
Integration testing is the process of testing the interface between two software units or
modules. It focuses on determining the correctness of the interface.
Integration test approaches – There are four types of integration testing approaches. Those
approaches are the following:
1. Big-Bang Integration Testing – It is the simplest integration testing approach, where all
the modules are combined and the functionality is verified after the completion of individual
module testing. In simple words, all the modules of the system are simply put together and
tested. This approach is practicable only for very small systems. If an error is found during
the integration testing, it is very difficult to localize the error as the error may potentially
belong to any of the modules being integrated. So, debugging errors reported during big bang
integration testing is very expensive to fix.
Big-Bang integration testing is a software testing approach in which all components or
modules of a software application are combined and tested at once
Advantages:
1. It is convenient for small systems.
2. Simple and straightforward approach.
Disadvantages:
1. Not Good for long projects.
2. This can lead to system failure and decreased user satisfaction.
2. Bottom-Up Integration Testing – In bottom-up testing, each module at lower levels are
tested with higher modules until all modules are tested. The primary purpose of this
integration testing is that each subsystem tests the interfaces among various modules making
up the subsystem. This integration testing uses test drivers to drive and pass appropriate data
to the lower-level modules.
Advantages:
• It is easy to create the test conditions.
• It is Easy to observe the test results.
Disadvantages:
• Driver modules must be produced.
• As Far modules have been created, there is no working model can be represented.
3. Top-Down Integration Testing – Top-down integration testing technique is used in order
to simulate the behaviour of the lower-level modules that are not yet integrated. In this
integration testing, testing takes place from top to bottom. First, high-level modules are tested
and then low-level modules and finally integrating the low-level modules to a high level to
ensure the system is working as intended.
Advantages:
• Easier isolation of interface errors.
• In this, design defects can be found in the early stages.
Disadvantages:
• Modules at lower level are tested inadequately.
• It is difficult to observe the test output.
4. Mixed Integration Testing – A mixed integration testing is also called sandwiched
integration testing. A mixed integration testing follows a combination of top down and
bottom-up testing approaches. In top-down approach, testing can start only after the top-level
module have been coded and unit tested. In bottom-up approach, testing can start only after
the bottom level modules are ready. This sandwich or mixed approach overcomes this
shortcoming of the top-down and bottom-up approaches. It is also called the hybrid
integration testing. also, stubs and drivers are used in mixed integration testing.
Advantages:
• Mixed approach is useful for very large projects having several sub projects.
• Parallel test can be performed in top and bottom layer tests.
Disadvantages:
• For mixed integration testing, it requires very high cost because one part has a
Top-down approach while another part has a bottom-up approach.
• This integration testing cannot be used for smaller systems with huge
interdependence between different modules.
4. Validation Testing:
The process of evaluating software during the development process or at the end of the
development process to determine whether it satisfies specified business requirements.
Validation Testing ensures that the product actually meets the client's needs. It can also be
defined as to demonstrate that the product fulfills its intended use when deployed on
appropriate environment.
It answers to the question, Are we building the right product?
Validation Testing - Workflow:
Validation testing can be best demonstrated using V-Model. The Software/product under test
is evaluated during this type of testing.
Activities:
• Unit Testing
• Integration Testing
• System Testing
• User Acceptance Testing
6. Debugging:
Debugging is the process of identifying and resolving errors, or bugs, in a software system.
It is an important aspect of software engineering because bugs can cause a software system
to malfunction, and can lead to poor performance or incorrect results.
There are several common methods and techniques used in debugging, including:
1. Code Inspection: This involves manually reviewing the source code of a
software system to identify potential bugs or errors.
2. Debugging Tools: There are various tools available for debugging such as
debuggers, trace tools, and profilers that can be used to identify and resolve bugs.
3. Unit Testing: This involves testing individual units or components of a software
system to identify bugs or errors.
4. Integration Testing: This involves testing the interactions between different
components of a software system to identify bugs or errors.
5. System Testing: This involves testing the entire software system to identify
bugs or errors.
6. Monitoring: This involves monitoring a software system for unusual behavior
or performance issues that can indicate the presence of bugs or errors.
7. Logging: This involves recording events and messages related to the software
system, which can be used to identify bugs or errors.
Debugging Approaches/Strategies:
1. Brute Force: Study the system for a larger duration in order to understand the
system. It helps the debugger to construct different representations of systems to
be debugged depending on the need. A study of the system is also done actively
to find recent changes made to the software.
2. Backtracking: Backward analysis of the problem which involves tracing the
program backward from the location of the failure message in order to identify
the region of faulty code. A detailed study of the region is conducted to find the
cause of defects.
3. Forward analysis of the program involves tracing the program forwards using
breakpoints or print statements at different points in the program and studying the
results. The region where the wrong outputs are obtained is the region that needs
to be focused on to find the defect.
4. Using past experience with the software debug the software with similar
problems in nature. The success of this approach depends on the expertise of the
debugger.
5. Cause elimination: it introduces the concept of binary partitioning. Data
related to the error occurrence are organized to isolate potential causes.
6. Static analysis: Analyzing the code without executing it to identify potential
bugs or errors. This approach involves analyzing code syntax, data flow, and
control flow.
7. Dynamic analysis: Executing the code and analyzing its behavior at runtime to
identify errors or bugs. This approach involves techniques like runtime debugging
and profiling.
8. Collaborative debugging: Involves multiple developers working together to
debug a system. This approach is helpful in situations where multiple modules or
components are involved, and the root cause of the error is not clear.
9. Logging and Tracing: Using logging and tracing tools to identify the sequence
of events leading up to the error. This approach involves collecting and analyzing
logs and traces generated by the system during its execution.
10. Automated Debugging: The use of automated tools and techniques to assist in
the debugging process. These tools can include static and dynamic analysis tools,
as well as tools that use machine learning and artificial intelligence to identify
errors and suggest fixes.
Advantages of Debugging:
Disadvantages of Debugging:
1. Time-consuming
2. Can be difficult to fix
3. Can be expensive
7. White-Box Testing:
White box testing techniques analyze the internal structures the used data structures, internal
design, code structure, and the working of the software rather than just the functionality as
in black box testing. It is also called glass box testing or clear box testing or structural testing.
White Box Testing is also known as transparent testing or open box testing.
Working process of white box testing:
• Input: Requirements, Functional specifications, design documents, source code.
• Processing: Performing risk analysis to guide through the entire process.
• Proper test planning: Designing test cases so as to cover the entire code.
Execute rinse-repeat until error-free software is reached. Also, the results are
communicated.
• Output: Preparing final report of the entire testing process.
Testing techniques:
• Statement coverage: In this technique, the aim is to traverse all statements at
least once. Hence, each line of code is tested. In the case of a flowchart, every
node must be traversed at least once. Since all lines of code are covered, helps in
pointing out faulty code.
• Branch Coverage: In this technique, test cases are designed so that each branch
from all decision points is traversed at least once. In a flowchart, all edges must
be traversed at least once.
• Condition Coverage: In this technique, all individual conditions must be
covered as shown in the following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
4. #TC1 – X = 0, Y = 55
5. #TC2 – X = 5, Y = 0
• Multiple Condition Coverage: In this technique, all the possible combinations
of the possible outcomes of conditions are tested at least once. Let’s consider the
following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
4. #TC1: X = 0, Y = 0
5. #TC2: X = 0, Y = 5
6. #TC3: X = 55, Y = 0
7. #TC4: X = 55, Y = 5
• Basis Path Testing: In this technique, control flow graphs are made from code
or flowchart and then Cyclomatic complexity is calculated which defines the
number of independent paths so that the minimal number of test cases can be
designed for each independent path.
• Steps:
1. Make the corresponding control flow graph
2. Calculate the cyclomatic complexity
3. Find the independent paths
4. Design test cases corresponding to each independent path
• Loop Testing: Loops are widely used and these are fundamental to many
algorithms hence, their testing is very important. Errors often occur at the
beginnings and ends of loops.
1. Simple loops: For simple loops of size n, test cases are designed that:
• Skip the loop entirely
• Only one pass through the loop
• 2 passes
• m passes, where m < n
• n-1 ans n+1 passes
2. Nested loops: For nested loops, all the loops are set to their minimum
count and we start from the innermost loop. Simple loop tests are
conducted for the innermost loop and this is worked outwards till all
the loops have been tested.
3. Concatenated loops: Independent loops, one after another. Simple
loop tests are applied for each. If they’re not independent, treat them
like nesting.
White Testing is Performed in 2 Steps:
1. Tester should understand the code well
2. Tester should write some code for test cases and execute them
3. Nested Loops – Loops within loops are called as nested loops. when testing
nested loops, the number of tested increases as level nesting increases. The
following steps for testing nested loops are as follows-
1. Start with inner loop. set all other loops to minimum values.
2. Conduct simple loop testing on inner loop.
3. Work outwards.
4. Continue until all loops tested.
4. Unstructured loops – This type of loops should be redesigned, whenever
possible, to reflect the use of unstructured the structured programming
constructs.
10. Software Configuration Management (SCM):
System Configuration Management (SCM) is an arrangement of exercises which controls
change by recognizing the items for change, setting up connections between those things,
making/characterizing instruments for overseeing diverse variants, controlling the changes
being executed in the current framework, inspecting and revealing/reporting on the changes
made.
Processes involved in SCM – Configuration management provides a disciplined
environment for smooth control of work products. It involves the following activities:
1. Identification and Establishment – Identifying the configuration items from
products that compose baselines at given points in time. Establishing relationship
among items, creating a mechanism to manage multiple level of control and
procedure for change management system.
2. Version control – Creating versions/specifications of the existing product to
build new products from the help of SCM system. A description of version is
given below: