Scheme of work Cambridge International AS & A Level Computing (9691)

Similar documents
2.2 (a) Statement, subroutine, procedure, function, parameter, loop

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode

TABLE OF CONTENTS 2 CHAPTER 1 3 CHAPTER 2 4 CHAPTER 3 5 CHAPTER 4. Algorithm Design & Problem Solving. Data Representation.

GE PROBLEM SOVING AND PYTHON PROGRAMMING. Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING

Higher Computing Science Software Design and Development - Programming Summary Notes

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Chapter 2.5 Writing maintainable programs

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

Programmers should write code that is self-documenting and split into small sections.

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee

Cambridge Assessment International Education Cambridge International Advanced Subsidiary and Advanced Level. Published

Developing Algorithms

Method & Tools for Program Analysis & Design

Individual research task. You should all have completed the research task set last week. Please make sure you hand it in today.


Pace University. Fundamental Concepts of CS121 1

GraphQuil Language Reference Manual COMS W4115

Full file at

STUDENT LESSON A12 Iterations

Switching to AQA from Edexcel

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level


COP 1220 Introduction to Programming in C++ Course Justification

9691 COMPUTING. 9691/22 Paper 2 (Written Paper), maximum raw mark 75

Curriculum Map Grade(s): Subject: AP Computer Science

Total Test Questions: 43 Levels: Grades Units of Credit:.50

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Chapter 2 Working with Data Types and Operators

The PCAT Programming Language Reference Manual

Introduction to C Final Review Chapters 1-6 & 13

Computer Programming IA

Introduction to Programming Using Java (98-388)

SNS COLLEGE OF ENGINEERING,

Course Title: C Programming Full Marks: Course no: CSC110 Pass Marks: Nature of course: Theory + Lab Credit hours: 3

Chapter 2 Basic Elements of C++

Introduction to Java Applications

MARK SCHEME for the October/November 2013 series 9691 COMPUTING. 9691/21 Paper 2 (Written Paper), maximum raw mark 75

5 The Control Structure Diagram (CSD)

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators

National 5 Computing Science Software Design & Development

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level

Chapter 2.6: Testing and running a solution

1 Lexical Considerations

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Activity Guide - Will it Crash?

Programming revision. Revision tip: Focus on the things you find difficult first.

Stating the obvious, people and computers do not speak the same language.

Full file at

Software Development Techniques. December Sample Exam Marking Scheme

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level

Programming Logic and Design Seventh Edition Chapter 2 Elements of High-Quality Programs

