KEMBAR78
STQA Notes Chapter 3 | PDF | Software Testing | Unit Testing
0% found this document useful (0 votes)
8 views17 pages

STQA Notes Chapter 3

The document outlines various software testing strategies, including unit testing, integration testing, validation testing, and system testing, emphasizing their importance in ensuring software quality and reliability. It discusses the objectives of software testing, advantages, and disadvantages of different testing types, and provides guidelines and techniques for effective testing. Additionally, it highlights the significance of early defect detection and the role of testing tools and methodologies in the software development lifecycle.

Uploaded by

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

STQA Notes Chapter 3

The document outlines various software testing strategies, including unit testing, integration testing, validation testing, and system testing, emphasizing their importance in ensuring software quality and reliability. It discusses the objectives of software testing, advantages, and disadvantages of different testing types, and provides guidelines and techniques for effective testing. Additionally, it highlights the significance of early defect detection and the role of testing tools and methodologies in the software development lifecycle.

Uploaded by

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

3

SOFTWARE TESTING STRATEGIES


Unit Structure
3.0 Objectives
3.1 Introduction: Strategic Approach to Software Testing
3.2 Unit Testing
3.2.1 Why Unit testing?
3.2.2 Unit testing tools
3.2.3 Unit testing techniques
3.2.4 How to achieve best results using Unit testing
3.2.5 Advantages of Unit testing
3.2.6 Disadvantages of Unit testing
3.3 Integration Testing
3.3.1 Guidelines for Integration Testing
3.3.2 Reason behind Integration Testing
3.3.3 Integration Testing Techniques
3.3.4 Types of Integration Testing
3.4 Validation testing
3.5 System testing
3.5.1 Types of System testing
3.5.2 Why is System testing important
3.6 Summary
3.7 List of References
3.8 Unit End Exercises

3.0 OBJECTIVES
 To get familiar with different strategies involved in software testing
 To get acquaint with the different types of testing involved in software
testing approach

61
Software Testing and 3.1 INTRODUCTION: STRATEGIC APPROACH TO
Quality Assurance
SOFTWARE TESTING
Software testing involves assessing a software application to see if it
complies with requirements and to spot any flaws. These are typical
testing techniques:
1. Black box testing - Tests the software's functionality without
examining the internal code layout.
2. White box testing - Examines the software's internal logic and code
structure.
3. Unit testing verifies that individual software modules or components
are operating as intended.
4. Integration testing verifies that various software components are
integrated and function as a system.
5. Functional testing - Verifies that the functional specifications of the
software are satisfied.
6. System testing verifies that the entire software system satisfies the
required specifications.
7. Acceptance testing verifies that the software satisfies the requirements
of the client or end user.
8. Regression testing verifies that the programme has not developed new
flaws after updates or adjustments have been done.
9. Performance testing - This checks the software's speed, scalability, and
stability to see how it performs.
10. Software is put through security testing to check for flaws and make
sure it complies with security standards.
Software testing is a form of investigation to determine if there are any
flaws or defects in the software so that they can be fixed to improve the
software's quality and determine whether or not it satisfies the criteria.
Glen Myers claims that the following goals of software testing:

 Testing is the process of looking at and examining a programme to


determine whether there is an error or not and whether it satisfies the
requirements or not.
 A good test case and successful testing are both indicated by a large
number of errors that were discovered throughout the test.
 A successful test case will reveal an undiscovered error that hasn't
been found yet.
The fundamental goal of software testing is to create the tests in such a
way that they quickly and efficiently identify all types of mistakes,
62
reducing the amount of time needed for software development. The Software Testing Strategies
overall plan for software testing entails:

Figure 1: Overall strategy for software testing


