Learning Objectives for Quiz 5

Debugging

Types of Bugs

  1. Define syntax and semantic errors.
  2. Compare and contrast syntax errors and semantic errors.
  3. Give examples of syntax errors and semantic errors in R.
  4. Given a bug in R code, identify whether it is a syntax error or a semantic error.

The Process of Debugging

  1. State the 4 main stages involved in debugging.
  2. Describe the sort of actions that can be taken during the stages of debugging.

traceback()

  1. Explain what traceback() does when run after encountering an error message.
  2. Given an error message and a call to traceback(), state the chain of functions that were called leading to the error.
  3. Use traceback() to help identify the bug leading to an error message.

Debugging Tools in R

  1. Use browser() to inspect the state of variables in a function.
  2. Use browser() to step through a function and into other functions.
  3. State the 5 main commands that are used after a call to browser() to step through code.
  4. Use browser() within RStudio, including the Environment and Traceback panes, to identify, characterize, and fix a bug in R code.
  5. Set breakpoints in R scripts to enter the debugger mode in RStudio.

Debugging Using the Internet

  1. Describe a general procedure for deciphering an error message returned by R using the internet.
  2. State the most common end-locations for a Google search about an error in R.
  3. Describe the layout of a generic Stack Overflow page.
  4. Explain how to read a Stack Overflow page.

Version Control, Git, and GitHub

Version Control

  1. Define version control.
  2. State the advantages of using a version control system over the “duplicating and renaming” method of keeping versions of R code.

Git

  1. Explain, in broad strokes, how Git performs version control.
  2. Describe what a commit does in the context of Git.
  3. Describe what a repository is in the context of Git.

GitHub

  1. Explain how GitHub interacts with a local Git repository.
  2. Explain what pushing from a local repository to a GitHub repository does.
  3. Explain what pulling from a GitHub repository to a local repository does.
  4. Use RStudio’s built-in Git interface to commit changes and push and pull changes from a repository hosted on GitHub.
  5. Describe a typical workflow for using Git and GitHub within RStudio Cloud.