Principles of Testing in Programming for GCSE Students

t eaching l ondon c omputing n.w
1 / 16
Embed
Share

Explore the key concepts of testing in programming for GCSE students, including the principles of testing, test cases, test data, boundary values, test plans, and evidence. Understand the importance of testing, using suitable test plans and data to test system functions as per the OCR specification. Delve into the complexity of testing in industry processes and ethical considerations in software development.

  • Testing
  • GCSE
  • Programming
  • Education
  • London

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. TeachingLondon Computing Programming for GCSE Topic 6.2: Testing William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London

  2. Aims Understand the idea of testing Understand ideas behind the GCSE requirements E.g. OCR Unit 3 Programming Task

  3. PRINCIPLESOF TESTING

  4. Test Case A use of a program Particular input Test Data Expected results Actual result Important programs are tested using lots of test cases

  5. Test Data The values used to test a program FROM PROBLEM (not program) Valid Expected to be accepted by the program Extreme Check boundaries Invalid Expected to be rejected

  6. Boundary Values if x > 10 and x <= 17 : print("Ans is", x + y) else : print("Out of range") Boundaries are: x == 10 out of range: just too small x == 11 in range: just large enough x == 17 in range: just small enough x == 18 out of range: just too big

  7. Test Plan / Evidence Shows tests and results Test 1 2 3 4 5 6 Data Reason Expected Ans is: 21 Outcome Correct Correct Correct Correct Correct Correct x = 11, y = 10 x = 11, y = - 5 x = 17, y = 20 x = 17, y = -20 x = 10, y = -1 x = 18, y = 100 x in range, y positive x in range, y negative Ans is: 6 x in range, y positive x in range, y negative Ans is: -3 x out of range x out of range Ans is: 37 Out of range Out of range

  8. GCSE Syllabus OCR Specification Use a suitable test plan and data to test functions of the system AS/A2 Similar, but more complex application

  9. Teaching Issue Are industry processes relevant? Systems very complex Lots of tests can be tedious for small scale projects When to write test plan? Link to Bugs in s/w we use; bugs in open source projects Social / ethical

  10. Bug List - Example

  11. EXAMPLE

  12. OCR Unit 3 Task A Example Design, code and test a program to calculate the body mass index (BMI) for an adult. The program should work in metric units (kg and cm) or imperial units (stones and pounds, and feet and inches). The user should be able to choose which units. The system should output the BMI and the appropriate category from: Less than 18.5 Underweight Between 18.5 and 25 Normal Between 25 and 30 Overweight Greater than 30 Obese Incorrect! m not cm The formulae are: Metric: BMI = weight in Kg / (height in cm) 2 Imperial: BMI = (weight in pounds x 703) / (height in inches)2

  13. Analysis Height ranges 4 ft 7 ft 122 cm to 213 cm Weight 4st, 0lb to 30st, 0lb 25kg to 190 Kg

  14. Test Data (Spreadsheet) Stone Pounds Feet Inches Pounds Inches BMI UnderW? Obese Yes Yes Yes Yes No No No No No No No No Normal No No No No Yes Yes No No No No No No OverW No No No No No No Yes No No No No Yes CM 182.9 185.4 188.0 171.5 170.2 167.6 165.1 162.6 160.0 157.5 154.9 188.0 Kg 5 6 7 8 9 7 7 7 7 7 7 7 7 7 7 7 7 6 6 6 5 5 5 5 5 5 5 5 6 0 1 2 77 91 72 73 74 10.4 12.0 13.5 18.4 20.8 23.7 26.8 30.0 33.5 37.1 41.0 29.7 No No No No No No No Yes Yes Yes Yes No 34.9 41.3 47.6 54.0 60.3 66.7 73.0 79.4 85.7 92.1 98.4 104.8 105 119 133 147 161 175 189 203 217 231 7.5 67.5 67 66 65 64 63 62 61 74 7 6 5 4 3 2 1 2 10 11 12 13 14 15 16 8 8 8 9 9 9 2.6 4.8 11.5 1.9 6.3 10.7 1.1 7.7 5.5 5 5 5 5 5 5 4 4 4 6.1 6.5 3.0 2.2 1.4 0.6 11.8 11.1 10.3 114.6 116.8 123.5 127.9 132.3 136.7 141.1 147.7 145.5 66.1 66.5 63.0 62.2 61.4 60.6 59.8 59.1 58.3 18.4 18.6 21.9 23.2 24.7 26.1 27.7 29.8 30.1 Yes No No No No No No No No No No No No No No No No Yes No Yes Yes Yes Yes No No No No No No No No No Yes Yes Yes No 168.0 169.0 160.0 158.0 156.0 154.0 152.0 150.0 148.0 52.0 53.0 56.0 58.0 60.0 62.0 64.0 67.0 66.0 10 10 10

  15. Test Plan (Incomplete) Test 1 Data Reason Imperial In range Imperial In range Metric In range Height too large Expected BMI 18.5 Underweight BMI 30.0 Obese BMI 21.9 Normal N/A Result 5ft,7in 8st,6lb 5ft, 4in 11st, 7lb 160cm, 56 Kg 300 cm, 56 Kg 2 3 4

  16. Summary Technique and process Expected to be used

More Related Content