Chapter 4: Control Structures I (Selection) Objectives. Objectives (cont d.) Control Structures. Control Structures (cont d.

Chapter 2.4: Common facilities of procedural languages

Sprite an animation manipulation language Language Reference Manual

Unit 6 - Software Design and Development LESSON 3 KEY FEATURES

PROBLEM SOLVING WITH FORTRAN 90

Understanding the problem

FRAC: Language Reference Manual

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

Variable A variable is a value that can change during the execution of a program.

GOLD Language Reference Manual

Chapter1 Overview of computers

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

Introduction to Computer Programming Using FORTRAN 77

Switching to AQA from OCR

Problem Solving with C++

Systems and Principles Unit Syllabus

Cambridge International General Certificate of Secondary Education 0478 Computer Science June 2015 Principal Examiner Report for Teachers

COMPUTING Syllabus Version 1.0

Algorithmic "imperative" language

DEPARTMENT OF COMPUTER AND MATHEMATICAL SCIENCES UNIVERSITI TEKNOLOGI MARA CAWANGAN PULAU PINANG

All copyrights reserved - KV NAD, Aluva. Dinesh Kumar Ram PGT(CS) KV NAD Aluva

RETURN X return X Returning a value from within a function: computes the value of variable exits the function and returns the value of the variable

Software Development 2

While Loops A while loop executes a statement as long as a condition is true while condition: statement(s) Statement may be simple or compound Typical

Edexcel GCSE in Computer Science Microsoft IT Academy Mapping

S/W Programming & Languages

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Unit 6 - Software Design and Development LESSON 3 KEY FEATURES

Simple Java Programming Constructs 4

Hrs Hrs Hrs Hrs Hrs Marks Marks Marks Marks Marks

VARIABLES. 1. STRINGS Data with letters and/or characters 2. INTEGERS Numbers without decimals 3. FLOATING POINT NUMBERS Numbers with decimals

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. A Guide to this Instructor s Manual:

Algorithms and Flowcharts

INTRODUCTION 1 AND REVIEW

3. Except for strings, double quotes, identifiers, and keywords, C++ ignores all white space.

Logical Operators and switch

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level

Microsoft Visual Basic 2005: Reloaded

Object Oriented Programming with Java

Working with JavaScript

TABLE OF CONTENTS 2 CHAPTER 1 3 CHAPTER 2 4 CHAPTER 3. Algorithm Design & Problem Solving. Programming. Databases

Steps to program development

Lexical Considerations

Pseudocode Structure 5th October 2018

Software Development Techniques. 26 November Marking Scheme

Transcription:

Scheme of work Cambridge International AS & A Level Computing (9691) Unit 2: Practical programming techniques Recommended prior knowledge Students beginning this course are not expected to have studied Computing or ICT. Context This unit should be completed before Unit 3 is started. Outline This unit provides students with an understanding of the techniques required for programming through a study of the following topics: designing solutions to problems the structure of procedural programs data types and data structures common facilities of procedural programs writing maintainable programs testing and running a solution Syllabus ref Learning objectives Suggested teaching activities Learning resources 2.1 Designing solutions to problems Content: 2.1.1 Design of the input, output and interface 2.1.2 Use of structure diagrams to describe the modular nature of a solution 2.1.3 Use of program flowcharts and pseudocode to describe the steps of an algorithm (a) discuss the importance of good interface design Recap on user interfaces and appropriateness of usage by different users (1.2 (d)). The web link resource gives some pointers for discussion on page 120 page 108 v1 2Y05 Cambridge International AS & A Level Computing (9691) 1

(b) design and document data capture forms, screen layouts, report layouts or other forms of input and output (e.g. sound) for a given problem (c) explain the benefits of designing a solution to a problem by splitting it up into smaller problems (top-down / modular design) interface design. Get students to make a summary of good points when designing an interface. Discuss the differences between data capture forms, screen forms and reports (nature of form, input or output, for viewing and/or filling, nature of application). Give students exercise to design forms, reports for a number of applications. Look at some of the solutions with students getting them to assess how good the designs are. Discuss other forms of input and output (see 1.8(d)) Discuss how to find the area of a 'house' made up from a square and a triangle by working out the area of the triangle, working out the area of the square and then adding the two together. Use this to explain what a top down approach is a large complex problem broken into smaller more manageable pieces. When each of the smaller problems has been solved then all the pieces are put together to give an overall solution. Introduce concept of modularity. Now discuss the problem of controlling a robotic production line. The problem is complex, but can be divided into smaller manageable pieces: how is the data going to be collected from sensors and stored in the system? what operations need to be processed and in what order? how is the decision going to be made about when to perform each operation? what outputs are necessary, and how are they controlled? More than one person or team of people can be engaged on solving different parts of the same problem at the same time. Therefore the problem can be solved more quickly. http://toastytech.com/guis/uirant.html pages 109 115 pages 115 116 www.teachict.com/as_as_computing/ocr/h447/f 453/3_3_7/programming/miniweb/pg2.htm www.cs.umbc.edu/~stephens/104/pp T/L22Top-DownDesign.ppt v1 2Y05 Cambridge International AS & A Level Computing (9691) 2

Give a similar problem to four teams in the classroom. The problem is to design a new computerised traffic light system for (name a local set of highway traffic lights controlling a road junction). Identify the four areas to be addressed as discussed in the production line example. Give each group time to brainstorm a solution, put all solutions together and see if that fulfils the original task. In this instance it does not matter if the group's solutions work if not it is better to provoke discussion about definition of each group's task, what we asked them to do, what input they required and what output they were expected to give. This should develop the idea of modular notation (on input, process, on output) as used in standard programming techniques. (d) produce and describe top-down / modular designs using appropriate techniques, including structure diagrams, showing stepwise refinement (e) produce algorithms to solve problems using both a program flowchart and pseudocode (f) understand algorithms presented in the form of program flowcharts and pseudocode Show how a tree-like diagram can illustrate the stepwise refinement that is the outcome of a top-down approach. Discuss the need to capture repetition and selection in a structure diagram and how this can be achieved. Give the students some exercises to produce structure diagrams for simple problems. Show students some examples of program flowcharts and pseudocode. Do dry runs on the examples to show students (i) how to tackle dry runs and (ii) how to interpret flowcharts symbols and pseudocode vocabulary. Give students guidance on the symbols to be used in producing flowcharts and the words to be used in the pseudocode. Produce flowcharts and pseudocode for a number of simple problems. Give the students some further questions on dry running some algorithms and also some questions on producing their own flowcharts and pseudocode. Show model solutions to the questions. page 116 http://haryanto.staff.gunadarma.ac.id/ Downloads/files/4039/11-DSR1.PPT pages 116 119 http://userpages.wittenberg.edu/bshel burne/comp150/algorithms.htm www.rff.com/flowchart_samples.htm page 119 v1 2Y05 Cambridge International AS & A Level Computing (9691) 3

2.2 The structure of procedural programs Content: 2.2.1 Basic programming constructs/control structures 2.2.2 Use of subprograms/subroutines, including procedures and functions 2.2.3 Recursion a) define and correctly use the following terms as they apply to procedural programming: statement, subroutine, procedure, function, parameter, loop (b) identify the three basic programming constructs used to control the flow of execution: sequence, selection and iteration Give out a printed copy of a program which consists of a main routine (with a loop), a procedure and a function with a single parameter. Discuss briefly the terms statement, subroutine, procedure, function, parameter, and loop. Bring out the relationship and differences between subroutine, procedure and function. Produce the algorithm to make a cup of tea (or coffee). Remind students about how to draw flowcharts and ask them to attempt to draw a flowchart to show how to make a cup of tea. This will lead to discussions about selection, sequence and repetition. Examples Sequence Use from cup of tea: Add water to kettle Put kettle on heat source as example of sequence decisions/selection with Y/N solutions Use from cup of tea: Do you take sugar? Discuss framing the questions to always give Yes or No answers. Create a flowchart to illustrate these steps. Selection: IF..Then..Else constructs Use from cup of tea: pages 138 139 pages 122 123 page 124 http://en.wikipedia.org/wiki/control_flo w v1 2Y05 Cambridge International AS & A Level Computing (9691) 4

