Skip to document
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

CSC1015F 2018 1 Testing MK

Lecture notes for testing and debugging in python language for csc1015F.
Course

Computer science1015 (CSC1015F)

257 Documents
Students shared 257 documents in this course
Academic year: 2018/2019
Uploaded by:
0followers
1Uploads
10upvotes

Comments

Please sign in or register to post comments.

Related Studylists

studycsc1015fCSC1015F

Preview text

UCT Department of Computer Science CSC1015F Testing and Debugging Michelle Kuttel April 2018 Program Write a program that reads in a list of test scores and classifies them into ranks 1, 3, FS, F and, for each rank, displays: the number of students in the rank (output as a histogram). markClassificationSkeleton M. Kuttel May 2018 def main(): am I planning to do with these? val next test score (press key to while loop to read in unspecified no. of test scores TODO: add in code to count number in each category val next test score (press key to histogram(Fi,uS,S,Th,fS,Fa) line to indicate end of program def histogram(Fi,uS,S,Th,fS,Fa): Insert histogram here if __name__ main() does this do? conditional program execution explained (again?) Some Python module files are designed to be run directly usually referred to as programs or scripts Others are designed to be primarily imported and used other programs usually referred to as libraries Sometimes we want both functionalities, a module that can be either imported or run directly (when the main function will execute) 5 More explanation of conditional program execution Imagine that you have a Python computer game called SlimeMonsterBlood3 You can either run this as a game (execute it) or else import it as a module when creating another game (FairyCastlePrincess) In this case, you would use the functions in SlimeMonsterBlood3 (castSpell, fightMonster, getAmmunition) as building blocks for your new game 7 Explaining Conditional program execution You understand this, right? if x True: monsterBloodThree() 8 Explaining Conditional program execution Now, __name__ is just another variable if __name__ Run : monsterBloodThree() 10 Explaining Conditional program execution And __main__ is just another literal if __name__ __main__ : monsterBloodThree() 11 Errors and testing: Quick Poll In a typical hour spent programming, how many minutes do you spend fixing errors? Errors What is an error? n When your program does not behave as intended or expected. What is a bug? n is a bug in my program Debugging n the art of removing bugs The First The tale is that the original was a moth, which caused a hardware fault in the Harvard Mark I. The moth was found Grace Hopper Rear Admiral Grace Murray Hopper (December 9, 1906 January 1, 1992) was an American computer scientist and naval officer Worked on Mark I at Harvard the first USA computer science of the in 1969. Interview on Letterman show Reference: Types of Errors When (1) Error n Discovered when program is checked t the Python interpreter, before it is run. n A result of improper use of Python language n usually Syntax Errors. e. product x y Types of Errors Why (1) p Syntax Error n n Program does not pass stage. Improper use of Python language. p e. product x y Syntax errors are analogous to spelling or grammar mistakes in a language like English: e. you some does not make sense it is missing a verb. Types of Errors Why (1) p Common Python syntax errors : leaving out a keyword putting a keyword in the wrong place leaving out a symbol, such as a colon, comma or brackets misspelling a keyword incorrect indentation

Was this document helpful?
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

CSC1015F 2018 1 Testing MK

Course: Computer science1015 (CSC1015F)

257 Documents
Students shared 257 documents in this course
Was this document helpful?

This is a preview

Do you want full access? Go Premium and unlock all 61 pages
  • Access to all documents

  • Get Unlimited Downloads

  • Improve your grades

Upload

Share your documents to unlock

Already Premium?
Testing and Debugging
Michelle Kuttel
<mkuttel@cs.uct.ac.za>
April 2018
UCT Department of Computer Science CSC1015F

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.