UFT PRELIM

Software Testing

-ensuring that the “cake” (software) behaves as expected, has no defects, and delivers a quality experience to the user.

Types of Software Testing

Manual Testing: Like tasting each slice yourself to check for quality.

Automated Testing: Like having a robot that slices the cake, checks the texture, and even measures moisture content consistently—without human error.

Types of Manual Testing

White Box Testing

    ○ White Box Testing is a software testing technique that involves testing the internal structure and workings of a software application. 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.

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.

Gray Box Testing

    ○ Gray Box Testing is a software testing technique that is a combination of the Black Box Testing technique and the White Box Testing technique.

Types of White Box Testing

1. Path Testing

2. Loop testing

3. Unit Testing as White-box Testing

4. Mutation Testing

5. Integration Testing as White-box Testing

6. Penetration testing

Types of Black Box Testing

1. Functional Testing

2. Non-Functional Testing

3. Regression Testing

Types of Gray Box Testing

1. Matrix Testing

2. Pattern Testing

3. Orthogonal Array Testing

4. Regression Testing as Black-box Testing

5. State transition Testing

6. Data Flow Testing

What is Test Automation?

The Need for Automation

Manual testing is time-consuming, especially when you have to repeat tests. Imagine you have to bake and test 100 cakes every day. That’s where test automation comes in.

Unified Functional Testing (UFT), formerly known as QuickTest Professional (QTP), is a test automation tool by Micro Focus

Key Features of UFT

1. Automates Functional & Regression Testing:

    a. Ensures the application works after changes (regression) and meets original requirements (functional).

2. Supports Multiple Technologies:

    a. Can interact with web apps, desktop apps, APIs, databases, etc.

3. Script in VBScript:

    a. Test scripts are written in VBScript, a simple scripting language.

4. Data-Driven Testing:

    a. Like checking if different cake flavors bake correctly using the same baking process—UFT can test multiple data sets efficiently

Imagine UFT as a Factory

Conveyor Belt (Test Execution Engine): Moves test cases through different stages—running them one after another.

Robot Arms (Object Repository): Knows how to interact with specific parts of the application (buttons, text fields, etc.).

Control Room (Test Scripts): The brain that tells the robots what actions to perform.

Main Components

1. Test Scripts (VBScript):

    a. Instructions written to tell UFT what to do (like “click the login button,” “enter username,” etc.).

2. Object Repository (OR):

    a. Think of this as a dictionary where UFT stores information about all the UI elements (buttons, text boxes) it needs to interact with.

3. Keyword-Driven Framework:

    a. For non-programmers, UFT offers a table-like view where you can define actions without writing code, using predefined keywords (e.g., "Click," "Input," "Verify").

4. Test Execution Engine:

    a. Runs the scripts, performs actions, and compares the actual results with the expected ones.

5. Results Viewer:

    a. Like a report card showing which tests passed, which failed, and why.

Frameworks in UFT

Frameworks are like recipes—structured ways to organize your tests for better efficiency.

Linear Framework: Simple, step-by-step scripts (good for small tests).

Modular Framework: Breaks tests into reusable parts (like functions).

Data-Driven Framework: Tests the same flow with different data sets.

Keyword-Driven Framework: Uses keywords for actions (easy for non-coders).

Hybrid Framework: A mix of the above for flexibility

Advantages of UFT

Cross-platform support (Web, Desktop, APIs).

Data-driven testing for efficient validation.

Strong integration with tools like ALM (Application Lifecycle Management).

Reusable scripts reduce maintenance costs.

A script is a set of instructions or commands written in a scripting language, which is then executed by an interpreter or scripting engine.

A class defines what an object should look like, and an object is created based on that class.

All classes have a method called __init__(), which is always executed when the class is being initiated.

Inheritance allows us to define a class that inherits all the methods and properties from another class.

Parent class is the class being inherited from, also called base class.

Child class is the class that inherits from another class, also called derived class.

The super() Function Python also has a super() function that will make the child class inherit all the methods and properties from its parent.

The word "polymorphism" means "many forms", and in programming it refers to methods/functions/operators with the same name that can be executed on many objects or classes.

frozenset is an immutable version of a set.

The match statement is used to perform different actions based on different conditions.

Consider a module to be the same as a code library.

Why We Unit Test

The Philosophy of Verification: Unit testing involves isolating the smallest "units" of code (functions or methods) to verify they perform exactly as intended.

The Bug Prevention Shield: Catching regressions early in the development cycle reduces the cost of fixing errors by orders of magnitude.

Documentation by Design: Well-written tests serve as "living documentation," demonstrating how a function is expected to behave under various inputs.

Refactoring Confidence: Developers can rewrite internal logic to optimize performance, knowing that the test suite will immediately flag any broken functionality. ● Isolation: A true unit test does not depend on external databases, APIs, or filesystems; it focuses purely on logic.

The Four Pillars of the unittest Framework

● Architecture of a Test Suite: The unittest module is built upon four fundamental concepts derived from the Smalltalk SUnit architecture:

