0% found this document useful (0 votes)
5 views

CSC 206 Testing and debugging

The document outlines the principles and types of software testing, emphasizing the importance of verifying that applications are bug-free and meet user requirements. It details various testing techniques, including manual testing, white box testing, black box testing, and non-functional testing, along with their advantages. Additionally, it covers specific testing methods such as unit testing, integration testing, system testing, and performance testing, highlighting their roles in ensuring software quality and reliability.

Uploaded by

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

CSC 206 Testing and debugging

The document outlines the principles and types of software testing, emphasizing the importance of verifying that applications are bug-free and meet user requirements. It details various testing techniques, including manual testing, white box testing, black box testing, and non-functional testing, along with their advantages. Additionally, it covers specific testing methods such as unit testing, integration testing, system testing, and performance testing, highlighting their roles in ensuring software quality and reliability.

Uploaded by

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

CSC 206: SOFTWARE TESTING AND TECHNIQUES

Testing: Testing is the process of verifying and validating that a software or


application is bug-free, meets the technical requirements as guided by its
design and development, and meets the user requirements effectively and
efficiently by handling all the exceptional and boundary cases.

Principles of Testing
i. All the tests should meet the customer’s requirements.
ii. To make our software testing should be performed by a third party.
iii. Exhaustive testing is not possible. As we need the optimal amount
of testing based on the risk assessment of the application.
iv. All the tests to be conducted should be planned before
implementing it
v. It follows the Pareto rule (80/20 rule) which states that 80% of
errors come from 20% of program components.
vi. Start testing with small parts and extend it to large parts.

Types of Software Testing

Manual Testing
Manual testing is a technique to test the software that is carried out using the functions and
features of an application. In manual software testing, a tester carries out tests on the software
by following a set of predefined test cases. In this testing, testers make test cases for the codes,
test the software, and give the final report about that software. Manual testing is time-
consuming because it is done by humans, and there is a chance of human errors.
Advantages of Manual Testing:
a. Fast and accurate visual feedback: It detects almost every bug in the software
application and is used to test the dynamically changing GUI designs like layout, text,
etc.
b. Less expensive: It is less expensive as it does not require any high-level skill or a specific
type of tool.
c. No coding is required: No programming knowledge is required while using the black box
testing method. It is easy to learn for the new testers.
d. Efficient for unplanned changes: Manual testing is suitable in case of unplanned changes
to the application, as it can be adopted easily.

Types of Manual Testing


i. White Box Testing
ii. Black Box Testing
iii. Gray Box Testing

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 clear box testing or
structural testing. White Box Testing is also known as transparent testing or open box
testing. The tester has access to the source code and uses this knowledge to design test
cases that can verify the correctness of the software at the code level.

Advantages of Whitebox Testing:


i. Thorough Testing: White box testing is thorough as the entire code and structures
are tested.
ii. Code Optimization: It results in the optimization of code removing errors and helps
in removing extra lines of code.
iii. Early Detection of Defects: It can start at an earlier stage as it doesn’t require any
interface as in the case of black box testing.
iv. Integration with SDLC: White box testing can be easily started in the Software
Development Life Cycle.
v. Detection of Complex Defects: Testers can identify defects that cannot be detected
through other testing techniques.

Black Box Testing


Black-box testing is a type of software testing in which the tester is not concerned with
the internal knowledge or implementation details of the software but rather focuses on
validating the functionality based on the provided specifications or requirements.

Types of Black Box Testing


1. Functional Testing
2. Non-Functional Testing
4.3.3.2 Functional Testing
Functional Testing is a type of Software Testing in which the system is tested against the
functional requirements and specifications. Functional testing ensures that the
requirements or specifications are properly satisfied by the application. This type of
testing is particularly concerned with the result of processing. It focuses on the
simulation of actual system usage but does not develop any system structure
assumptions. The article focuses on discussing function testing.

Benefits of Functional Testing:


 Bug-free product: Functional testing ensures the delivery of a bug-free and high-quality
product.
 Customer satisfaction: It ensures that all requirements are met and ensures that the
customer is satisfied.
 Testing focused on specifications: Functional testing is focused on specifications as per
customer usage.
 Proper working of application: This ensures that the application works as expected and
