Back to 课程

Computer Science GCES OCR

0% Complete
0/0 Steps
  1. Cpu Architecture Performance And Embedded Systems Ocr
    5 主题
  2. Primary And Secondary Storage Ocr
    6 主题
  3. Data Storage And Compression Ocr
    12 主题
  4. Networks And Topologies Ocr
    6 主题
  5. Wired And Wireless Networks Protocols And Layers Ocr
    6 主题
  6. Identifying And Preventing Threats To Computer Systems And Networks Ocr
    2 主题
  7. Operating Systems And Utility Software Ocr
    2 主题
  8. Ethical Legal Cultural And Environmental Impact Ocr
    2 主题
  9. Computational Thinking Searching And Sorting Algorithms Ocr
    3 主题
  10. Designing Creating And Refining Algorithms Ocr
    5 主题
  11. Programming Fundamentals And Data Types Ocr
    5 主题
  12. Additional Programming Techniques Ocr
    7 主题
  13. Defensive Design And Testing Ocr
    6 主题
  14. Boolean Logic Diagrams Ocr
    2 主题
  15. Programming Languages And Integrated Development Environments Ides Ocr
    3 主题
  16. The Exam Papers Ocr
    2 主题
  17. Structuring Your Responses Ocr
    3 主题
课 Progress
0% Complete

Exam code:J277

Normal, Boundary & Erroneous Tests

Categories of tests

  • There are three main categories of tests a programmer or test-user would carry out whilst performing both iterative or final testing on a program

    • Normal tests

    • Boundary tests

    • Erroneous tests

  • There is an additional test that users would always carry out to test the robustness of their program, this is known as an invalid test

  • To explain the types of tests, some example code will be used

Example code

# Ask for user's name
name = input("What is your name? ")

# Ask for user's age
age = int(input("How old are you? "))

# Check if age is between 12 and 18
if age >= 12 and age <= 18:
print("Welcome, " + name + "! Your age is accepted.")
else:
print("Sorry, " + name + ". Your age is not accepted.")

Normal tests

  • A normal test is when a user enters data that should be accepted in the program

  • An example would be a user entering their age as 16 into the age field of the program

Boundary tests

  • A boundary test is when a user enters data that is on the edge of what is acceptable 

  • An example would be a user entering their age as 12 or 18 into the age field of the program

Erroneous tests

  • An erroneous test is when a user enters data that is the wrong data type

  • An example would be a user entering their age as “F” into the age field of the program

Invalid tests

  • An invalid test is when a user enters data that is the right data type but it is outside of what is accepted

  • An example would be a user entering their age as 67 into the age field of the program

Selecting suitable test data

A table with three columns: Type of Test, Input, and Expected Output. Tests include normal, boundary, erroneous, and invalid with results as accepted or rejected.

Worked Example

SME Electronics is an online shop which sells electronic items.
The following flowchart shows an algorithm used to calculate the price of an item when they have a sale.

screenshot-2024-02-28-at-15-08-49
  1. Complete the following test plan for the algorithm [4]

Price Input

Test Type

Expected Price Output

50

Normal

 

100

 

 

150

 

 

200

Boundary

 

FFF

 

 

Answer

  • Marked in pairs

  • 1 mark per two correct cells

Price input test table with columns for Price Input, Test Type, and Expected Price Output. Rows include 50, 100, 150, 200, and FFF with normal, boundary, and erroneous types.

Responses

您的邮箱地址不会被公开。 必填项已用 * 标注