Do you take sugar? If Yes then go to section which adds sugar to the cup, else If No go to the section for milk. Create a further flowchart for this section (perhaps as a module called Sugar). Iteration Use from cup of tea in the Sugar module: Add a little sugar Is this enough? If Yes return from the module If not go back to Add a little sugar Summarise that sequence, selection and iteration form the three basic programming constructs. (c) understand and use selection in pseudocode and a procedural programming language, including the use of IF statements and CASE/SELECT statements (d) understand and use iteration in pseudocode and a procedural programming language, including the use of countcontrolled loops (FOR-NEXT loops) and condition-controlled loops (WHILE- ENDWHILE and REPEAT-UNTIL loops) (e) understand and use nested selection and nested iteration statements Demonstrate use of IF and CASE statements using both pseudocode and programming language examples. Stress when is it appropriate to use each - although we can use the IF statement for very complex (nested) condition testing, the CASE statement usually makes it easier to read the code. Use examples to demonstrate the different types of iteration: number of iterations known initially (use of FOR-NEXT statements) and number of iterations not known initially (use of REPEAT-UNTIL or WHILE-ENDWHILE). Explain the need for WHILE-ENDWHILE (e.g. reading records from a file that might contain zero records). A number of exercises need to be developed here to reinforce these elements. Demonstrate using some examples (not too complex) nested selection and nested iteration. Ensure that the nested iterations contain a mixture of the alternative methods (e.g. FOR-NEXT inside REPEAT-UNTIL). pages 124 126 http://en.wikipedia.org/wiki/control_flo w pages 126 128 http://en.wikipedia.org/wiki/control_flo w pages 128 129 v1 2Y05 Cambridge International AS & A Level Computing (9691) 5