ensures proper working of all the functionality of the application.
 Improves quality of the product: Functional testing ensures the security and safety of
the product and improves the quality of the product.

Types of Functional Testing


a. Unit Testing
b. Integration Testing
c. System Testing

a. Unit Testing: Unit testing is the foundation of software testing. It focuses on testing
individual units or components of the software in isolation. Developers typically perform
unit testing by writing test cases for each unit to verify its functionality and ensure it
behaves as expected. Automated testing frameworks often facilitate unit testing,
enabling developers to easily run tests and identify issues early in the development
process.

Advantages of Unit Testing:


Some of the advantages of Unit Testing are listed below.
 It helps to identify bugs early in the development process before they become more
difficult and expensive to fix.
 It helps to ensure that changes to the code do not introduce new bugs.
 It makes the code more modular and easier to understand and maintain.
 It helps to improve the overall quality and reliability of the software.

b. Integration Testing
Integration Testing: Integration testing involves testing the interaction between
different components or modules of the software. It ensures that the integrated system
functions correctly as a whole. By testing how the components work together,
integration testing identifies any defects that may arise due to interfaces, data
exchanges, or dependencies between modules. This type of testing is critical for
detecting issues that may arise during system integration.
Different ways of Integration Testing are discussed below.
 Top-down integration testing: It starts with the highest-level modules and differentiates
them from lower-level modules.
 Bottom-up integration testing: It starts with the lowest-level modules and integrates
them with higher-level modules.
 Big-Bang integration testing: It combines all the modules and integrates them all at
once.
 Incremental integration testing: It integrates the modules in small groups, testing each
group as it is added.

Types of Integration Testing


1. Incremental Testing
2. Non-Incremental Testing

1. Incremental Testing
Like development, testing is also a phase of SDLC (Software Development Life Cycle).
Different tests are performed at different stages of the development cycle. Incremental
testing is one of the testing approaches that is commonly used in the software field
during the testing phase of integration testing which is performed after unit testing.
Several stubs and drivers are used to test the modules one after one which helps in
discovering errors and defects in the specific modules.

Advantages of Incremental Testing:


 Each module has its specific significance. Each one gets a role to play during the testing
as they are incremented individually.
 Defects are detected in smaller modules rather than denoting errors and then editing
and re-correcting large files.
 It’s more flexible and cost-efficient as per requirements and scopes.
 The customer gets the chance to respond to each building.

There are 2 Types of Incremental Testing


1. Top-down Integration Testing
2. Bottom-up Integration Testing

1. Top-down Integration Testing


Top-down testing is a type of incremental integration testing approach in which testing
is done by integrating or joining two or more modules by moving down from top to
bottom through the control flow of the architecture structure. In these, high-level
modules are tested first, and then low-level modules are tested. Then, finally,
integration is done to ensure that the system is working properly. Stubs and drivers are
used to carry out this project. This technique is used to increase or stimulate the
behavior of Modules that are not integrated into a lower level.

Advantages Top Down Integration Testing


1. There is no need to write drivers.
2. Interface errors are identified at an early stage and fault localization is also easier.
3. Low-level utilities that are not important are not tested well and high-level testers are
tested well in an appropriate manner.
4. Representation of test cases is easier and simpler once Input-Output functions are
added.

2. Bottom-up Integration Testing


Bottom-up Testing is a type of incremental integration testing approach in which testing
is done by integrating or joining two or more modules by moving upward from bottom
to top through the control flow of the architecture structure. In these, low-level
modules are tested first, and then high-level modules are tested. This type of testing or
approach is also known as inductive reasoning and is used as a synthesis synonym in
many cases. Bottom-up testing is user-friendly testing and results in an increase in
overall software development. This testing results in high success rates with long-lasting
results.

Advantages of Bottom-up Integration Testing:


 It is easy and simple to create and develop test conditions.
 It is also easy to observe test results.
 It is not necessary to know about the details of the structural design.
 Low-level utilities are also tested well and are also compatible with the object-oriented
structure.

Advantages of Integrating Testing


 It helps to identify and resolve issues that may arise when different units of the software
are combined.
 It helps to ensure that the different units of the software work together as intended.
 It helps to improve the overall reliability and stability of the software.
 It’s important to keep in mind that Integration testing is essential for complex systems
