Software Testing Techniques

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What is the minimum character requirement for a password?

  • 3 characters
  • 6 characters
  • 4 characters (correct)
  • 5 characters

Which of the following is an invalid input for a login ID?

  • ghijklmno
  • ABCD (correct)
  • 1234
  • abcd1234

What type of analysis is used to determine pass or fail for input sizes?

  • Comparative Analysis
  • Boundary Value Analysis (correct)
  • Statistical Analysis
  • Behavioral Analysis

What is the maximum character limit for a login ID?

<p>16 characters (A)</p> Signup and view all the answers

Which character type is NOT accepted in a password?

<p>Upper case letters (A), Special characters (D)</p> Signup and view all the answers

What is the correct format for an account number suffix?

<p>6 digit number (A)</p> Signup and view all the answers

What would be considered an invalid case for a login ID based on character types?

<p>All of the above (D)</p> Signup and view all the answers

What is the requirement for the account number prefix?

<p>Must be a 3-digit number not starting with 0 or 1 (D)</p> Signup and view all the answers

What is the minimum character requirement for a valid password?

<p>4 chars (B)</p> Signup and view all the answers

Which of the following represents a valid case for an account number suffix?

<p>123456 (B)</p> Signup and view all the answers

What happens when the input length is one less than the minimum for the account number suffix?

<p>It fails validation. (C)</p> Signup and view all the answers

Which of the following describes a 'Bug' in software?

<p>A problem encountered by the user during usage. (D)</p> Signup and view all the answers

Which statement is true regarding Equivalence Class Partitions in the context of boundary value analysis?

<p>They focus on both valid and invalid input types. (D)</p> Signup and view all the answers

What defines a 'Defect' in software testing?

<p>A mismatch between expected and actual outcomes. (D)</p> Signup and view all the answers

What is the maximum character length for a valid password?

<p>4 chars (C)</p> Signup and view all the answers

In the context of inspection within document evaluation, which of the following best describes the process?

<p>Reviewing specific elements within the document. (D)</p> Signup and view all the answers

What is the main focus of black-box testing?

<p>Testing the interface and specified functions of the software (D)</p> Signup and view all the answers

Which of the following describes white-box testing?

<p>It tests the internal operations based on control structure design. (C)</p> Signup and view all the answers

What is the primary objective of Basis Path Testing?

<p>To derive execution paths that ensure every statement is executed. (C)</p> Signup and view all the answers

In Flow Graph Notation, what does a predicate node indicate?

<p>It contains a simple conditional expression. (A)</p> Signup and view all the answers

Which statement about edges in flow graphs is correct?

<p>Each edge represents the flow of control in a specific direction. (B)</p> Signup and view all the answers

How does white-box testing ensure the validity of internal data structures?

<p>By executing loops within their operational bounds. (B)</p> Signup and view all the answers

Which statement accurately reflects the purpose of white-box testing?

<p>To examine logical paths through the software for errors. (D)</p> Signup and view all the answers

Why are regions important in flow graph analysis?

<p>They include the area outside the graph as a separate entity. (A)</p> Signup and view all the answers

What is the main focus of boundary value analysis?

<p>Testing inputs specifically at the edges of a class (D)</p> Signup and view all the answers

When designing test cases for an input range of 8-12 characters, which value would not be considered valid?

<p>13 characters (C)</p> Signup and view all the answers

According to the guidelines for boundary value analysis, which of the following scenarios is most complete?

<p>Testing numbers just above and just below the minimum and maximum values (B)</p> Signup and view all the answers

What would be an appropriate test case for an invalid input condition that specifies a password length must be between 8 and 12 characters?

<p>Password length of 7 characters (B)</p> Signup and view all the answers

If the valid user ID length is between 4 and 16 characters, what should be included in test cases based on the boundary value analysis?

<p>Testing user IDs of lengths 4, 16, 7, and 10 (A)</p> Signup and view all the answers

Which of the following best describes internal program data structures in the context of boundary value analysis?

<p>Test cases should be designed to exercise them at their minimum and maximum boundaries. (D)</p> Signup and view all the answers

What is a key component of equivalence partitioning that complements boundary value analysis?

<p>Dividing input data into valid and invalid partitions (B)</p> Signup and view all the answers

In design guidelines for boundary value analysis, when should values just above and just below be tested?

<p>For both input and output conditions to ensure thorough testing (A)</p> Signup and view all the answers

What is the primary purpose of cyclomatic complexity in software testing?

<p>To provide a quantitative measure of logical complexity (B)</p> Signup and view all the answers

Which formula can be used to compute cyclomatic complexity based on the number of edges and nodes?

<p>V(G) = E - N + 2 (C)</p> Signup and view all the answers

What defines an independent program path?