1. Prior to testing, it's important to recognise and precisely define the
product requirements in terms of numbers: There are various
qualities of software, such as maintainability, which refers to the
capacity to update and alter, likelihood, which refers to the capacity to
identify and quantify any risk, and usability, which refers to the ease
with which customers or end-users may use it. To ensure accurate test
results, all these distinguishing characteristics should be listed in a
specific order.
2. Clearly and specifically stating the testing objectives: The efficacy
of the software's capacity to reach the target, any failure to meet
criteria and carry out functions, and the cost of defects or errors, which
refers to the expense involved in correcting the error, are a few
examples of testing objectives. The test strategy needs to explicitly
state each of these objectives.
3. Classifying users and creating individual user profiles for the
software: Use cases outline how various user classes interact with the
system and one another to accomplish a goal. to determine the users'
genuine needs, followed by a test of the product's actual use.
4. Setting value in test planning and concentrating on rapid-cycle
testing: Rapid Cycle Testing is a sort of test that enhances quality by
discovering and evaluating any modifications needed to enhance the
software development process. Consequently, a test plan is a crucial
and useful document that aids the tester in carrying out quick cycle
testing.
63
Software Testing and 5. Is it possible to create reliable software that can test itself:
Quality Assurance Different sorts of errors should be able to be found or identified by the
software. Additionally, software design should permit automated and
regression testing, which examines the software to determine whether
any negative or unintended consequences of changes to the code or
programme have an impact on its functionality.
6. Employing efficient formal reviews as a filter before testing:
Formal technical reviews are a method to find errors that haven't yet
been found. Effective technical reviews conducted before to testing
significantly cut down on the testing workload and testing time, hence
speeding up the total software development process.
7. To assess the nature, suitability, or capability of the test strategy and
test cases, conduct formal technical reviews. The thorough technical
review aids in identifying any gaps in the testing strategy that need to
be filled. Therefore, in order to raise the calibre of software, technical
reviewers must assess the effectiveness and quality of the test plan and
test cases.
8. Creating a continuous development strategy for the testing
process: To assess and control the quality of software development, a
test method that has already been measured as part of a statistical
process control approach should be utilised.

 Advantages of software testing:


1. Enhances software quality and dependability - Testing aids in the
early detection and correction of flaws, lowering the possibility of
failure or unexpected behaviour in the finished product.
2. Improves user experience - Testing aids in detecting usability
problems and enhancing the user experience as a whole.
3. Builds trust - By testing the programme, stakeholders and developers
can feel more certain that it satisfies specifications and performs as
intended.
4. Makes maintenance easier - Testing makes it simpler to maintain and
update the product by locating and fixing bugs early.
5. Lowers costs - Finding and resolving flaws early in the development
phase saves money over the course of the product's lifespan.

 Disadvantages of software testing:


1. Testing helps in the early detection and rectification of defects,
minimising the likelihood of failure or unexpected behaviour in the
finished product.
2. Enhances user experience - Testing helps identify usability issues and
improves the overall user experience.

64
3. Promotes trust - By putting the programme through testing, Software Testing Strategies
stakeholders and developers can be more confident that it meets
requirements and works as intended.
4. Makes maintenance simpler - By identifying and resolving defects
early on, testing makes it easier to maintain and update the product.
5. Reduces costs - Fixing problems quickly during the development stage
reduces costs over the duration of the product's life.

3.2 UNIT TESTING


Each unit or individual component of the software application is tested as
part of the unit testing process. It represents the initial stage of functional
testing. The purpose of unit testing is to confirm the functionality of
individual unit components.
A unit is a single testable component that may be tested as part of the
application software development process.
Unit testing is used to ensure that isolated code is correct. A specific
application function or piece of code is referred to as a unit component.
Unit testing is typically conducted using the white box testing
methodology by developers.
When the application is finished and submitted to the test engineer, the
test engineer will begin independently or one-by-one testing each
component of the module or module of the application. This procedure is
referred to as unit testing or components testing.

3.2.1 Why Unit testing?


Unit testing is the first level of testing carried out before integration and
further levels of testing in a testing level hierarchy. It employs modules for
testing, reducing the reliance on waiting for Unit testing is aided by the
usage of stubs, drivers, dummy objects, and unit testing frameworks.

Figure 2: Testing Hierarchies

65
Software Testing and The software is typically tested at four levels: unit testing, integration
Quality Assurance testing, system testing, and acceptance testing. However, due to time
constraints, software testers occasionally skip unit testing, which can
result in higher defects during integration testing, system testing,
acceptance testing, or even beta testing, which happens after a software
application is finished.
Here are a few essential justifications:

 Unit testing enables developers and testers to swiftly update code that
