210 likes | 340 Views
Programming Standards CS4HS. Intro. Big picture of programming standards What’s new at L3? What are the step ups? How do we assess them? Resources for teaching online book on Python, Otago book – level 3 coming out. The Big Picture. 1.45 Designing little programs. 1.45 Implementing
E N D
Intro • Big picture of programming standards • What’s new at L3? • What are the step ups? • How do we assess them? • Resources for teaching • online book on Python, • Otago book – level 3 coming out.
The Big Picture 1.45 Designing little programs 1.45 Implementing little programs 2.45 Designing modular programs 2.45 Implementing modular programs 3.46 Design and Code bigger programs
Design vs Code • The split between design and coding (level 1 and 2 only) • emphasises the importance of the design aspect • allows weaker students to get some credits • allows teachers to include at least 3 credits, if not room for the full 6 credits. • Intended to be taught, done, and assessed together • but OK to just do the implementation standard • Level 3 combines them in a single standard • Definitely expect students to do both
The step ups in program constructs • Level 1 • Variables and values • Conditionals (if..else), loops (while… for…) • Input and output • What's added at level 2? • Program decomposed into modules (functions) • Functions with parameters (rules out Scratch) • Lists/Arrays/Sequences • What's added at level 3? • Simple GUI: event-based input • Simple object oriented: defining a class of objects • Must be a text based language • Design and implementation integrated
Other parts of the standard Not just using the programming constructs to make a correct program: • Using the constructs well - good design, “well chosen”, flexible, robust • Process of doing it • Independence, • Efficiency (of the process, not the program) • Staged development (Agile) L3 • Documenting: commenting, layout • Testing: • constructing test cases • testing and debugging the program
L3 Achieved • designing and implementing a program that includes variables, an indexed data structure, and a modular structure including details of the procedural structures of the modules • including a working graphical user interface with different sources of event generating components and event handling, and using classes and objects to encapsulate data and methods • setting out the program code clearly and documenting the program with comments • testing and debugging the program to ensure it works on a sample of expected input cases.
L3 Merit • using well-chosen modular and procedural structures, scope and encapsulation for data and methods, graphical user interface and event handling mechanisms • documenting the program with variable and module names and comments that accurately describe code function and behaviour. • following a disciplined design and implementation process, with documented cycles of incremental development and comprehensive testing process, to ensure that the program works on inputs that include both expected and boundary cases.
L3 Excellence • ensuring that the overall modular and procedural design, graphical user interface, and event handling design, are a well-structured, logical decomposition of the task, and that the program is flexible and robust • setting out the program code concisely and documenting the program with comments that explain and justify decisions • comprehensively testing and debugging the program in an organised and time effective way to ensure the program is correct on expected, boundary and invalid input cases.
Level 3:GUI • Program must have its own window • Not inside the “shell” • Might have graphical output, but not critical • Must respond to some kind of event-driven input • eg buttons, text fields, mouse clicks, key presses • Event-driven input changes the design and structure of the program • The program is no longer in control. • Fancy layout and good UI design is not required • Code for fancy layout is tricky and fiddly and not important • Programs should not be so complicated that UI design is significant • two or three buttons would be sufficient (at least for achieved)
Typical GUI program Two Steps • Set up the window and the components (buttons etc) • Specify what the program should do when an event happens • Design is different, because the user is in control, not the program. • Autogeneratedcode (drag and drop gui builders) is not banned, but doesn’t demonstrate that they understand it. • Their design and the code to respond to events should demonstrate the understanding.
Level 3: Classes and Objects • An object is a way of wrapping up multiple bits of data along with functions/methods/procedures that use that data. • “Fields” are variables in the object to hold values • Each object of the class has its own copies of the fields • Functions in the class operate on the particular object they were called on, access the fields of that object.
Level 3: Classes and Objects Using objects is straightforward: sam = new Turtle(topLeft) jan = new Turtle(botRight) sam.forward(150) sam.turn(30) jan.turn(180) jan.forward(60) • Using objects of predefined classes is almost unavoidable in OO languages (Python, Java, Visual Basic, …..) • The standard expects them to also define new classes, and create and use objects from those classes
Classes and Objects • Just more “Modularity” • Functions/Procedures/Methods: • wrapping up some instructions into a module • giving it a name • possibly giving it some parameters (information it will need) • then calling the module name instead of copying the instructions printWelcomeMessage(name) • Classes: • wrapping up a collection of variables along with functions/methods • giving it a name • creating new objects (instances) of the class, each with its own copies of these variables • calling functions on the objects.
Objects • Whenever you have some kind of entity in your program • more than just a string • more than just a number • especially if your program has more than one of them Create a class describing the entity • work out what information needs to be stored about the entity • work out what actions can be performed on the entity Eg, flower: • need to store its position, and possibly its colour • need to be able to draw it
Level 3: • Staged development • design, code, test, debug small part of program • repeatedly • extend the design and the code to cover more features/aspects • test and debug • requires a task for which there is a simple “core”, but which can be extended in a series of stages
Languages • Must be text based • Must support OO and GUI • Python • Java (but raw java is a bit nasty for the gui!) • Visual Basic (modern, not old) • Javascript
Assessment • How do we assess these standards • Require judgment on “well chosen” etc • Ideas? • keeping logs of the development process: • stages, testing, difficult bugs, design changes • screen shots, blog, testing forms • Keeping versions
Assessment Anthony Robbins “rubric” • Achieved: The program works • Merit: Nothing obviously wrong – "well chosen" • Excellence: A good program (clear, insight) – "well structured", "logical", “flexible”, “robust”
Ideas for projects? • Standalone programs…. • Integrated with web development…