Software Testing Fundamentals

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

Which of the following is the primary goal of software testing?

  • To demonstrate that software is error-free.
  • To increase the lines of code written by developers.
  • To ensure the software meets the aesthetic preferences of the end-users.
  • To identify defects or bugs in the software. (correct)

A software fault, often referred to as a 'bug' or 'defect,' is best described as which of the following?

  • An erroneous software or hardware element causing system failure. (correct)
  • An unexpected delay in project completion.
  • An erroneous hardware component causing system failure.
  • An intentional feature added to improve user experience.

What is the main difference between testing conducted haphazardly and testing conducted systematically?

  • Haphazard testing guarantees more comprehensive coverage.
  • Systematic testing is cheaper to implement.
  • Haphazard testing requires less documentation.
  • Systematic testing is guided by a plan, while haphazard testing relies on random trial and error. (correct)

In Test-Driven Development (TDD), what is the initial step in the 'Red-Green-Refactor' cycle?

<p>Writing a test case that specifies the desired behavior or functionality, which initially fails. (D)</p> Signup and view all the answers

What is the primary purpose of the 'Green' phase in the TDD 'Red-Green-Refactor' cycle?

<p>To write only enough code to pass the failing test from the 'Red' phase. (D)</p> Signup and view all the answers

After the test case passes, what is the main goal of the 'Refactor' step in the TDD cycle?

<p>To improve the code's design, readability, and maintainability without altering its functionality. (C)</p> Signup and view all the answers

According to the principles of Test-Driven Development (TDD), which of the following should a developer NOT do?

<p>Write implementation code before writing a failing test. (C)</p> Signup and view all the answers

Which of the following is a key benefit of Test-Driven Development (TDD)?

<p>Improved code quality and reduced bugs due to upfront testing. (D)</p> Signup and view all the answers

Which of the following is considered an example of a test case?

<p>A particular choice of input data and the expected output or behavior when testing a program. (B)</p> Signup and view all the answers

Why is it generally impossible to completely test any non-trivial system?

<p>The number of possible test cases can be extremely large or infinite. (C)</p> Signup and view all the answers

What is the goal when designing test cases?

<p>To find faults as cheaply and quickly as possible. (A)</p> Signup and view all the answers

In the context of software testing, what is the significance of 'test coverage'?

<p>The degree to which the software's specification or code is exercised by tests. (B)</p> Signup and view all the answers

Which type of testing explores the input space of functionality defined by an interface specification?

<p>Black-box testing (C)</p> Signup and view all the answers

What is the focus of White-box testing?

<p>Analyzing the internal logic and structure of the code. (D)</p> Signup and view all the answers

Which level of testing focuses on verifying that the software meets the needs of its users and stakeholders?

<p>Acceptance Testing (D)</p> Signup and view all the answers

A team is developing a system where each component is tested individually before being combined. What type of testing is this?

<p>Unit Testing (A)</p> Signup and view all the answers

Which of the following refers to testing how different components of a system work together?

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

What does System Testing (end-to-end) primarily evaluate in a software application?

<p>The complete system's functionality and performance. (B)</p> Signup and view all the answers

Which type of testing is concerned with non-functional requirements such as security, usability, performance, and scalability?

<p>Quality Testing (D)</p> Signup and view all the answers

Which of the following best describes Installation testing?

<p>Tests that the system works as intended when deployed to the end-user's device. (D)</p> Signup and view all the answers

Which of the following testing techniques divides the input data into groups and tests one or more scenarios from each?

<p>Equivalence testing (D)</p> Signup and view all the answers

What is the assumption made during equivalence testing?

<p>The behavior of the system will be the same for each member of an equivalence class (A)</p> Signup and view all the answers

What is the purpose of boundary value analysis in the context of software testing?

<p>To focus on inputs at the edges of equivalence classes. (A)</p> Signup and view all the answers

What is the main goal of control-flow testing?

<p>To organize testing based on the control flow implementation. (A)</p> Signup and view all the answers

Why is 100% statement coverage not sufficient to ensure 100% edge coverage?

<p>Statement coverage only covers individual statements, not the transitions between them. (C)</p> Signup and view all the answers

In State-based testing, what does the term 'state' refer to?

<p>A constraint on the attributes of an object. (A)</p> Signup and view all the answers

Which of the following is NOT a type of state-based coverage?

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

What does Unit testing ensure?

<p>That each unit works as expected. (B)</p> Signup and view all the answers

What is the purpose of mock-objects in Unit testing?

<p>To simulate components external to the unit in isolation. (B)</p> Signup and view all the answers

What is tested in Integration Testing?

<p>How components interact. (C)</p> Signup and view all the answers

Which integration testing approach links units at once?

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

