Module 2-1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Module 5

1. what is testing? Explain different testing methods (15marks)

Answer
In software engineering, testing is a critical phase that involves the process of evaluating and
verifying that a software application or system meets specified requirements and functions
correctly. It aims to identify defects or issues within the software, ensuring that the product is of
high quality and performs as expected.

There are several key aspects and types of software testing:

1. Unit Testing: Involves testing individual components or modules of the software to


ensure that each part functions correctly in isolation.
2. Integration Testing: Focuses on testing the interactions between different
components or systems to verify that they work together as intended.
3. System Testing: Entails testing the complete integrated system to evaluate its
compliance with the specified requirements.
4. Acceptance Testing: Performed to determine whether the system meets the
business requirements and is ready for deployment. This includes alpha and beta testing.
5. Regression Testing: Ensures that new code changes do not adversely affect the
existing functionality of the software.
6. Performance Testing: Assesses the speed, responsiveness, and stability of the
software under a particular workload.
7. Security Testing: Identifies vulnerabilities, threats, and risks in the software to
prevent malicious attacks and ensure data protection.
8. Usability Testing: Evaluates the user interface and user experience to ensure the
software is intuitive and easy to use.
9. Automated Testing: Utilizes software tools to execute tests automatically, which is
particularly useful for repetitive tasks and regression testing.
10. Manual Testing: Involves human testers performing test cases without the
assistance of automated tools, focusing on exploratory, usability, and ad-hoc testing.

Effective testing helps to improve the quality, reliability, and performance of software, reducing the
risk of failures and ensuring that the final product meets the expectations of its users.

2. Why should we test?

Answer
We test a software because testing is a crucial part of the software development lifecycle that
helps ensure the final product is functional, secure, and meets the expectations of its users and
stakeholders.

3. Define the terms-error,mistake,bug,fault,failure

Answer
Error
error is defined as a human action that produces an incorrect result , leading to a flaw or defect in
the software. This term encompasses mistakes made during the various stages of software
development, including design, coding, and configuration.

Mistakes
mistake is defined as a human error or oversight made during any phase of the software
development process. These mistakes can lead to defects or bugs in the software if not identified
and corrected

Bug
a bug is a flaw or fault in a software program that causes it to produce incorrect or unintended
results, or to behave in unintended ways

Fault
fault (also known as a defect) is a flaw or imperfection in a software product that, if executed, may
cause the system to fail to perform its required functions. Faults are introduced during various
stages of the software development

Failure
failure is defined as an event in which a software system or application does not perform its
intended function or deliver the required outcomes according to specified requirements

4. Define the terms-test,test cases & test suite

Answer
Test
test refers to an evaluation process used to determine whether a software application behaves as
expected. It is done by executing the software with a set of inputs and comparing the actual
outputs with the expected results.

Test cases
test case is a specific set of conditions or inputs under which a tester determines whether a
software is working correctly.

Test suite
test suite refers to a collection or set of test cases that are used to test a software application or
system.

5. Differentiate verification and validation

Answer

Verification and validation are both important processes in software engineering that aim to
ensure the quality and correctness of software. Here’s how they differ:

1. Verification:
• Definition: Verification refers to the process of evaluating work products of a
development phase to determine whether they meet the specified requirements.
• Focus: It focuses on assessing whether the software product conforms to its
design and specification documents.
• Objective: The main goal is to answer “Are we building the product right?” It
ensures that the software is being developed correctly according to the defined standards and
requirements.
• Examples: Examples of verification activities include reviews, walkthroughs,
inspections, and static analysis. These activities examine the software artifacts such as
requirements specifications, design documents, code, and test plans to find errors,
inconsistencies, or deviations from standards.

2. Validation:
• Definition: Validation, on the other hand, refers to the process of evaluating
software during or at the end of the development process to determine whether it satisfies
specified requirements.
• Focus: It focuses on assessing whether the software fulfills the intended use and
user needs in its operational environment.
• Objective: The main goal is to answer “Are we building the right product?” It
ensures that the software meets the customer’s expectations and needs.
• Examples: Examples of validation activities include testing the software with real
data and in real environments to check if it behaves as expected, meets user requirements, and
solves the intended problem. This includes functional testing, performance testing, usability
testing, and acceptance testing.

Key Differences:
• Purpose
Verification ensures that the software is developed correctly according to the defined
specifications.

validation ensures that the software meets the user’s actual needs and expectations.
• Focus
Verification focuses on the software artifacts and processes, ensuring consistency and
correctness throughout development.