is producing defects by assisting them in understanding the
fundamentals of the program.

 It helps to have unit tests for documentation.

 There is a chance that there will be fewer flaws in subsequent testing


levels because unit testing catches errors relatively early in the
development process.

 By relocating code and test cases, it promotes code reuse.

3.2.2 Unit testing tools


We have various types of unit testing tools available in the market, which
are as follows:

 NUnit
 JUnit
 PHPunit
 ParasoftJtest
 EMMA

4.2.3 Unit testing techniques


Unit testing uses all white box testing techniques as it uses the code of
software application:

 Data flow Testing


 Control Flow Testing
 Branch Coverage Testing
 Statement Coverage Testing
 Decision Coverage Testing

3.2.4 How to achieve best results using Unit testing


By taking the actions outlined below, unit testing can produce the best
results without creating confusion or adding complexity:

 As the test cases won't be impacted by requirement changes or


enhancements, test cases must be independent.

 Unit test cases must have clear and consistent naming conventions.

66
 Before moving on to the next stage of the SDLC, the defects found Software Testing Strategies
during unit testing must be rectified.

 One code should only ever be tested at once.

 Adopt test cases as you write the code; otherwise, the number of
possible execution pathways would rise.

 Verify whether the matching unit test is accessible or not for any
module whose code has changed.

3.2.5 Advantages of Unit testing

 Unit testing employs a modular approach because any component can


be tested without holding up the testing of other components.

 To comprehend the unit API, the developing team focuses on the


functionality that is offered by the unit and how functionality should
appear in unit test cases.

 After a few days, unit testing enables the developer to modify code
and verify that the module is still operating faultlessly.

3.2.6 Disadvantages of Unit testing

 As it only examines individual code units, it cannot detect integration


or high-level errors.

 Since it is impossible to evaluate every execution route during unit


testing, errors in programs cannot be found in every instance.

 It works best when combined with other diagnostic procedures.

3.3 INTEGRATION TESTING


After unit testing, the software testing process moves on to integration
testing. Units or individual software components are tested collectively
during this testing. The goal of the integration testing level is to identify
flaws when integrated components or units interact.
Modules are used in unit testing for testing purposes, and integration
testing combines and tests these modules. The Software is created using a
variety of software modules that were created by various programmers or
coders. Integrity testing is done to ensure that all of the modules are
communicating properly.

67
Software Testing and
Quality Assurance

Figure 3: Integration Testing


Integration testing is the process of verifying the data flow between
dependent modules when each component or module is functioning
independently.

3.3.1 Guidelines for Integration Testing

 After each application module has undergone functional testing, we


only go on to integration testing.

 In order to ensure that a suitable sequence is followed and that we


don't miss any integration cases, we always perform integration testing
by selecting modules one at a time.

 Determine the test case strategy first, which will help you create
executable test cases based on the test data.

 Examine the application's structure and architecture to determine the


most important modules to test first and to discover all potential
situations.

 Create test cases to thoroughly verify each interface.

 Select input data before running the test case. Testing heavily relies on
the input data.

 If we discover any bugs, we should notify the developers, who will


subsequently repair the issues and retest.

 Test integration both positively and negatively.


If the entire balance is Rs. 15,000 and we are sending Rs. 1500, then this
positive testing means that the amount transfer should be successful. The
test would be considered successful if it did.
68
Negative testing, on the other hand, means that if the total balance is Rs. Software Testing Strategies
15,000 and Rs. 20,000 is being transferred, the test will pass if neither
event occurs. If it does, there is a code bug, and we will communicate it to
the development team so they can repair it.

3.3.2 Reason behind Integration Testing


Even though unit testing was performed on every module of the software
application, errors still exist for the following reasons:
1. Integration testing is crucial to determining how well software
modules function because each module is created by a different
software developer, whose programming logic may differ from that of
developers of other modules.
2. to determine whether or not the software modules' interactions with
the database are accurate.
3. At the time a module is being developed, requirements can be
modified or improved. Integration testing is now required because it's
possible that these additional requirements won't be tested at the unit
testing level.
4. Errors may be caused by software module incompatibility.
5. to check whether hardware and software are compatible.
6. Inadequate exception handling between modules can lead to issues.
3.3.3 Integration Testing Techniques
Any testing technique (Blackbox, Whitebox, and Greybox) can be used for
Integration Testing; some are listed below:

