Software Testing Concepts Quiz
29 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the primary goal of structural testing in software development?

The primary goal of structural testing is to test as much of the program as possible.

In the context of a directed graph, what do nodes and edges represent?

Nodes represent sequential statements or blocks of code, while edges represent the transfer of processing control.

Define 'test coverage' and its importance in software testing.

Test coverage is the minimal set of test cases that ensure certain criteria are satisfied, and it is important to determine how effectively a set of tests validates the program.

What is statement testing, and how does it relate to code execution?

<p>Statement testing involves designing test cases to execute every source statement in the software at least once.</p> Signup and view all the answers

Explain how iterations (loops) affect the concept of paths in a directed graph.

<p>Iterations introduce multiple unique routes as each loop iteration can be considered a different path.</p> Signup and view all the answers

Define software testing in your own words.

<p>Software testing is the process of evaluating and verifying that a piece of software meets its pre-determined purpose.</p> Signup and view all the answers

Explain the difference between an error and a fault in software.

<p>An error is a mistake made by a person, while a fault is a defect in the software caused by that error.</p> Signup and view all the answers

What is the purpose of a good test case?

<p>A good test case is designed to have a high probability of detecting any undiscovered errors in the software.</p> Signup and view all the answers

What is meant by 'structural testing'?

<p>Structural testing, also known as white-box or glass-box testing, involves testing based on the internal code structure of the software.</p> Signup and view all the answers

Describe what a test plan should include.

<p>A test plan should include the testing approach, responsibilities, specific tests to run, and organization of the testing effort.</p> Signup and view all the answers

How does a fault relate to software failure?

<p>A fault may cause a software failure, but it does not always lead to one, as failure is the observed departure from expected behavior.</p> Signup and view all the answers

What is the significance of testing at various stages of software development?

<p>Testing at different stages helps identify defects early, ensuring better quality and reducing costs related to fixing errors later.</p> Signup and view all the answers

What does 'fit for purpose' imply in terms of software quality?

<p>'Fit for purpose' means that the software meets and exceeds the outlined requirements effectively.</p> Signup and view all the answers

What is branch testing and how many tests are required to cover both outcomes for the given code example?

<p>Branch testing ensures each decision has both TRUE and FALSE outcomes executed. In the example, 2 tests are sufficient.</p> Signup and view all the answers

In condition testing, how many test cases are needed to cover all conditions in the expression '(A || B) && C'?

<p>Three test cases are necessary to cover all conditions: A TRUE, B TRUE; A FALSE, B TRUE, C TRUE; A FALSE, B FALSE.</p> Signup and view all the answers

Explain decision/condition testing and its significance.

<p>Decision/condition testing requires that both each condition and each decision outcome are executed at least once, ensuring robust testing of logic.</p> Signup and view all the answers

What is the goal of multiple condition testing?

<p>The goal of multiple condition testing is to design test cases that invoke all possible combinations of TRUE and FALSE outcomes in each decision.</p> Signup and view all the answers

Define path testing in the context of program execution.

<p>Path testing involves designing test cases that execute each unique path from start to end within the program at least once.</p> Signup and view all the answers

What issue arises with loops during testing, and why can it complicate path testing?

<p>The issue with loops is that each iteration is a different path, and if N is infinite, it can lead to a complex testing scenario.</p> Signup and view all the answers

How is data flow classified in programming, particularly in reference to variable occurrences?

<p>Data flow classifies variable occurrences into definitions and uses, specifically identifying when a variable is defined or referenced.</p> Signup and view all the answers

What type of testing would you apply to ensure that all paths through a program are executed at least once?

<p>You would apply path testing to guarantee that each unique route through the program is tested.</p> Signup and view all the answers

What does a d-u pair represent in terms of variable usage in programming?

<p>A d-u pair represents the definition (D) of a variable and its subsequent use (U) in program statements.</p> Signup and view all the answers

How does data flow testing help in identifying variables in a program?

<p>Data flow testing analyzes the use of variables to find issues like undeclared variables or those that are defined multiple times before being used.</p> Signup and view all the answers

What is the primary advantage of data flow testing?

<p>The primary advantage is its ability to identify variables that are declared but not used or declared multiple times.</p> Signup and view all the answers

What is the main weakness of data flow testing?

<p>A main weakness is that it does not effectively handle compound variables, such as arrays.</p> Signup and view all the answers

What is the role of equivalence partitioning (EV) in testing?

<p>Equivalence partitioning divides input data into subsets to reduce the number of test cases while ensuring coverage of all possible scenarios.</p> Signup and view all the answers

Why is boundary value analysis (BVA) important in testing?

<p>Boundary value analysis is important because it focuses on values at the edges of input ranges, which are often where errors occur.</p> Signup and view all the answers

In unit testing, what is the significance of deriving tests from the unit specification?