Validation focuses on the end product, confirming that it works as intended in the real world.
• Timing
Verification activities are typically carried out during the development phase.

validation activities are often carried out towards the end of the development cycle or during
testing phases.
• Methods
Verification often involves static methods like reviews and inspections.

validation involves dynamic methods such as testing and prototyping.

In summary, verification ensures that the software is built correctly according to specifications,
while validation ensures that the right product is built to meet user needs and expectations. Both
processes are essential for delivering high-quality software that meets both technical and user
requirements.

6. Alpha,beta,acceptance testing,unit testing,integration testing,black box testing,white box


testing,validation testing,structural testing,regression testing,system testing (2/5/15 marks)

Answer
Alpha
It is a stage in the software development lifecycle where a preliminary version of a software
product is tested by internal teams or selected users before it is released to a wider audience.
This stage typically follows the completion of the initial development phase and precedes the beta
testing phase.

Beta
phase in the software development lifecycle where a pre-release version of the software is made
available to a larger group of users for testing. This phase comes after the alpha testing stage and
aims to gather feedback from real users in real-world environments before the final release of the
software.

Acceptance testing
Acceptance Testing: Performed to determine whether the system meets the business
requirements and is ready for deployment. This includes alpha and beta testing.

integration testing
Focuses on testing the interactions between different components or systems to verify that they
work together as intended.

Black box testing


Black box testing is a software testing technique where the internal structure, design, or
implementation of the software being tested is not known to the tester. In other words, the tester
treats the software as a “black box” where they are only aware of the inputs and expected
outputs, without any knowledge of how the system processes those inputs to produce outputs.

White box testing


software testing technique where the internal structure, design, and implementation of the
software being tested are known to the tester. Unlike black box testing where testers focus on the
external behavior of the software, white box testing examines the internal workings of the
application, including its code structure, branches, paths, and data flows.

Validation testing
process of evaluating software to ensure that it satisfies or complies with the specified business
requirements and meets the intended use in its operational environment. Validation testing is often
performed towards the end of the development lifecycle and is aimed at verifying that the
software meets user needs and expectations.

Structural testing
type of testing that examines the internal structure or implementation of a software application. It
is also known as white box testing or glass box testing. Unlike black box testing, which focuses
on testing based on external specifications and requirements, structural testing is concerned with
testing the internal code, paths, and logic of the software.

Regression testing
Ensures that new code changes do not adversely affect the existing functionality of the software.

System testing
Entails testing the complete integrated system to evaluate its compliance with the specified
requirements.

7. What are different types of testing tools (static & dynamic )


Answer
Testing tools in software engineering can be broadly categorized into static testing tools and
dynamic testing tools, each serving different purposes in the software development lifecycle.
Here’s an overview of these categories and some examples of tools within each:

Static Testing Tools:


Static testing tools analyze code, documentation, or other artifacts without executing the
software. They focus on finding defects and improving code quality through reviews, inspections,
and analysis.

>> 1. Code Review Tools:


• GitHub Code Review: Built-in code review features in GitHub allow developers to
review code changes collaboratively.
• GitLab Merge Requests: Similar to GitHub, GitLab also provides code review
capabilities through merge requests.
• Phabricator: An open-source software development platform that includes code
review tools among other features.
>>2. Static Analysis Tools:
• SonarQube: A continuous inspection tool for code quality and security.
• PMD: A source code analyzer that detects common programming flaws.
• FindBugs: A Java static analysis tool for identifying bugs in Java code.
>>3. Documentation Analysis Tools:
• Doxygen: Generates documentation from source code comments.
• Javadoc: Generates API documentation in HTML format from Java source code.

Dynamic Testing Tools:


Dynamic testing tools execute software and evaluate its behavior during runtime. They focus on
functional, performance, and usability aspects of the software.

>>1. Unit Testing Frameworks:


• JUnit (Java): A popular unit testing framework for Java.
• NUnit (.NET): A unit testing framework for .NET languages like C#.
• pytest (Python): A testing framework for Python programs.
>>2. Functional Testing Tools:
• Selenium: A framework for automating web browsers for testing web applications.
• Cypress: A front-end testing tool for testing web applications.
• SoapUI: An open-source tool for functional and load testing of SOAP and RESTful
web services.
>>3. Performance Testing Tools:
• JMeter: An open-source tool for load and performance testing.
• Gatling: A load testing tool focused on web applications.
• LoadRunner: A performance testing tool by Micro Focus for testing applications
under load.
>>4. Security Testing Tools:
• OWASP ZAP (Zed Attack Proxy): A security testing tool for finding vulnerabilities in
web applications.
• Burp Suite: A platform for performing security testing of web applications.
• Nessus: A vulnerability assessment tool for network scanning.
>>5. GUI Testing Tools:
• TestComplete: A functional testing platform for GUI, mobile, web, and API testing.
• Robot Framework: A generic test automation framework for acceptance testing
and ATDD (Acceptance Test-Driven Development).
>>6. Integration Testing Tools:
• Postman: A collaboration platform for API development and testing.
• REST Assured: A Java library for testing RESTful APIs.
These tools are essential for automating testing processes, ensuring software quality, and
detecting defects early in the development lifecycle. Depending on the specific testing needs and
objectives, different combinations of these tools can be used to achieve comprehensive test
coverage and ensure the reliability and performance of software applications.

