79. OCR GCSE (J277) 2.3 Suitable test data

Craig'n'Dave
6 Jan 202007:00

Summary

TLDRIn this video, Craig explores different types of test data for a simple program that prompts users for a choice between one, two, or three. The video covers four main categories of test data: erroneous data (incorrect data type), invalid data (correct data type but out of range), normal data (valid input), and boundary data (edge-case valid input). Craig demonstrates how to test each category with examples and explains the importance of considering these types when testing more complex programs, such as a car parking system with varying charges and times.

Takeaways

  • 😀 Erroneous data refers to data of the incorrect type that a program cannot process, such as entering characters when integers are expected.
  • 😀 Invalid data is the correct type but outside the accepted range, like entering 8 when the program expects a number between 1 and 3.
  • 😀 Normal data is valid input within the accepted range, such as entering 1, 2, or 3 when prompted by the program.
  • 😀 Boundary data are values at the edge of the accepted range, like 1 or 3 when the valid range is 1 to 3.
  • 😀 The script emphasizes the importance of testing for all types of data, including erroneous, invalid, normal, and boundary cases.
  • 😀 It’s essential to test with no input as a special case, ensuring the program behaves as expected when no data is provided.
  • 😀 For erroneous data, examples include entering characters or symbols when the program expects an integer.
  • 😀 Boundary tests are especially important as they check if the program correctly handles edge cases like the smallest and largest valid inputs.
  • 😀 Testing should not only cover normal data but also check for incorrect data types (erroneous) and data outside the validation range (invalid).
  • 😀 When dealing with large ranges, such as numbers from 1 to 1000, it's unnecessary to test every possible value; instead, select representative normal data samples.

Q & A

  • What are the four types of test data mentioned in the video?

    -The four types of test data are erroneous data, invalid data, normal data, and boundary data.

  • What is erroneous data?

    -Erroneous data refers to inputs that are of the incorrect data type. For example, if a program expects an integer but receives a character or symbol, that is considered erroneous data.

  • How is invalid data different from erroneous data?

    -Invalid data is of the correct data type but falls outside the accepted validation limits. For instance, an integer outside the acceptable range, like -6 or 8, is invalid, while erroneous data involves the wrong data type altogether.

  • Can you provide an example of boundary data?

    -Boundary data consists of values at the edge of the acceptable input range. For example, if a program accepts integers between 1 and 3, then the values 1 and 3 would be considered boundary data.

  • What is the significance of normal data in testing?

    -Normal data is the expected input that falls within the valid range and does not cause errors. It represents the typical use cases that the program is designed to handle.

  • What is the purpose of testing with erroneous data?

    -The purpose of testing with erroneous data is to ensure that the program correctly handles incorrect data types and rejects inputs that do not match the expected type.

  • Why is it important to test boundary data?

    -Testing boundary data is crucial because it ensures the program correctly handles values at the extremes of the valid input range, preventing potential errors or unexpected behavior at these limits.

  • What is the difference between invalid and erroneous data in the context of programming?

    -Erroneous data is when the input is of an incorrect data type (e.g., a string instead of an integer), while invalid data is of the correct data type but outside the allowed range or validation criteria.

  • What should you do if no data is entered by the user?

    -If no data is entered, such as when the user simply presses Enter, the program should handle this case appropriately. While it's not necessarily erroneous data, it could indicate missing input that needs to be managed.

  • How does the complexity of a program affect the choice of test cases?

    -In simpler programs, you might test all possible valid inputs, but in larger systems, you can reduce the number of test cases by selecting a representative sample, ensuring that the program is thoroughly tested without redundancy.

Outlines

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Mindmap

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Keywords

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Highlights

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Transcripts

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード
Rate This

5.0 / 5 (0 votes)

関連タグ
Test DataSoftware TestingBoundary TestingData ValidationError HandlingInput TypesProgramming TipsCode QualityTesting MethodsTest CasesSoftware Development
英語で要約が必要ですか?