<p>Deriving tests from the unit specification ensures that the tests are aligned with the intended functionality and requirements of the unit.</p> Signup and view all the answers

What is a potential issue with functional testing based on requirement specifications?

<p>A potential issue is that the quality of functional testing heavily relies on the clarity, completeness, and accuracy of the requirement specifications.</p> Signup and view all the answers

Flashcards

Directed Graph (Control Flow)

A representation of a program's execution flow using nodes (code blocks) and edges (control transfers).

Path (Control Flow)

A unique path through the program from start to finish, considering each iteration of a loop as a separate path.

Test Coverage

A minimum set of test cases required to meet coverage criteria.

Statement Testing

A technique that aims to execute every line of code in a program at least once.

Signup and view all the flashcards

Functional (Black-Box) Testing

Tests based on the requirements specification of the software, without necessarily knowing the internal code structure.

Signup and view all the flashcards

Software

A list of instructions executed on a computer to achieve a specific goal.

Signup and view all the flashcards

Software Testing

The process of evaluating and verifying that a piece of software meets its intended purpose.

Signup and view all the flashcards

Errors

Mistakes made by humans during software development.

Signup and view all the flashcards

Faults

Problems in software caused by errors. They can lead to failures, but not always.

Signup and view all the flashcards

Software Failure

When software fails to operate as expected.

Signup and view all the flashcards

Good Test Case

A test that has a high chance of finding a previously undetected error.

Signup and view all the flashcards

Reviewing

A static examination of software output, typically done early in the development process.

Signup and view all the flashcards

Structural (White-Box) Testing

Tests based on analyzing the internal structure of the software. The source code is visible.

Signup and view all the flashcards

Branch Testing

Each branch in a decision (e.g., an IF statement) is executed at least once with both TRUE and FALSE outcomes.

Signup and view all the flashcards

Condition Testing

Each condition within a decision is tested, both TRUE and FALSE, at least once.

Signup and view all the flashcards

Decision/Condition Testing

Combines branch and condition testing, ensuring all conditions and decisions are covered.

Signup and view all the flashcards

Multiple Condition Testing

All possible combinations of TRUE and FALSE for conditions within a decision are tested.

Signup and view all the flashcards

Path Testing

Each unique path through the program, from start to end, is executed at least once.

Signup and view all the flashcards

Loops and Path Testing

Loops can present a challenge because each iteration creates a new path, potentially leading to an infinite number of tests. Strategies are needed to address this.

Signup and view all the flashcards

Variable Definition (Data Flow Testing)

Each variable's usage in a program is classified as a 'Definition' if it's assigned a value for the first time.

Signup and view all the flashcards

Data Flow Testing

Data flow testing analyzes how variables are used throughout a program to identify potential errors.

Signup and view all the flashcards

D-U Pair (Definition-Use Pair)

A variable is defined when it is declared, and given an initial value. It is used when it is referenced in a program statement, such as an output statement, an expression, or a condition. For example, if a variable 'x' is declared as x = 5, it is defined, and if it is later used in a statement like 'print(x)', it is being used.

Signup and view all the flashcards

Exercising D-U Pairs

A test case is a specific input or set of inputs that is used to test a piece of software. To ensure thorough testing, we want to design test cases that exercise every d-u pair at least once. This means that each variable is both defined and used at least once in our tests. This helps ensure that each variable is working correctly throughout the code.

Signup and view all the flashcards

Equivalence Partitioning (EV)

This technique partitions the possible inputs into subsets that the software is expected to handle in the same way according to the requirements document. It helps you choose a representative test input from each subset, ensuring your tests cover a wide range of potential usage scenarios.

Signup and view all the flashcards

Boundary Value Analysis (BVA)

This testing technique focuses on the boundaries between equivalence partitions – the 'edges' of input values. It helps you find errors that may occur when the input values are at or near these boundaries. Select test values that fall right on the boundary and one value on either side of it.

Signup and view all the flashcards

Unit Testing

This type of testing analyzes software units, the smallest testable part of a program, to ensure each unit functions correctly. This is done by deriving test cases from the unit's specifications.

Signup and view all the flashcards

Functional Testing (Requirements-Based)

This method creates test cases by analyzing the requirements specification. However, its reliability depends heavily on the quality of the requirements document. If the documentation is unclear, incomplete, inconsistent, inaccurate, or untestable, the resulting tests might not accurately reflect the intended functionality of the software.

Signup and view all the flashcards

Study Notes

Software Quality and Testing

  • Critical awareness/evaluation/assessment involves comparing, contrasting, and justifying judgments with evidence.
  • Software is a list of instructions executed on a computer to fulfill a predetermined purpose.
  • Software Testing is the process of evaluating and verifying if software fulfills its intended purpose.
  • Errors are mistakes made by people that can lead to faults.
  • Faults are caused by errors in software and may or may not lead to failures.
  • Failures are observed deviations from the expected behavior of software, dependent on user expectations.
  • Quality meets and exceeds requirements.