Black Box Testing

 State Transition technique


 Decision Table Technique
 Boundary Value Analysis
 All-pairs Testing
 Cause and Effect Graph
 Equivalence Partitioning
 Error Guessing

White Box Testing

 Data flow testing


 Control Flow Testing
 Branch Coverage Testing
 Decision Coverage Testing

69
Software Testing and 3.3.4 Types of Integration Testing
Quality Assurance
Integration testing are categorized into two types: Incremental and Non-
Incremental

Figure 4: Types of Integration testing


In the incremental approach, modules are added one at a time in ascending
sequence or as needed. The modules you choose must make sense
together. Usually, two or more modules are added and tested to see if the
functionalities are correct. Up until all of the modules have undergone
successful testing, the procedure continues.
OR
The dependent modules in this kind of testing have a close link with one
another. Let's say we test the proper operation of the data flow between
two or more modules. If so, try again after adding more modules.
Incremental integration testing is carried out by further methods:

 Top-Down approach
 Bottom-Up approach

Top-Down approach
The top-down testing technique focuses on the process in which lower-
level modules are tested alongside higher-level modules until all of the
modules have been successfully tested. Critical modules are tested first,
allowing for the early detection and correction of significant design
problems. With this approach, the modules will be added gradually or one
at a time, and the data flow will be examined in the same sequence.

70
In the top-down approach, we will be ensuring that the module we are Software Testing Strategies
adding is the child of the previous one like Child C is a child of Child
B and so on as we can see in the below image:

Advantages:
o Identification of defect is difficult.
o An early prototype is possible.

Disadvantages:
o Due to the high number of stubs, it gets quite complicated.
o Lower level modules are tested inadequately.
o Critical Modules are tested first so that fewer chances of defects.

Bottom-Up approach
The technique of testing lower level modules with higher level modules
until all of the modules have been successfully tested is known as the
"bottom to up" testing strategy. Since top-level critical modules are tested
last, a defect may result. Another option is to indicate that we will install
the modules in order, starting at the bottom, and then examine the data
flow.

71
Software Testing and In the bottom-up method, we will ensure that the modules we are
Quality Assurance adding are theparent of the previous one as we can see in the below image:

Advantages
o Identification of defect is easy.
o Do not need to wait for the development of all the modules as it saves
time.
Disadvantages
o Critical modules are tested last due to which the defects can occur.
o There is no possibility of an early prototype.

Non-Incremental Integration testing:


When the data flow is exceedingly complicated and it is challenging to
determine who is a parent and who is a child, we will use this method.
And in this situation, we will generate the data in any module and then
check to see if it is present in all other existing modules. Consequently, the
Big Bang approach is another name for it.

72
Big bang Method: Software Testing Strategies

This method integrates all components at once and then conducts testing.
While it is practical for small software systems, it makes it challenging to
identify flaws in large software systems.
Since the testing team has less time to execute this process because this
testing might be done after all modules have been completed, internal
connected interfaces and high-risk important modules are more likely to
be overlooked.

Advantages:

 It is practical for compact software systems.

Disadvantages:

 Defect identification is challenging since we are unable to determine


the source of the error, making it impossible to determine where the
fault originated.

 Small modules are readily missed.

 There is extremely little time allotted for testing.

 There's a chance we won't test all of the interfaces.

3.4 VALIDATION TESTING


The procedure of assessing software to see if it satisfies stated business
requirements either during development or at the end of development.
Validation testing makes ensuring that the product really does meet the
needs of the customer. It is also possible to describe it as proving that a
product works as intended when used in the right setting.
It answers to the question, are we building the right product?
73
Software Testing and Workflow of Validation Testing:
Quality Assurance
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

3.5 SYSTEM TESTING


Testing a fully integrated software system is part of system testing.
Typically, software is integrated into computer systems (software itself is
just one component of a computer system). To create a comprehensive
computer system, the software is developed in modules and then
interfaced with hardware and other applications. To put it another way, a
computer system consists of a collection of software that can carry out a
variety of functions, but only software can do so since it needs to
communicate with appropriate hardware. System testing is a collection of
several types of tests designed to put an integrated software computer
system through its paces and check it against requirements.
System testing is the process of examining an application's or piece of
software's overall usability. We test the product as a whole system and
travel (go through) all the required modules of an application to see if the
final features or the final business function as intended.