<p>A path that introduces at least one new set of processing statements (D)</p> Signup and view all the answers

How many independent paths are defined in the basis set shown?

<p>4 (B)</p> Signup and view all the answers

Which of the following formulas represents the number of independent paths based on predicate nodes?

<p>V(G) = P + 1 (A)</p> Signup and view all the answers

What would not be counted as a new edge in independent paths?

<p>Traversing a previously traversed edge (C)</p> Signup and view all the answers

In equivalence partitioning, how many classes are created when an input condition specifies a member of a set?

<p>One valid class and one invalid class (A)</p> Signup and view all the answers

What does the number of regions in a flow graph correspond to in terms of cyclomatic complexity?

<p>The cyclomatic complexity value (A)</p> Signup and view all the answers

If the number of nodes in a graph is 9 and the number of edges is 11, what is the cyclomatic complexity?

<p>4 (C)</p> Signup and view all the answers

What does equivalence partitioning not consider when creating input classes?

<p>The shape of the input data (A)</p> Signup and view all the answers

Flashcards

White-box testing

A testing method that examines the internal workings of a software component. It focuses on testing the internal logic, code paths, and data structures.

Black-box testing

A testing method that examines the software from the user's perspective, focusing on the functionality of the software as a whole without considering its internal workings.

Basis Path Testing

A white-box testing technique that finds a set of execution paths to ensure every statement in a program is executed at least once.

Flow Graph Notation

A visual representation used in white-box testing to map the control flow of a program. Circles (nodes) represent code segments, and arrows (edges) represent control flow.

Signup and view all the flashcards

Predicate Node

A node in a flow graph that represents a conditional statement or decision point (e.g., if-then-else).

Signup and view all the flashcards

Control Structure

The parts of the software design that specify how different steps or pieces of code are connected and run sequentially.

Signup and view all the flashcards

Region (in flow graph)

An area in a flow graph that is bounded by edges. Understanding regions helps in coverage of paths while testing.

Signup and view all the flashcards

Edge(in flow graph)

A line in a flow graph showing flow of control between different sections of the code.

Signup and view all the flashcards

Boundary Value Analysis

A test case design method that focuses on testing the edges of input and output domains to uncover potential errors.

Signup and view all the flashcards

Input Domain

The set of all possible valid inputs that a software component can accept.

Signup and view all the flashcards

Output Domain

The set of all possible valid outputs that a software component can produce.

Signup and view all the flashcards

Valid Input Class

A group of inputs that are considered valid according to the software's requirements.

Signup and view all the flashcards

Invalid Input Class

A group of inputs that are considered invalid according to the software's requirements.

Signup and view all the flashcards

Test Case for Boundary Value Analysis

A specific set of inputs and expected outputs designed to test the edges of input and output domains.

Signup and view all the flashcards

Minimum Boundary Value

The smallest valid value within an input or output range.

Signup and view all the flashcards

Maximum Boundary Value

The largest valid value within an input or output range.

Signup and view all the flashcards

Independent Path

A path through a program that introduces at least one new set of processing statements or a new condition, traveling on an edge not traversed before.

Signup and view all the flashcards

Basis Set

A group of independent paths in a flow graph representing all possible execution paths.

Signup and view all the flashcards

Cyclomatic Complexity

A quantitative measure of the logical complexity of a program, determining the number of independent paths.

Signup and view all the flashcards

V(G) Formula

V(G) = E - N + 2, where E is the number of edges, N is the number of nodes in a flow graph.

Signup and view all the flashcards

Equivalence Classes

Groups of input values that are expected to produce the same output, used in equivalence partitioning testing.

Signup and view all the flashcards

Equivalence Partitioning

A testing technique where input values are divided into equivalence classes to cover different scenarios.

Signup and view all the flashcards

Valid Equivalence Class

A group of input values that are expected to produce the desired output based on the program's specification.

Signup and view all the flashcards

Invalid Equivalence Class

A group of input values that are expected to produce an error or unexpected output based on the program's specification.

Signup and view all the flashcards

Boolean Equivalence Classes

For input conditions that are boolean (true/false), two equivalence classes are defined: one for true and one for false values.

Signup and view all the flashcards

Boundary Value Analysis (BVA)

A testing technique where you test values at the edge of the valid input range and just outside of it.

Signup and view all the flashcards

Equivalence Class Partitioning (ECP)

A testing technique where you divide input data into groups (classes) that are likely to behave the same way. You then choose a representative value from each class to test.

Signup and view all the flashcards

Valid Cases

Inputs that are expected to be accepted by the system.

Signup and view all the flashcards

Invalid Cases

Inputs that are expected to be rejected by the system.

Signup and view all the flashcards

Minimum

The smallest valid value allowed for an input.

Signup and view all the flashcards

Maximum