Why is Big Bang Testing typically avoided?

<p>It is difficult to isolate the cause of errors (B)</p> Signup and view all the answers

When is Bottom-up testing typically used?

<p>When disjoint subsystems can be integrated. (C)</p> Signup and view all the answers

What is most frequently used to test top level systems?

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

Which integration testing method combines top-down and bottom up approaches?

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

What is the primary goal of testing a module with front end component testing?

<p>That each unit works as expected (C)</p> Signup and view all the answers

What testing evaluates component responsiveness and efficiency?

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

Which Integration Testing focuses on testing layers of a system?

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

What is the testing strategy of vertical integration testing

<p>All the components needed to realise a particular user story (C)</p> Signup and view all the answers

What is the primary goal of continuous integration?

<p>To automate and frequently integrate code changes. (A)</p> Signup and view all the answers

A large portion of Continous intergration is which of the following?

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

During quality tests, what is tested when running a compability test?

<p>Older versions of software to ensure backwards compatibility (B)</p> Signup and view all the answers

Flashcards

Software Testing

The process of evaluating a software solution to ensure it behaves as expected and meets the requirements, involving controlled conditions and identifying defects or bugs.

Bug (or Fault/Defect)

An erroneous software or hardware element that can cause a system to fail.

Test-Driven Development (TDD)

A software development approach where tests are written before the actual implementation code.

Write a failing test (Red)

Write a failing test case that specifies the desired behavior of the code to be implemented.

Signup and view all the flashcards

Write code to pass test (Green)

Write the minimum amount of code necessary to pass the test case without introducing unnecessary complexity.

Signup and view all the flashcards

Refactor the code (Refactor)

Improve the code's design, readability, and maintainability while ensuring all tests still pass.

Signup and view all the flashcards

Fault/Defect

An erroneous hardware or software element of a system that can cause the system to fail.

Signup and view all the flashcards

Test Case

A particular choice of input data to be used in testing a program and the expected output or behavior.

Signup and view all the flashcards

Test

A finite collection of test cases.

Signup and view all the flashcards

White-box Testing

Testing that exploits the structure within the program, assuming program code is available.

Signup and view all the flashcards

Black-box Testing

Testing that explores the input space of functionality defined by an interface specification.

Signup and view all the flashcards

Coverage

The degree to which the specification or code of a software program has been exercised by tests.

Signup and view all the flashcards

Test Coverage

Testing that focuses on the coverage of the input space, without necessarily testing each part of the software.

Signup and view all the flashcards

Code Coverage

Testing that measures the degree to which the elements of the program source code have been tested.

Signup and view all the flashcards

Equivalence Testing

A black-box testing method that divides the space of all possible inputs into equivalence groups/classes, expecting the program to behave the same.

Signup and view all the flashcards

Boundary Testing

A special case of equivalence testing that focuses on the boundary values of input parameters.

Signup and view all the flashcards

Control-flow Testing

Testing based on the control flow of the software.

Signup and view all the flashcards

State-based Testing

Defines a set of abstract states that a software unit can take and tests the unit's behavior.

Signup and view all the flashcards

State

A constraint on the values of an object's attributes

Signup and view all the flashcards

Event

An input given to the system

Signup and view all the flashcards

Action

The result, output or operation that follows an event

Signup and view all the flashcards

Transition

A change of state caused by an event

Signup and view all the flashcards

Guard

A condition associated with an event which determines whether a transition is triggered or not

Signup and view all the flashcards

Unit

The unit is tested as a fixture.

Signup and view all the flashcards

Unit Testing

The smallest possible part of a system is tested individually and independently

Signup and view all the flashcards

Test Driver

Simulates part of a system to invoke operations on the isolated unit.

Signup and view all the flashcards

Test Stub

A part of a system that is called by the unit.

Signup and view all the flashcards

Integration Testing

Tests how components of a system interact with each other.

Signup and view all the flashcards

Big Bang integration

Each unit is linked at once and the entire system is tested

Signup and view all the flashcards

Bottom-up testing

Lowest level subsystems are tested first. An integrated component can only be tested once the components it relies on are tested.

Signup and view all the flashcards

Top-down testing

Highest level subsystems are tested first. An integrated component can only be tested once all components that invoke it are tested.

Signup and view all the flashcards

Sandwich testing

Testing that combines top-down and bottom-up approaches to converge towards a target layer.

Signup and view all the flashcards

Front-end component testing

Testing individual components of a user interface (UI) in isolation to ensure they function correctly.

Signup and view all the flashcards

Integration Testing

Tests how components interact with each other within the application.

Signup and view all the flashcards

Snapshot Testing

Captures and compares rendered component output to detect UI changes.