(f) understand, create and use subroutines (procedures and functions), including the passing of parameters and the appropriate use of the return value of functions (g) use subroutines to modularise the solution to a problem (h) identify and use recursion to solve problems; show an understanding of the structure of a recursive subroutine, including the necessity of a stopping condition (i) trace the execution of a recursive subroutine Recap on procedures, functions and parameters. Explain call by value and call by reference. Include the underlying mechanisms (creation of local variable and value copied to it; two labels to the same item of data), effects (no change to original variable value in call by value whatever changes are made to local variable copy; any change to local variable in call by reference changes original variable value). Illustrate these ideas by running through some examples. Give students a few exercises. Run through solutions. Discuss how to handle returned values from functions. Function result must be stored, output, used in an expression, Show some examples of various ways in which function results are handled. Discuss how modularising a problem can be beneficial in both writing and maintaining the code. The modules would be either procedures or functions and would have self-contained tasks. Discuss nature of recursion: a subroutine that calls itself; to succeed it needs a stopping condition. Show some definitions that are suitable for solution by recursive algorithms. Discuss where in the algorithms the recursion occurs and also highlight and discuss the stopping conditions. Give students a couple of recursive subroutines and ask them to highlight the recursive calls and also the stopping conditions. Include some examples that do have recursive calls or stopping conditions omitted. Being able to trace successfully a recursive subroutine is very helpful in grasping recursion. Use a diagrammatic method of tracing which clearly shows: the recursive descent until the stopping condition is encountered; the return of values as the recursion unwinds. Factorial and Fibonacci are suitable examples to demonstrate. Give students some questions (include some nonmathematical examples e.g. printing a list of items). Check pages 129 133 pages 133 134 pages 134 135 http://en.wikipedia.org/wiki/recursion _%28computer_science%29 page 136 http://en.wikibooks.org/wiki/alevel_computing/aqa/problem_solvi ng,_programming,_operating_syste ms,_databases_and_networking/pro v1 2Y05 Cambridge International AS & A Level Computing (9691) 6

(j) discuss the relative merits of iterative and recursive solutions to the same problem their answers. Compare iterative and recursive algorithms for a couple of problems. Discuss size of solution, elegance of solution, runtime memory requirements and speed of execution with regard to the two alternative versions of a solution. gramming_concepts/recursive_tech niques pages 136 137 2.3 Data types and data structures Content: 2.3.1 Data types: integer, real, Boolean, character, string 2.3.2 Data structures: arrays (one- and twodimensional), records 2.3.3 Storing, retrieving and searching for data in files (a) define and use different data types e.g. integer, real, Boolean, character and string (b) define and use arrays (one- and twodimensional) for solving simple problems (this should include initialising arrays, reading data into arrays and performing a simple serial search on a one-dimensional array) Recap data types (1.3(a),(b),(c)). Explain the features of and difference between different data types. Identify suitable data for different functions. Explain which data types are suitable for different data. Explain relative storage sizes of different data types. Give students a worksheet to select the correct data types for different samples of data. Enhance this to include storage sizes. Marking these worksheets orally in class should provoke and stimulate discussion on different storage types and the relative merits of each for specific functions. Ensure that all data types listed are covered. Demonstrate the purpose of an array using an example. Explain the purpose and structure of one-dimensional arrays. Explain memory allocation, initialising arrays and reading data into arrays. Set worksheet exercises to practise setting up one- pages 153 154 pages 142 143 http://en.wikipedia.org/wiki/data_type pages 143-146 www.homeandlearn.co.uk/net/nets6p 1.html v1 2Y05 Cambridge International AS & A Level Computing (9691) 7

dimensional arrays and reading data into these arrays. As a class activity or in small groups design and write routine/s to perform a simple serial search on an array. Use a further example to demonstrate the need for multidimensional arrays and give students similar exercises to work on one-dimensional arrays. Discuss the need for dimensioning arrays and demonstrate how to do this. (c) design and implement a record format (d) estimate the size of a file from its structure and the number of records (e) store, retrieve and search for data in files (f) use the facilities of a procedural language to perform file operations (opening, reading, writing, updating, inserting, appending and closing) on sequential files Recap on the relationship between files, records and fields (1.3(f)). Discuss the design of a record format based on a file storing details on students in the class. Show how this record structure would be implemented in a particular programming language. Demonstrate how to calculate from a pre-defined file structure an estimated file size given the number of records. Discuss how records in a sequential file can be stored by opening a file, writing a record and then closing the file. Discuss how a sequential file can be searched for a particular record and its contents output. Show how the algorithms produced in (e) can be implemented in a program that: opens a file initially and closes it at the end. Via a menu a user can choose to read a chosen record, update a chosen record, insert a new record and append a new record. Discuss the syntax of the file operation statements to clarify how they are achieved using the particular procedural language. It may be beneficial, if possible, to look at the file records before and after a number of operations have been carried out on the file. This should help students to understand more clearly the file operations that are carried out but also how the records are actually stored. pages 146 148 http://visualbasic.freetutes.com/learnvb6/lesson6.1.html page 148 pages 148 149 pages 149 152 www.dreamincode.net/forums/topic/2 9575-file-handling-in-visual-basic-6- part-1-sequential-files/ v1 2Y05 Cambridge International AS & A Level Computing (9691) 8