where different components are integrated.
As with unit testing, integration testing is only one aspect of software testing and it
should be used in combination with other types of testing such as unit testing,
functional testing, and acceptance testing to ensure that the software meets the needs
of its users

System Testing
System testing is a type of software testing that evaluates the overall functionality and
performance of a complete and fully integrated software solution. It tests if the system
meets the specified requirements and if it is suitable for delivery to the end-users. This
type of testing is performed after the integration testing and before the acceptance
testing. It is a type of software testing that is performed on a completely integrated
system to evaluate the compliance of the system with the corresponding requirements.
In system testing, integration testing passed components are taken as input. The goal of
integration testing is to detect any irregularity between the units that are integrated.

Advantages of System Testing:


 The testers do not require more knowledge of programming to carry out this testing.
 It will test the entire product or software so that we will easily detect the errors or
defects that cannot be identified during the unit testing and integration testing.
 The testing environment is similar to that of the real-time production or business
environment.
 It checks the entire functionality of the system with different test scripts and also it
covers the technical and business requirements of clients.
 After this testing, the product will almost cover all the possible bugs or errors and hence
the development team will confidently go ahead with acceptance testing.

Non-Functional Testing
Non-functional Testing is a type of Software Testing that is performed to verify the non-
functional requirements of the application. It verifies whether the behavior of the
system is as per the requirement or not. It tests all the aspects that are not tested in
functional testing. It checks the non-functional attributes of the system. It is designed to
test the readiness of a system as per nonfunctional parameters which are never
addressed by functional testing. Non-functional testing is as important as functional
testing.

Benefits of Non-functional Testing


 Improved performance: Non-functional testing checks the performance of the system
and determines the performance bottlenecks that can affect the performance.
 Less time-consuming: Non-functional testing is overall less time-consuming than the
other testing process.
 Improves user experience: Non-functional testing like Usability testing checks how easily
usable and user-friendly the software is for the users. Thus, focus on improving the
overall user experience for the application.
 More secure product: As non-functional testing specifically includes security testing that
checks the security bottlenecks of the application and how secure is the application
against attacks from internal and external sources.

Types of Non-functional Testing


1. Performance Testing
2. Usability Testing
3. Compatibility Testing

Performance Testing
Performance Testing is a type of software testing that ensures software applications
perform properly under their expected workload. It is a testing technique carried out to
determine system performance in terms of sensitivity, reactivity, and stability under a
particular workload.
Performance testing is a type of software testing that focuses on evaluating the
performance and scalability of a system or application. The goal of performance testing
is to identify bottlenecks, measure system performance under various loads and
conditions, and ensure that the system can handle the expected number of users or
transactions.
There are 4 Types of Performance Testing
1. Load Testing
2. Stress Testing
3. Scalability Testing
4. Stability Testing

1. Load Testing
Load testing determines the behavior of the application when multiple users use it at
the same time. It is the response of the system measured under varying load conditions.
1. The load testing is carried out for normal and extreme load conditions.
2. Load testing is a type of performance testing that simulates a real-world load on a
system or application to see how it performs under stress.
3. The goal of load testing is to identify bottlenecks and determine the maximum number
of users or transactions the system can handle.
4. It is an important aspect of software testing as it helps ensure that the system can
handle the expected usage levels and identify any potential issues before the system is
deployed to production.

Advantages of Load Testing:


Load testing has several advantages that make it an important aspect of software
testing:
1. Identifying bottlenecks: Load testing helps identify bottlenecks in the system such as
slow database queries, insufficient memory, or network congestion. This helps
developers optimize the system and ensure that it can handle the expected number of
users or transactions.
2. Improved scalability: By identifying the system’s maximum capacity, load testing helps
ensure that the system can handle an increasing number of users or transactions over
time. This is particularly important for web-based systems and applications that are
expected to handle a high volume of traffic.
3. Improved reliability: Load testing helps identify any potential issues that may occur
under heavy load conditions, such as increased error rates or slow response times. This
helps ensure that the system is reliable and stable when it is deployed to production.

2. Stress Testing
In Stress Testing, we give unfavorable conditions to the system and check how it
perform in those conditions.
Example:
1. Test cases that require maximum memory or other resources are executed.
2. Test cases that may cause thrashing in a virtual operating system.
3. Test cases that may cause excessive disk requirement Performance Testing.
It is designed to test the run-time performance of software within the context of an
integrated system. It is used to test the speed and effectiveness of the program. It is also
called load testing. In it, we check, what is the performance of the system in the given
load.
Example:
Checking several processor cycles.