Signup and view all the flashcards

End-to-End Testing

Tests the entire application from the user's perspective.

Signup and view all the flashcards

The smallest possible part of a system.

Vertical Integration Testing

Signup and view all the flashcards

Continuous Integration

A software development practice where code changes are frequently integrated into a shared repository, triggering automated builds and tests.

Signup and view all the flashcards

System Tests

Test the system as a whole.

Signup and view all the flashcards

Functional testing

Tests the functional requirements of a system.

Signup and view all the flashcards

Study Notes

Software Testing Basics

  • Software testing is the process of evaluating a software solution to ensure it behaves as expected and meets specified requirements.
  • It involves executing software under controlled conditions and assessing its behavior to identify defects or bugs.
  • A fault, referred to as a bug or defect, is an erroneous software or hardware element in a system that can cause the system to fail.
  • Software testing identifies defects, ensures quality, validates requirements, and improves user experience.
  • Software testing helps identify defects/bugs, functionality/performance errors, or interface inconsistencies.

The Importance of Testing

  • Testing ensures the software meets quality standards and stakeholder requirements, providing reliable and robust products for end-users.
  • Testing verifies the software behaves according to specifications and meets user/stakeholder needs.
  • Testing enhances the software's overall user experience.
  • Testing shows the presence of bugs, not the absence; 100% certainty that software is bug-free is unattainable, but proper testing methodology assists in getting very close.
  • The tests should be conducted with a systematic plan instead of random trial and error

Test-Driven Development (TDD)

  • Test-Driven Development (TDD) involves writing tests before writing the actual implementation code.
  • The first principle of TDD: Every step requires a plan to verify the result meets a goal.
  • The second principle of TDD: A software artifact shouldnt be created unless the developer can test it.
  • TDD follows the "Red-Green-Refactor" cycle:
    • First, write a failing test case that specifies the desired behavior/functionality of the code (Red).
    • Then, write the minimal code necessary to pass the test (Green).
    • Finally, refactor the code to improve design, readability, and maintainability while keeping tests passing.
  • TDD is an iterative process where, after refactoring code, the cycle repeats with modifications to existing tests of additional test cases.

TDD Benefits

  • Improved code quality
  • Reduced bugs
  • Faster feedback loop
  • Better documentation

Key Definitions

  • A fault/defect/bug is an erroneous hardware/software element that can cause system failure.
  • Test case: A particular choice of input data for testing a program, including the expected output/behavior.
  • Test: A finite collection of test cases.
  • White-box testing: Testing that exploits the internal structure of a program, assuming code is available.
  • Black-box testing: Testing that explores the input space of functionality defined by an interface specification.

Why Testing is Hard

  • Nontrivial systems cannot be completely tested, and the goal is to find faults as quickly and inexpensively as possible.
  • The ideal is to create a single test case that exposes each fault and runs it, but in practice many unsuccessful test cases may be necessary.
  • Testing strikes a balance between maximizing test coverage and minimizing economic costs.
  • The idea is that correct behavior on "critical" test cases represents the correct behavior on untested parts of the state space.

Logical Organization of Testing

  • Testing can be organized a white box or black box.
    • White box is the internal structure, design, and code being tested.
      • With white box, the internal workings of the system are transparent to the tester.
    • Quality testing, the software system is tested from an end-user perspective
      • Whereby The internal workings of the system are hidden from the tester.
  • The testing may include unit test, integration testing, system test, function, quality acceptance, installation testing
    • Note the orders are not necessarily strict

Unit Testing

  • Unit Testing applies to the smallest part of the system - aka the unit , which is independently tested.
  • Unit is sometimes referred to as a fixture.
  • To test a unit in isolation mock objects which refers to components external to the unit are created.
    • They are created as a test driver - simulating parts of a system that invoke operations.
    • Unit testing cycle - consists of The unit
  • Create the unit, test, driver and test stub(s) and have the test driver invoke an operation on the unit that ensures expected results.

Test Cases

  • Acceptance test: A black-box testing approach, which includes:
    • Testing with a valid key of a current tenant on their apartment (pass).
    • Testing with a valid key of a current tenant on someone else's apartment (fail).
    • Testing with an invalid key on any apartment (fail).
    • Testing with the key of a removed tenant on their previous apartment (fail).
    • Testing with the valid key of a newly added tenant on his/her apartment (pass).

Testing Granularity

  • Unit Testing: Smallest possible part of a software or system is tested individually and independently.
  • Integration Testing: Tests how different components of a system interact with each other and operate together.
  • System Testing (end-to-end): The complete system or integrated set of components is tested to verify it satisfies specified requirements and performs as expected as a whole.
  • Functional Testing: Tests the system or component which verifies it meets the specified functional requirements.
  • Quality Testing: Non-functional testing that evaluates security, performance usability etc
  • Acceptance Testing: The customer verifies the requirements have been met.
  • Installation Testing: That tests the way the system works and its intended operations and deployment.