74
End-to-end testing is done in an environment that is comparable to the one Software Testing Strategies
used in production.
Black box testing, which includes testing the software's external
functionality, includes system testing. To find little flaws, testing mimics
the user's perspective.
The following actions are a part of system testing.

 Verification of the application's input features to see if it is generating


the desired results.
 Integrated software is tested with external devices to see how different
parts interact with one another.
 System-wide testing for end-to-end testing.
 Using auser's expertise, test the application's behaviour

3.5.1 Types of System testing


There are more than 50 different forms of system testing, but software
testing businesses typically use a few of them. Here are some of them:

1] Regression Testing
Regression testing is carried out as part of system testing to check and
pinpoint any defects that may have arisen as a result of changes made to
any other system component. It ensures that any modifications made
throughout the development process did not produce a new flaw and
ensures that no existing defects will be present as new software is added
over time.
75
Software Testing and 2] Load Testing
Quality Assurance
To determine whether the system can function under real-time loads, load
testing is conducted alongside system testing.

3] Functional Testing
A system is put through functional testing to see whether there are any
missing functions. The tester compiles a list of crucial features that should
be included in the system, can be introduced during functional testing, and
should raise the system's quality.

4] Recovery testing:
System testing includes recovery testing of a system, which verifies the
system's dependability, credibility, accountability, and ability to recover. It
ought to be able to successfully recover from all potential system
failures.In this testing, we will evaluate the application's ability to bounce
back from errors or natural calamities.

5] Migration Testing
Migration testing is performed to ensure that if the system needs to be
modified in new infrastructure so it should be modified without any issue.

6] Usability Testing
The purpose of this testing to make sure that the system is well familiar
with the user and it meets its objective for what it supposed to do.

7] Software and Hardware Testing


The system will be tested to see if the hardware and software are
compatible. To operate the software without any problems, the hardware
setup must be compatible. Because it allows for interactions between
hardware and software, compatibility promotes flexibility.

3.5.2 Why is System testing important

 System testing, which examines the entire system's functionality,


provides total assurance of system performance.
 It comprises testing of the business requirements as well as the system
software architecture.
 Even after production is complete, it aids in bug and live issue
mitigation.
 System testing feeds the same data into both an old and a new system,
comparing the functional changes between the two so that the user
may appreciate the advantages of the system's newly added features.

3.6 SUMMARY
Software testing involves assessing a software application to see if it
complies with requirements and to spot any flaws. We have covered seven
76
different steps involved in software testing strategies. We have also Software Testing Strategies
focused on different types of testing along with their fundamentals. We
have dwelled into integration testing, unit testing and system testing along
with the concepts associated with them.Each unit or individual component
of the software application is tested as part of the unit testing process. In
integration testingunits or individual software components are tested
collectively.Validation testing makes ensuring that the product really does
meet the needs of the customer

3.7 LIST OF REFERENCES


1. Software Engineering for Students, A Programming Approach,
Douglas Bell, 4th Edition, Pearson Education, 2005
2. Software Engineering – A Practitioners Approach, Roger S. Pressman,
5th Edition, Tata McGraw Hill, 2001
3. Quality Management, Donna C. S. Summers, 5th Edition, Prentice-
Hall, 2010. 3. Total Quality Management, Dale H. Besterfield, 3rd
Edition, Prentice Hall, 2003.

3.8 UNIT END EXERCISES


1. Explain the concept of Unit Testing.
2. State the unit testing tools and techniques.
3. Illustrate the Advantages, Disadvantages and the way to achieve best
results using Unit testing.
4. Write a detailed note on Integration Testing.
5. State different Reason behind Integration Testing
6. Explain Integration Testing Techniques.
7. Explain the Types of Integration Testing.
8. Write a note on Validation testing.
9. Explain the concept of SystemTesting.
10. Write a note on thetypes of System testing.
11. Explainwhy is System testing important.



77

You might also like