2.4 Common facilities of procedural languages Content: 2.4.1 Assignment statements 2.4.2 Arithmetic, relational and Boolean operations 2.4.3 String manipulation 2.4.4 Input and output facilities (a) understand and use assignment statements (b) understand arithmetic operators including operators for integer division (+,, *, /, MOD and DIV) and use these to construct expressions (c) understand a range of relational operators, e.g. =, <, <=, >, >= and <> and use these to construct expressions (d) understand the Boolean operators AND, OR, and NOT and use these to construct expressions (e) understand the effects of the precedence of standard operators and the use of parentheses to alter the order of evaluation Discuss the nature of an assignment statement: an expression is evaluated and its result is assigned to a variable. All procedural languages will have facilities for performing the standard arithmetic operations on numbers. In addition MOD and DIV are (typically) integer operations. Show examples of MOD and DIV and follow up with some exercises. Discuss the set of relational operators for comparison of two entities that results in either true/false or 0/1 depending upon the programming language. Illustrate with a number of expressions. Recap on association with selection statements (2.2.(c)). Discuss / remind students about the Boolean operators AND, OR and NOT and their actions as expressed in truth tables. Show some examples of expressions using these operators. Show students some examples of expressions where precedence has an effect e.g. 2+3*4. Discuss the concept of precedence and the use of parentheses to change the order in which operations are carried out. Work through a couple of examples (of increasing complexity) to demonstrate precedence and parentheses in action. Give students some examples to work through. Run through their solutions. page 161 page 155 page 155 www.techotopia.com/index.php/visua l_basic_arithmetic pages 155 156 page 156 pages 156 157 www.techotopia.com/index.php/visua l_basic_arithmetic v1 2Y05 Cambridge International AS & A Level Computing (9691) 9

(f) evaluate expressions containing arithmetic, relational and Boolean operators and parentheses (g) understand and use a range of operators and built-in functions for string manipulation, including location (LOCATE), extraction (LEFT, MID, RIGHT), comparison, concatenation, determining the length of a string (LENGTH) and converting between characters and their ASCII code (ASCII and CHAR) (h) understand that relational operations on alphanumeric strings depend on binary codes of the characters (i) input and validate data (j) output data onto screen/file/printer, formatting the data for output as necessary Run through the evaluation of expressions which contain mixtures of Boolean operators and relational operators to show how precedence and parentheses affect these operators. Give students some examples to work through. Run through their solutions. Discuss that arithmetic operations cannot be performed on strings. But there are other operations that are useful for manipulating strings and that these are usually in the form of functions (which need parameter(s) and return results). Issue hand-out which has the name of the function, description of what function does, and an illustrative example. Look at concatenation and comparison of two strings and show how these operations are expressed. Give students examples to answer. Run over their answers. Remind students that the ASCII and CHAR functions reinforce the idea that strings are actually stored as a series of (binary) numbers and that comparison of characters is actually the comparison of their (binary) codes. Consequently it is possible to perform a comparison between 2 and a and get a valid result. Discuss the facilities available in the procedural programming language for the input of data. Discuss the output facilities present in the procedural programming language. Show how the language handles different output destinations: screen, printer or file. Also show how the output can be formatted for the different characteristics of the device. page 157 pages 157 158 www.developerbarn.com/microsoftaccess/103-string-functions-listedname.html pages 158 159 pages 159 160 pages 160 161 2.5 Writing maintainable programs Content: 2.5.1 Declaring and using variables and constants pages 169 170 v1 2Y05 Cambridge International AS & A Level Computing (9691) 10

2.5.2 Self-documented code, including identifiers, annotation and formatting (a) define, understand and use the following terms correctly as they apply to programming: variable, constant, identifier, reserved word/keyword (b) declare variables and constants, understanding the effect of scope and issues concerning the choice of identifier (including the need to avoid reserved words/keywords) (c) select and use meaningful identifier names (d) initialise variables appropriately, before using them (e) annotate the code with comments so that the logic of the solution can be followed Give out a printed copy of a short program which uses both variables and constants. Discuss briefly the terms variable, constant, identifier and reserved word / keyword. Get students to list all the variables, constants, identifiers and reserved words /keywords present in the program. Check answers ensuring that the terms have been correctly understood. Discuss with students the fact that some languages require variables to be declared before use whilst other languages do not. Discuss why it is useful to declare and name a constant. Show an example of code which demonstrates variable and constant declarations in both the main program and in subroutines / procedures /functions. Use this code to discuss scope with students and also the advantages of declaring constants. Show students a program for finding the average of a set of numbers (the number of numbers is input by the user) but written with unsuitable / obscure identifier names. Ask students to comment on the program code. When the idea of using meaningful identifier names has been grasped get students to rewrite the program changing the identifier names. Discuss techniques for naming identifiers which aid readability (e.g. use of space, underscore, and capital letters). Often there are conventions about the names that are used. Discuss the benefits of initialising variables. Give some examples where uninitialized variables could lead to either run-time errors or erroneous results. Show that an uninitialized variable has a value but not a predictable one. Discuss the advantages of putting comments into code. Show, using examples, that too many comments can be as ineffective as too few comments. page 163 pages 163 166 page 166 http://en.wikipedia.org/wiki/naming_c onvention_%28programming%29 pages 166 168 pages 168 169 v1 2Y05 Cambridge International AS & A Level Computing (9691) 11