Coverage

  • Coverage: The degree to which testing has been exercised by tests.
  • Test Coverage (AKA Big picture): Focuses on the specifications and checks testing of the input without checking the other parts.
  • Code Coverage (Implementation details): Code of coverage Degree to which the program source code has been tested.

Heuristics for High Testing Coverage

  • Some tests can more easily pinpoint problems than others, and test cases should be prioritized.
  • Equivalence Testing (Mostly Black-box testing)
    • It is a testting method that divides all possiblie inputs into an equivalence group
  • Boundary Testing (Mostly Black-box testing)
    • Test the bounds of the inputs
  • Control-flow Testing (Mostly White-Box testing)
  • State-based Testing (Mostly White-Box testing)

Equivalence

  • A black-box testing method
  • Divides the input of all possible classes for the system to behave on each same input from the same group
    • Assumes the developer may have made mistakes on classes of the input values.
  • The steps are;
    • Partitions what's needed inside the inputs in valid equivalence classes.
    • One or more inputs from each equivalence

Heuristics for finding equivalence classes

  • Specified over a range with a Boolean value or not
  • Partition that makes two values equivalent

Boundary Testing

  • AKA Boundary Value analysis
  • It is part of a special case of Equivalence as it touches on the input parameters.
    • Such that Developers fail to see the special cases at the boundary of equivalence classes.
    • Selects inputs from edges of each class or outliers such as zeroes or mins.

Control-Flow Testing

  • Organizes testing based on the control flow of the software and its white box.
  • The goal to draw a control flow graph to that every statement has a node and transition between edge statements
  • In order to measure the code, we use code coverage.

Types of code coverage

  • Statement coverage
  • Edge coverage
  • condition coverage
  • Path coverage

State-Based Testing

  • Defines a testing method and abstracts the behavior by abstracting object
  • It testing behavior by comparing actual states of expected states.
    • Usually is used with Object-Oriented Programming but may be incomplete.
    • The state of an object defines it values of attributes and an object may be unit tested even without the values.

State-Based Testing Components

  • State is a constraint on a values of an objects attribues.
  • Event is an input given to the a system.
  • Action is a result output or operation with the event.
  • Transition is a chance of state caused by the event.
  • Guard is a condition with an event which depends on the transition.

Test Cases

  • It includes all the relevant event:
    • What happens if the User entered a valid key
    • What happens if the User entered an invalid key

State-Based Faults (Control)

  • Missing transitions
  • Incorrect Transitions
  • Inconsistent State transitions
  • Loping and infinite Transitions
  • Missing/Incorrect Actions Actions
  • Traps and paths
  • Deadlocks and Livelocks

Integration Testing

  • Testing the integration of multiple functions together.
    • Includes Big Bang Integration - which unites multiple systems together.
      • Should not do as this should mean to test the faults only at the whole system. -Includes Bottom testing - lower testing as it relies on top-level execution simulation.
      • Good as a disjoint subsytem tested.
    • Includes Top testing - as the lower levels simulte.
    • Good in terms of functional component

Horizontal Integration Testing

  • Assuming a test can be assumed.

Vertical Integration Testing

  • Test all components to realis a stories which include the use of inter feedback and outter feedback.

Continous integration

  • Software dev has the code integrated into a shared, which trigger build process.

Continous Integration (CI)

  • Running test is big part of Continious Integrations
  • Every time as built the run of;
    • Unit test as a change component.
    • Regression test on the change component
    • Runs integration test.

Front End Component Testing

  • Tests an individual element (UI) or interafce on the website.
    • It unit tests.
    • Uses integration
    • The tool used can snapshot and ensure accessibilty
    • Some even ensure performance test.

Setup Tools For Testing

  • Includes Tools related to;
    • Testing Framework
    • Assert Library
    • Hedless Browsers

System Tests

  • Quality testing that ensures backwards campatibility
  • Followed by attempt to violate test.
  • Testing the limits as a measure to see how the system. Acceptance Testing - tests on an development enviroment to get a realistic test in a enviroment. Testing is an art and a science, can hardily guarentee a bug, but tools help make the bugs tractable.

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 Fundamentals
16 questions

Software Testing Fundamentals

DetachableSanctuary378 avatar
DetachableSanctuary378
Software Testing Fundamentals
42 questions
Software Testing Fundamentals
37 questions

Software Testing Fundamentals

FestiveScholarship5647 avatar
FestiveScholarship5647
Use Quizgecko on...
Browser
Browser