8. What do you meant by debugging. Explain different debugging methods. (5/2 marks)

Answer

debugging refers to the process of identifying, analyzing, and fixing defects, bugs, or issues within
a software application. The goal of debugging is to locate the root cause of unexpected behavior
or errors in the software and then resolve them to ensure the software operates correctly and
meets its intended functionality

Different Debugging Methods:


1. Print Statements / Logging:
• Description: Developers insert print statements or logging statements at specific
points in the code to output values of variables, trace program flow, or indicate the occurrence of
certain events.
• Advantages: Simple and easy to implement. Provides immediate feedback on
variable values and execution flow.
• Disadvantages: Can be intrusive and may require cleanup after debugging. May not
be suitable for complex debugging scenarios.
2. Breakpoints and Stepping:
• Description: Developers set breakpoints in the code using an integrated
development environment (IDE) or debugger. When the program execution reaches a breakpoint,
it pauses, allowing developers to inspect variables, stack traces, and other runtime information.
Stepping allows developers to execute the code line-by-line or through function calls.
• Advantages: Provides precise control over program execution. Facilitates thorough
inspection of program state and control flow.
• Disadvantages: Breakpoints can alter program behavior. Debugging in distributed
or production environments may be challenging.
3. Interactive Debugging with IDEs:
• Description: Integrated development environments (IDEs) provide interactive
debugging features such as variable inspection, call stack navigation, and real-time code
execution monitoring. Developers can interactively explore and modify variables during debugging
sessions.
• Advantages: Offers a comprehensive set of debugging tools within a familiar
development environment. Facilitates efficient debugging of complex issues.
• Disadvantages: Can be resource-intensive. Debugging sessions may require
significant memory and processing power.
4. Remote Debugging:
• Description: Debugging techniques that allow developers to debug software
running on remote machines or environments. This may involve remote debugging tools or
debugging protocols that facilitate debugging across different locations or environments.
• Advantages: Enables debugging of applications deployed in production or
distributed environments. Supports collaboration among developers working in different locations.
• Disadvantages: Requires secure connections and protocols. Debugging overhead
may impact application performance.
5. Memory Debugging and Profiling:
• Description: Tools and techniques used to detect memory-related issues such as
memory leaks, buffer overflows, or excessive memory usage. Memory profiling tools analyze
memory allocation patterns and usage statistics to optimize memory management and identify
potential issues.
• Advantages: Ensures efficient memory usage and stability of the software. Helps in
optimizing performance by identifying memory-intensive operations.
• Disadvantages: Requires specialized knowledge of memory management. Profiling
tools may introduce overhead and affect program behavior.
6. Code Reviews and Inspections:
• Description: Peer code reviews or formal inspections where developers
systematically examine code to identify defects, potential vulnerabilities, or adherence to coding
standards. Code reviews can uncover issues that may not be caught during testing or debugging
sessions.
• Advantages: Facilitates early detection of defects and promotes code quality
improvement. Enhances knowledge sharing and collaboration among team members.
• Disadvantages: Time-consuming, especially for large codebases. Requires active
participation and coordination among team members.
7. Automated Testing and Test-Driven Development (TDD):
• Description: Automated tests, including unit tests, integration tests, and regression
tests, are written to validate software behavior and functionality. Test-driven development (TDD)
involves writing tests before writing code, helping to identify defects early in the development
process.
• Advantages: Ensures code correctness and reliability through automated
validation. Facilitates continuous integration and deployment practices.
• Disadvantages: Initial setup and maintenance of automated tests can be time-
consuming. Requires careful selection and design of test cases to achieve comprehensive
coverage.

These debugging methods are essential for maintaining software quality, ensuring reliability, and
delivering a positive user experience. Depending on the nature of the issue, development
environment, and available tools, developers may employ one or more debugging methods to
effectively diagnose and resolve software defects.

You might also like