1. Test Fixture: The preparation needed to perform a test (e.g., creating temporary directories, proxying databases, or initializing specific objects).

2. Test Case: The individual unit of testing. It checks for a specific response to a particular set of inputs. unittest provides a base class, TestCase, to create new test cases.

3. Test Suite: A collection of test cases, test suites, or both. It is used to aggregate tests that should be executed together.

4. Test Runner: A component which orchestrates the execution of tests and provides the outcome to the user (e.g., through a graphical interface or standard output).

The Software Development Life Cycle (SDLC) is the structured framework used to design, develop, and test high-quality software. It provides visibility, quality control, and risk management throughout the entire process of software production.

Planning & Requirement Analysis - Feasibility studies and project planning.

Defining Requirements - Documenting specifications in an SRS document.

Designing Architecture - Creating the technical blueprint (HLD & LLD).

Development - Writing the code

Testing - Finding defects before release

Deployment - Releasing the software to users.

Maintenance - Bug fixing, updates, and enhancements post-release.

The Software Testing Life Cycle (STLC) is a dedicated process that runs in parallel with the SDLC, focusing exclusively on verifying and validating software quality. It ensures that testing is methodical, repeatable, and comprehensive.

1. Requirement Analysis

- The QA team understands what needs to be tested by reviewing the requirements.

2. Test Planning

- The test strategy, scope, environment, and resources are defined.

3. Test Case Development

- Testers design and write detailed test cases and prepare test data.

4. Test Environment Setup

- The necessary hardware, software, and network conditions are configured.

5. Test Execution

- The team runs the test cases, logs defects, and records results.

6. Test Closure

- Test activities are formally completed, and a Test Summary Report is prepared.

The Four Levels of Testing

Acceptance Testing

- The final stage where end-users or clients validate that the software meets their business needs.

System Testing

- Testing the complete, integrated software as a whole to ensure it meets specified requirements.

Integration Testing

- Checking that different software modules can collaborate and exchange data correctly.

Unit Testing

- Verifying the smallest individual components of the code in isolation.

The Three Paradigms of Testing

Black Box Testing

Knowledge: None. The tester has no knowledge of the internal code, structure, or implementation details.

Focus: Validating the functionality of the software based on requirements. Testing from the end-user's point of view.

White Box Testing

Knowledge: Complete. The tester has full knowledge of and access to the source code, architecture, and design.

Focus: Ensuring the internal code is correct, efficient, and secure. Testing the logic and structure of the code itself.

Grey Box Testing

Knowledge: Partial. The tester has limited knowledge of the internal structure, such as access to databases or APIs, but not the full source code.

Focus: A combination of Black and White box testing, often used for integration or API testing.

Key Focus Areas

Functional Requirements: Does the software perform the tasks it was designed for? User Interface (UI): Is the application easy to navigate and use?

Input Validation & Error Handling: How does the system handle both valid and invalid inputs?

Security & Performance: Checking for vulnerabilities and assessing behaviour under load.

Compatibility: Does it work across different browsers, devices, and operating systems?

The Two Pillars of Black Box Testing

1. Functional Testing

Verifies that each function of the software works in conformance with the requirements. It tests what the system does.

2. Non-Functional Testing

Verifies non-functional aspects like performance, usability, and reliability. It tests how well the system does it.

Core Techniques for Black Box Functional Testing

Technique 1: Equivalence Partitioning

Concept: Divides the input data into partitions or 'equivalence classes' of data from which test cases can be derived. The assumption is that if one value in a partition works, all values will.

Technique 2: Boundary Value Analysis (BVA)

Concept: An extension of Equivalence Partitioning that focuses on testing the 'boundaries' or edges of the partitions, as this is where errors are most likely to occur.

Technique 3: Decision Table Testing

Concept: A systematic approach to testing complex business logic. It maps various input conditions to their corresponding system actions in a tabular format, ensuring all combinations of rules are tested.

Key White Box Testing Techniques

Branch Testing: Ensures that each possible branch from each decision point (e.g., if/else statements) is executed at least once.

Control Flow Testing: Uses a program's control flow graph to test the logic of the code and ensure path coverage.

Data Flow Testing: A structural testing method that examines how variables are defined and used throughout a program to find anomalies (e.g., a variable used before it's defined)

The Path to Excellence: The Test Maturity Model (TMМ)

The Test Maturity Model (TMM) is a framework for assessing and improving an organisation's software testing processes. It provides a structured path for moving from chaotic, ad-hoc testing to a fully optimised and proactive quality culture.

Initialisation

- Testing is chaotic and ad-hoc. There are no defined processes, and success depends on individual heroics.

Definition

- Basic testing processes are defined and documented. Test strategies, plans, and cases are created.

Integration

- Testing becomes an integrated part of the Software Development Life Cycle (SDL.C) and is recognised as a distinct, independent phase. Risk management is introduced.

Measurement and Management

- Testing is a measured and managed process. Reviews are conducted for requirements and design, and quality is quantified.

Optimisation

- The focus shifts to continuous process improvement and defect prevention. The process is optimised with feedback loops and the use of advanced tools.