College Board 1.3 1.4 - LindaLiu1202/lindaliu GitHub Wiki

College Board 1.3.1 Video Notes

  • How is a program developed?
    • Programs are developed with a specific function in mind
    • Developers follow specific steps and follow through with them
      • Sometimes development can be more exploratory
    • Developers start investigating the problem/purpose and reflect
      • Investigation is important (surveys, user testing, interviews, direct observations)
      • Developers: determine the requirements of the program, understand the constraints, and understand the user concerns and interests
    • After initial investigation and reflection:
      • Developers design the program by: brainstorm, storyboard the program, plan user experience, lay out user interface, organize into modules, develop testing strategy
  • Developers decide program requirements that list user interactions and describe how a program should behave
  • Program specifications outline all program requirements
  • Developers create a prototype of the program
    • Incremental process frequently used by developers so that they can work in small increments then test
    • Testing occurs at micro and macro levels, at every step of the development

College Board 1.3.2 Video Notes

  • Program development is rarely a solo endeavor
    • Usually developed by teams of people
    • Individuals/teams work on different functional components
    • Each member of the project deserves to receive credit for their work
    • Their names must be written in the documentation of the program indication their contributions to the project
  • While documentation is an important place to give credit:
    • Many project use comments within the programming language to give credit
    • This is an important part of the development of the program
    • When developers find a bug they need to be able to determine who can/should fix the problem
    • This may not be most useful after a program is completed and users find additions bugs
  • Many times developers use code segments, procedures, algorithms, and more that are written by others
    • These other individuals are not necessarily a part of the project, but they still deserve to be credited
      • This is similar to quoting someone in a research paper or article
    • Any code segments, procedures, algorithms, are considered intellectual property of the author
    • The program documentation should include the author’s name and the source of any code segment being used
    • This portion of the documentation may resemble a bibliography or a works cited page in a research paper

College Board 1.3.3 Video Notes

  • Programmers create something called program documentation in order to:
    • Describe the overall program
    • List program specifications
    • Describe functions, procedures, methods with the code, code segments, lists of events/corresponding outputs, development of the program, how other programs interact with the program
    • List of contributors and authors of the program
  • Documentation happens throughout the development process of the program:
    • At the beginning - list specification
    • During - to keep track of process
    • After - to explain the overall process
  • Documentation throughout can improve:
    • Efficiency of overall programming process
    • Programmer’s ability to test and refine the program
    • Programmer’s response to bugs
  • Most programming languages offer a commenting feature, although some do not
    • Commenting allows programmers to write text within the program
    • This text doesn’t affect the program
    • Comments are for programmers to read
    • This is a form of documentation and can be very useful when programmers collaborate or work individually
  • Text languages:
    • Python: #comments appear on lines that follow the pound symbol
    • Java: //comments appear on single line after the double forward slashes

College Board 1.4.1 Video Notes

  • Programmers are constantly running into errors when they program

    • In fact, its an explanation that errors are a part of the programming process
    • Proficient programmers can identify errors as one of the following types:
      • Logic error
      • Syntax error
      • Run-time error
      • Overflow error
  • Logic Error:

    • This error is caused by the programmer making a mistake in the algorithm, which causes the program to behave unexpectedly
  • Syntax error:

    • This is a mistake when a programmer makes a typo or writes some code that doesn’t follow the rules of the language
    • Syntax errors cause the program to fail to run/compile
    • Common examples are: colon, semicolon, parenthesis, curly braces, indentation, quotes, variable definitions
  • Run-time error:

    • When a program fails in the midst of running
    • This error is commonly referred to as a bug
    • The key to identifying this error is that the program runs/compiles initially, but fails and cannot complete its process
    • May result from: dividing by zero, inappropriately entered data type
  • Overflow error:

    • When a program is required to perform a calculation that’s outside of defined value range
    • Due to memory allocation constraints that programming languages require, certain values are too big to calculate and/or display

College Board 1.4.2 Video Notes

  • The easiest error to correct is usually the syntax error

    • Most integrated development environments display information when there is a syntax error
    • This information usually directs the programmer to the line in the program where the error occurred
    • Sometimes the user needs to do a little digging to find the error
  • The more difficult errors to find/correct are logic errors

    • A logic error isn’t always immediately noticed
    • Using test cases is the first strategy programmers use to find logical errors
  • Hand tracing can be most useful with iteration

    • Hand tracing is simply writing out the values of the variables within the loop as it iterates to determine if the outcome is correct
    • Can be useful for small code segments and loops that iterate a small number of times
    • Larger code segments or loops might require a debugging program
  • Hand tracing shows us that the algorithm was actually just displaying the last time a number was less than the number after if in a list

  • A programmer would use this strategy to help find and fix an error

  • Once the error is corrected, the extra output statements are usually removed

  • This has a similar effect as hand tracing, but allows the computer to do more of the work

College Board 1.4.3 Video Notes

  • When do we start testing a program?
    • Programs start testing on the onset of development
      • Or start thinking of testing
      • As soon as they know the specifications, they wonder how they know program is running
  • Specification Influence Testing:
    • Recall program specifications list
    • Programmers need to define the inputs to determine whether/whether not specifications were met
    • Ex: algorithm designed to find minimum in a list
  • How does this influence program development?
    • Once inputs/outputs are determined, the programmers test
    • After testing, programmers refine to better the results
    • Continue this process until they have the users test
    • Once again refine and then release