3. Scalability Testing
Scalability Testing is a type of non-functional testing in which the performance of a
software application, system, network, or process is tested in terms of its capability to
scale up or scale down the number of user request load or other such performance
attributes. It can be carried out at a hardware, software or database level. Scalability
Testing is defined as the ability of a network, system, application, product or a process
to perform the function correctly when changes are made in the size or volume of the
system to meet a growing need. It ensures that a software product can manage the
scheduled increase in user traffic, data volume, transaction counts frequency, and many
other things. It tests the system, processes, or database’s ability to meet a growing
need.
Advantages of Scalability Testing:
 It provides more accessibility to the product.
 It detects issues with web page loading and other performance issues.
 It finds and fixes the issues earlier in the product which saves a lot of time.
 It ensures the end-user experience under the specific load. It provides customer
satisfaction.
 It helps in effective tool utilization tracking.
4. Stability Testing
Stability Testing is a type of Software Testing to checks the quality and behavior of the
software under different environmental parameters. It is defined as the ability of the
product to continue to function over time without failure.
It is a Non-functional Testing technique that focuses on stressing the software
component to the maximum. Stability testing is done to check the efficiency of a
developed product beyond normal operational capacity which is known as break point.
It has higher significance in error handling, software reliability, robustness, and
scalability of a product under heavy load rather than checking the system behavior
under normal circumstances.
Stability testing assesses stability problems. This testing is mainly intended to check
whether the application will crash at any point in time or not.
Advantages of Stability Testing:
1. It gives the limit of the data that a system can handle practically.
2. It provides confidence on the performance of the system.
3. It determines the stability and robustness of the system under load.
4. Stability testing leads to a better end-user experience.

Advantages of Performance Testing:


 Performance testing ensures the speed, load capability, accuracy, and other
performances of the system.
 It identifies, monitors, and resolves the issues if anything occurs.
 It ensures the great optimization of the software and also allows many users to use it at
the same time.
 It ensures the client as well as the end-customer’s satisfaction. Performance testing has
several advantages that make it an important aspect of software testing:
 Identifying bottlenecks: Performance testing helps identify bottlenecks in the system
such as slow database queries, insufficient memory, or network congestion. This helps
developers optimize the system and ensure that it can handle the expected number of
users or transactions.

Usability Testing
You design a product (say a refrigerator) and when it becomes completely ready, you
need a potential customer to test it to check it working. To understand whether the
machine is ready to come on the market, potential customers test the machines.
Likewise, the best example of usability testing is when the software also undergoes
various testing processes which is performed by potential users before launching into
the market. It is a part of the software development lifecycle (SDLC).

Advantages and Disadvantages of Usability Testing:


Usability testing is preferred to evaluate a product or service by testing it with the
proper users. In Usability testing, the development and design teams will use to identify
issues before coding and the result will be earlier issues will be solved. During a Usability
test, you can,
 Learn if participants will be able to complete the specific task completely.
 identify how long it will take to complete the specific task.
 Gives excellent features and functionalities to the product
 Improves user satisfaction and fulfills requirements based on user feedback
 The product becomes more efficient and effective

3. Compatibility Testing
Compatibility testing is software testing that comes under the non functional
testing category, and it is performed on an application to check its compatibility
(running capability) on different platforms/environments. This testing is done only when
the application becomes stable. This means simply this compatibility test aims to check
the developed software application functionality on various software, hardware
platforms, networks browser etc. This compatibility testing is very important in product
production and implementation point of view as it is performed to avoid future issues
regarding compatibility.
Advantages of Compatibility Testing:
 It ensures complete customer satisfaction.
 It provides service across multiple platforms.
 Identifying bugs during the development process.

Advantages of Black Box Testing:


 The tester does not need to have more functional knowledge or programming skills to
implement the Black Box Testing.
 It is efficient for implementing the tests in the larger system.
 Tests are executed from the user’s or client’s point of view.
 Test cases are easily reproducible.
It is used to find the ambiguity and contradictions in the functional specifications.

