Software Testing - Test Data Selection
18 Questions
3 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 exhaustive testing?

  • Prioritizing test cases based on risk assessment
  • Testing only the most critical scenarios
  • Confirming the software functions under every possible situation (correct)
  • Reducing the overall number of tests performed
  • What is one of the significant issues associated with exhaustive testing?

  • It may result in duplicate tests and a large number of tests (correct)
  • It can lead to the discovery of all existing bugs
  • It requires minimal resources to perform
  • It focuses only on black box testing methods
  • Which of the following best describes smart testing?

  • A strategy that reallocates resources to more important tests (correct)
  • An approach that does not consider the significance of test cases
  • A testing approach that favors exhaustive testing
  • A method that tests all scenarios with the same priority
  • In black box testing for integer addition, which scenario is likely to be error-prone?

    <p>Transitioning from positive to negative values</p> Signup and view all the answers

    What type of values are considered critical areas to test in black box integer addition?

    <p>Special values, such as 0, and end points of data ranges</p> Signup and view all the answers

    What is the purpose of the 'buf' array in the split function?

    <p>To store each word temporarily as it is being extracted</p> Signup and view all the answers

    What does the variable 'result' indicate in the split function?

    <p>The number of words that have been successfully added to the array</p> Signup and view all the answers

    What condition triggers the error status in the split function?

    <p>If the number of words exceeds the maximum size specified</p> Signup and view all the answers

    How does the function handle consecutive spaces and tabs in the input string?

    <p>It skips them entirely without processing</p> Signup and view all the answers

    What happens to 'buf' after a word has been extracted and stored in 'words'?

    <p>It is re-initialized to prepare for the next word</p> Signup and view all the answers

    What is the result of adding -1 to 12?

    <p>11</p> Signup and view all the answers

    Which of the following represents adding the maximum integer value to -13?

    <p>-13 + MAXINT</p> Signup and view all the answers

    What is the output of concat('a', 'abc')?

    <p>aabc</p> Signup and view all the answers

    Which edge condition does not produce any output?

    <p>concat('', '')</p> Signup and view all the answers

    What happens when the destination string in concat exceeds the MAX_LEN?

    <p>The function could lead to a buffer overflow</p> Signup and view all the answers

    What is the output of calling split on ' The quick brown fox ' with respect to spacing?

    <p>['The', 'quick', 'brown', 'fox']</p> Signup and view all the answers

    How does the concat function handle a NULL destination?

    <p>It will result in a segmentation fault</p> Signup and view all the answers

    What would be the expected output when executing concat('abcdefg', 'hijklmn')?

    <p>Error due to exceeding MAX_LEN</p> Signup and view all the answers

    Study Notes

    Software Testing - Test Data Selection

    • Overview: The presentation outlines two primary approaches to test data selection: Black Box and White Box.
    • Black Box Test Data Selection: Focuses on the software's functionality without examining its internal structure.
    • White Box Test Data Selection: Examines the internal structure of the software to select test data.
    • Testing Methods: A hierarchical structure is shown demonstrating exhaustive, smart, white box, and black box testing methods. Exhaustive is a subset of the smart method.

    Exhaustive Testing

    • Definition: A brute-force testing approach that considers all possible input combinations to ensure the software functions correctly under every scenario.
    • Issue: The sheer number of possible test cases can be enormous, leading to excessive testing time and resources. Duplication of tests is also a significant concern.
    • Sample 1 (Integer Addition): Consider the addition of two 32-bit integers. The total number of possible combinations is 18,446,744,073,709,551,616.
    • Sample 2 (IE Tools Advanced Options): 53 binary selections, one with three options and one with four options. The total possible combinations is 108,086,391,056,891,904.
    • Key takeaway: Exhaustive testing is impractical for most real-world software systems due to the immense number of potential test cases.

    Smart Testing

    • Definition: Recognizes that not all tests have equal importance. Prioritises tests and allocates resources to the most crucial ones.
    • Pros: Eliminates duplicated tests and reduces the overall number of test cases. This approach is more efficient than a brute force approach.

    Black Box - Integer Addition

    • Non-duplicate Values: This section focuses on different combinations of integer values for addition, including even + even, even + odd, odd + even, and odd + odd.
    • Error-prone areas: Identifies critical points in addition, such as transitions between positive and negative values, boundary conditions (max/min integers), special values (like zero), and values directly adjacent to special values.
    • Examples: (12 + 0), (12 + 1), (12 + MAXINT), (12 + MININT), (12 + MAXINT - 1)
    • Integer addition test cases: A table of different integer addition test cases has been shown that encompass various cases like adding zero to a number, adding one to a number, adding MaxInt to a number etc and each of these scenarios represents distinct and valuable test criteria for software testing.

    Black Box - String Concatenation

    • String Concatenation Function: Discusses the concatenation of strings, showing examples of routine test cases and edge cases.
    • Test Data: Highlights the need for both routine test cases (normal string combinations/lengths) and the edge cases.
    • Edge Conditions: Examples: empty strings, strings with varying lengths, large strings that might exceed allocated storage, and empty strings being concenated with other strings.

    White Box - String Concatenation

    • Focus: Examines the internal working of the string concatenation function.
    • Code Analysis: Demonstrates code examples and focuses on specific sections of code that might cause issues under various conditions or error checking.

    Splitting Text into Words

    • Function: Describes a function to divide text data into individual words.
    • Testing Considerations: The examples highlight critical test cases for splitting text into words, such as the presence of blanks, tabs, combined blanks and tabs at the beginning/end of the string, and different numbers of blanks/tabs.
    • Array Size Considerations: A test is proposed to check whether the number of words exceeds the maximum size of the array to ensure that the program handles such scenarios appropriately.

    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 key concepts in software testing, focusing on test data selection through Black Box and White Box methods. It also discusses exhaustive testing, including its definition, challenges, and examples like integer addition. Test your understanding of these essential software testing techniques.

    More Like This

    Use Quizgecko on...
    Browser
    Browser