Software Quality

  • External and internal quality are aspects of software quality.
    • Functionality, reliability, usability, efficiency, maintainability, and portability are examples of aspects of external quality.
    • Suitability, maturity, accuracy, interoperability, reliability, completeness, testability, compatibility, complaince are all part of aspects of external quality. Other aspects of internal quality include: Understandability, learnability, usability, efficiency, maintainability, portability, adaptability, installability, resource utilization, testability, replaceability, and compliance.

A good test

  • A good test case has a high probability of finding undiscovered errors.

Testing and Reviewing

  • Testing is the dynamic execution of software towards the end of the process.
  • Reviewing is a static examination of an output and can be done earlier in the process.

Test Plan

  • A test plan organizes and manages the testing effort, outlines the testing approach, and specifies tests to run.
  • Contains the information of what is to be tested, personnel required, schedules, test tools, test failure reporting process, regression testing, records, and outcomes of each test.
  • Test cases define aspects of software for testing and should be written for invalid and unexpected input conditions.
  • Test data includes planned inputs, starting conditions, and expected outputs for each test.

Stages of Testing

  • Different stages of testing include: unit testing, integration testing, system testing, acceptance testing, beta testing, and field trials. Regression testing is almost always a stage.

Testing Techniques

  • Structural (white-box/glass-box) testing analyzes software based on its internal structure. Testing focuses on control flow and/or data flow using a directed graph in order to execute a large portion of possible code paths.
  • Functional (black-box) testing is based on the software's requirements specification without examining its internal structure. Tests are designed to exercise paths through the unit that evaluate the functionality of the program.
  • Path testing is a method of designing test cases that cause each possible path through the program to be executed.
  • Test Coverage is the minimal set of cases that satisfy the testing criteria.
  • Statement testing executes every statement in the software at least once.
  • Branch testing executes both true and false outcomes of each decision in the program.
  • Condition testing tests all possible combinations of true and false values for each condition in a decision statement in the code.
  • Decision/Condition testing ensures each decision has both TRUE and FALSE outcomes executed at least once.
  • Multiple condition testing involves testing all possible combinations of conditions in each decision.
  • Data flow testing analyzes the data flow for each variable, choosing test cases.

Dealing with Loops

  • The number of iterations in a loop can be infinite, which can be a problem for testing.

Functional Testing

  • Equivalence partitioning divides inputs into subsets where the program behaves the same way.
  • Boundary value analysis focuses on input values at the boundaries.
  • Combinatorial testing examines combinations of input parameters.
  • Pairwise testing covers pairs of input parameter combinations.
  • N-way testing tests all possible combinations of parameters.

System Testing

  • Functional testing evaluates functions, volume, load, usability, security, performance, and recovery.

Additional Testing Concepts

  • Beta testing uses real users to test products.
  • Test scaffolding is used in unit and integration testing with stubs and drivers.
  • Stubs simulate unavailable components (modules).
  • Drivers execute tests of lower level modules.
  • Incremental testing combines modules for testing.
  • Top-down testing starts testing control modules first.
  • Bottom-up testing starts testing a lower-level unit first and uses drivers to test those modules/units.
  • Cause of test failure can be faults in software, the test itself, or the expected results.

Software Maintenance and Quality

  • Maintainability depends on the ease of changing software. Issues such as maintenance and debugging should be the developer's responsibility.
  • Error seeding is deliberately introducing faults into software to see how well tests find faults.
  • Code style has impacts on code maintainability.
  • Technical review is an assessment of technical outputs (requirements, code, documentation, plans).
  • Walkthrough is similar to inspection where engineers trace inputs through the code.
  • Fagan inspection is a structured review to detect defects.
  • Reporting test failures is a summary of testing issues with what was tested and what the issues were.

Exploratory Testing

  • Exploratory testing is used when specifications are poor or time is limited. It is a semi-structured testing method that helps understand the software.
  • By using different criteria, a researcher can compare techniques based on effectiveness, efficiency, and cost.
  • Review techniques are used to separate and identify types of fault in the software.
  • Quality is an important part of maintaining software as maintaining it efficiently and easily can have an important impact on a project.
  • Stopping testing at a reasonable point is an interesting factor as it is not easy to know when to stop testing effectively and efficiently. Software defects are often assessed as a ratio to the size of the software being tested.

Studying That Suits You

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

Quiz Team

Related Documents

Description

This quiz covers essential concepts in software testing, including structural testing, test coverage, and the significance of test cases. Explore various testing techniques and their importance throughout the software development lifecycle. Ideal for software development students and professionals looking to test their knowledge.

More Like This

Use Quizgecko on...
Browser
Browser