SOFTWARE DEBUGGING
Debugging: Debugging is the process of fixing a bug in the software.
It can be defined as identifying, analyzing, and removing errors.
Bugs are errors, flaws, deficiencies, or defects in a computer program or system that
cause it to produce an incorrect or unexpected result or to behave in unintended ways
which are to be corrected during debugging.
Debugging is often considered a problem for three reasons:
1. The process is too costly (takes too much effort).
2. After debugging, the program still suffers from bugs.
3. When the program is later modified, bugs may turn up in completely unexpected
places.
In general, there are two sources for these problems:
a. Poor program design
b. Poor debugging techniques.
Debugging is carried out through test runs: execution of the program or parts of it with
carefully selected input (so-called test data).

DEBUGGING PROCESS.
1. Examine the error symptoms: The first step is to successfully identify and understand
the symptoms of the issue in your code, such as crashes, error messages, or unexpected
behaviour.
2. Identify the cause: Once the symptoms have been identified, you must then find out the
root cause of the problem. This is done by tracing the code’s execution and discovering
the specific lines that are creating the issue.
Fix the error: Now that the issue has been identified, it’s time to make the necessary
changes or corrections to remove the problem and ensure that the code works
correctly.

DEBUGGING TECHNIQUES
1. Understanding the problem: Before you start making changes to your code, it’s vital
to fully understand the problem you’re trying to solve. Debugging without knowing the
problem will lead to a lot of wasted time and ineffective solutions. Try to reproduce the
issue and gather as much information as you can about its behaviour.
2. Backtracing: Backtracing, or backward debugging, involves starting from the point
where the problem first began and working backwards through the code to find out how
and why it happened. This technique is useful if you’re dealing with complex issues that
are difficult to trace forward.
3. Using debugging tools: There a hundreds of great debugging tools available in your
programming language and environment of choice for you to leverage. These tools help
give valuable insights into how your code is functioning, including variables and memory
usage, which help save a lot of time. Popular debugging tools like Chrome DevTools,
Testsigma, Airbrake, and dbForger are a good place to start depending on your tech
stack. Take a look at some of the best debugging tools out there.
4. Breakpoints and stepping: It’s a good idea to set breakpoints in your code where you
think the issue might be hiding. A breakpoint is where you’re able to temporarily stop
the execution of your program to give you time to inspect the state of its functionality.
Then, use the stepping technique to move through each line of code to study variables
and data structures for problems. This entails manually inspecting each line of code at a
time before moving up or down to the next.
5. Binary search: When faced with a complex problem, consider narrowing down the
scope of the issue into manageable portions. Binary search is where you divide the code
into halves and systematically narrow down the location of the bug. Techniques such as
commenting out code, using print statements, or isolating components can help you
isolate the problem area quickly.
6. Rubber ducking: Many developers find that explaining the problem to someone else
– even an object like a rubber duck – can help you identify the issue yourself. The act of
articulating the problem out loud or written down forces you to think critically about it.
This process often leads to the discovery of new insights and solutions.
7. Log analysis: It’s a good idea to place log analysis statements in strategic areas of
your code to provide valuable information for your debugging investigation. By
understanding more about your code’s execution flow and the values of variables at
different stages, you are better equipped to identify the issue. Check out great log
analysis tools like Sematext Logs, SolarWinds Loggly, and Splunk.
8. Clustering bugs: It’s easier to herd sheep if they’re all in one location, right? The same
goes for bugs. If you receive many error reports, it’s better to group them into classes of
related bugs as bugs in the same class will often share common causes or similar
patterns. Fixing one bug from a class is likely to resolve others or at least give insights
into how to fix them.
9. Take breaks: The debugging process can be mentally taxing, especially when you’re
stuck on a problem. Taking breaks and stepping away from the code for a while can
clear your mind and give you the opportunity to let thoughts and ideas simmer. This can
potentially lead to breakthroughs because returning with a fresh perspective often helps
you see the problem from a different angle.
10. Take notes for learning: As you embark on your debugging journey (of which there
will be plenty), it is not a bad idea to document the process and the solutions you
discover. This serves as a valuable resource for future debugging challenges you might
encounter. Think of it as an experiential chat code to your debugging endeavours.

Assignment
Differentiate between Testing and debugging

You might also like