The largest valid value allowed for an input.

Signup and view all the flashcards

Minimum-1

A value just below the smallest valid value allowed for an input.

Signup and view all the flashcards

Maximum+1

A value just above the largest valid value allowed for an input.

Signup and view all the flashcards

Error

A mistake in the code that results in incorrect behavior of the program.

Signup and view all the flashcards

Defect

A mismatch between the expected and actual behavior of the software, typically found by a tester.

Signup and view all the flashcards

Study Notes

Software Testing Techniques

  • White-box testing and black-box testing are two software testing techniques.

Two Unit Testing Techniques

  • Black-box testing: Focuses on the function of a product, not its internal structure. Tests if the specified function is fully operational and error-free. Includes tests at the software interface. Also known as functional testing or behavioral testing.

  • White-box testing: Examines the internal workings of a product. Ensures that internal operations match specifications, and all internal components are exercised. Focuses on procedural details, logical paths, and specific conditions/loops. Also called structural testing or glass-box testing.

White-box Testing

  • Uses the control structure of component-level design to create test cases.
  • Guarantees all independent paths in a module are exercised at least once.
  • Exercises every logical decision (true and false sides).
  • Executes all loops at their boundaries.
  • Tests internal data structures for validity.

Basis Path Testing

  • A white-box testing technique by Tom McCabe.
  • Derives a logical complexity measure from a procedural design.
  • Uses this measure as a guide for defining a basis set of execution paths.
  • Test cases derived to exercise the basis set execute every statement in the program at least once.

Flow Graph Notation

  • A circle in a graph is a node representing a sequence of one or more procedural statements.
  • A node with a conditional expression is a predicate node.
  • Each compound condition (multiple Boolean operators) is a separate predicate node.
  • A predicate node has two edges (True and False).
  • An edge (link) shows flow of control.
  • Edges do not intersect or cross other edges.
  • Areas bounded by edges/nodes are regions.

Independent Program Paths

  • A path from the start node to the end node that introduces at least one new set of statements/conditions.
  • Must traverse at least one new edge compared to previous paths.

Cyclomatic Complexity

  • A quantitative measure of the logical complexity of a program.
  • Defines the number of independent paths in the basis set.
  • Provides an upper bound for the required test cases.
  • Calculated in three ways:
    • Number of regions.
    • V(G) = E - N + 2 where E = edges, and N = nodes.
    • V(G) = P + 1 where P = predicate nodes.

Deriving the Basis Set and Test Cases

  • Use the program design or code to draw a flow graph.
  • Determine the cyclomatic complexity of the resultant flow graph.
  • Create a basis set of linearly independent paths.
  • Create test cases that force each path to execute.

Black-box Testing

  • Complements white-box testing by uncovering different classes of errors.
  • Focuses on functional requirements and the information domain of a software program.
  • Utilizes in latter testing stages, after white-box testing.
  • Identifies input conditions to fully exercise all functional requirements.

Black-box Testing Categories

  • Incorrect or missing functions.
  • Interface errors.
  • Errors in data structures or external data access.
  • Behavior or performance errors.
  • Initialization and termination errors.

Equivalence Partitioning

  • A black-box testing technique dividing input domain into classes.
  • Ideal for reducing total test cases.
  • Based on equivalence classes for valid and invalid input conditions.
  • Selects test cases from each equivalence class to exercise the largest number of attributes.

Guidelines for Defining Equivalence Classes

  • Range input conditions have one valid range and two invalid ranges.
  • Specific value input conditions have one valid and two invalid values.
  • Sets of values have one valid set and one invalid set.
  • Boolean values have one valid and one invalid Boolean condition.

Boundary Value Analysis

  • A black-box testing technique focusing on boundaries of input domain.
  • Complements equivalence partitioning.
  • Selecting test cases at the edges of classes, from both input and output domains.

Guidelines for Boundary Value Analysis

  • Test cases for input ranges include values at the boundaries and just above/below these boundaries.
  • Test cases for input values include minimum, maximum values and just above and below the values.
  • Test output values analogous to input values.
  • Test to stress data structures, by testing at minimum and maximum boundaries.

Walkthrough, Inspection & Peer Review

  • Walkthrough: Study of a document for completeness/correctness, from beginning to end.
  • Inspection: Focus on a specific aspect within a document.
  • Peer Review: Comparison of two similar documents for completeness/correctness.

Error, Defect & Bug

  • Error: A coding mistake found by the developer.
  • Defect: A mismatch between expected and actual software behaviour, found by the tester (also called issue or flaw).
  • Bug: A problem in software during use, found by customers or users.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Software Testing Basics
0 questions
Software Testing Techniques
40 questions
Tests Boîte Noire vs Boîte Blanche
50 questions
Use Quizgecko on...
Browser
Browser