http://msdn.microsoft.com/enus/library/bx185bk6%28v=vs.80%29. aspx (f) use indentation and formatting to show clearly the control structures within the code Demonstrate with examples the differences in making sense of code structure when indentation and formatting are used. page 169 http://en.wikibooks.org/wiki/c_progra mming/structure_and_style 2.6 Testing and running a solution Content: 2.6.1 Types of programming errors 2.6.2 Testing strategies and test data 2.6.3 Debugging 2.6.4 Installation and execution (a) describe types of errors in programs (syntax, logic and run-time errors) and understand how and when these may be detected (b) describe testing strategies including white box testing, black box testing, alpha testing, beta testing and acceptance testing Demonstrate errors practically with a couple of small programs that have the three types of error present in them. Show when the errors will arise and what (in case of syntax and run-time) messages are produced. Show that logic errors don t produce error messages. Introduce the idea of black box testing: Black-box test design treats the system as a black-box, so it does not explicitly use knowledge of the internal code and structure. Black-box test design is usually described as focusing on testing functional requirements, external specifications or interface specifications of the program or module. Introduce white box testing testing all routes through a program. Give the students a number of small programs, with test plans which they should classify as black box or white box testing. pages 175 176 pages 171 172 http://msdn.microsoft.com/enus/library/s9ek7a19%28v=vs.80%29. aspx pages 172 173 http://en.wikipedia.org/wiki/software_t esting v1 2Y05 Cambridge International AS & A Level Computing (9691) 12

Introduce the concepts of alpha testing and beta testing. These are user tests. Explain that the programmer tests focus on error-free processing. User tests focus on usability, functionality, and performance. User testing with test data is called alpha testing. This is then followed by beta testing during which users use the system with their own data. Introduce acceptance testing. This is the final test by the customer to check that the developed system is what they asked for. (c) select suitable test data for a given problem, including normal, borderline and invalid data For black box testing, students should be shown how to select inputs which are normal, borderline, and invalid. As an example for black box testing, use the following: E.g.:- Problem: Read two numbers, a and b. Put the larger of the numbers into the box c. Conditions to be tested: both numbers positive - a larger - b larger one number positive - a positive - b positive both numbers negative - a larger (less negative) - b larger one number zero - a = 0 - b = 0 both numbers equal - both positive - both negative - both zero other conditions... A number of small algorithms containing errors and test plans with pre-determined data. There needs to be two sets with different types of error to allow for both black box and white page 173 www.ictessentials.com/resources/files /Computing/AS/CPT2/Lesson%20Not es/cpt2_6%20testing.pdf v1 2Y05 Cambridge International AS & A Level Computing (9691) 13

box testing. (d) perform a dry run on a given algorithm, using a trace table (e) describe the use of a range of debugging tools and facilities available in procedural programming languages including translator diagnostics, break points, stepping, and variable check/watch Demonstrate the use of dry runs (desk checking) on simple arithmetic programs with loops. Demonstrate practically the range of debugging tools typically available. Translator diagnostics help with syntax and runtime error messages. Show examples. For logic errors need to use interpreter which has the tools mentioned. Produce a code example which has a logic error. A suitable example might be code that finds the average of a set of 100 numbers where the error is in the final arithmetic division which computes the average. A break point could be set just prior to the calculation (so that the loop does not have to be stepped through), the variables can be checked before and after the calculation which can be stepped through. pages 173 174 www.theteacher.info/alevelocr/we bpages/f452_progtechn/dryruns/d ryruns.html pages 174 175 http://msdn.microsoft.com/enus/library/aa290042%28v=vs.71%29. aspx v1 2Y05 Cambridge International AS & A Level Computing (9691) 14