Learning Objectives for Quiz 5
Debugging
Types of Bugs
- Define syntax and semantic errors.
- Compare and contrast syntax errors and semantic errors.
- Give examples of syntax errors and semantic errors in R.
- Given a bug in R code, identify whether it is a syntax error or a semantic error.
The Process of Debugging
- State the 4 main stages involved in debugging.
- Describe the sort of actions that can be taken during the stages of debugging.
traceback()
- Explain what
traceback()
does when run after encountering an error message.
- Given an error message and a call to
traceback()
, state the chain of functions that were called leading to the error.
- Use
traceback()
to help identify the bug leading to an error message.
- Use
browser()
to inspect the state of variables in a function.
- Use
browser()
to step through a function and into other functions.
- State the 5 main commands that are used after a call to
browser()
to step through code.
- Use
browser()
within RStudio, including the Environment and Traceback panes, to identify, characterize, and fix a bug in R code.
- Set breakpoints in R scripts to enter the debugger mode in RStudio.
Debugging Using the Internet
- Describe a general procedure for deciphering an error message returned by R using the internet.
- State the most common end-locations for a Google search about an error in R.
- Describe the layout of a generic Stack Overflow page.
- Explain how to read a Stack Overflow page.
Version Control, Git, and GitHub
Version Control
- Define version control.
- State the advantages of using a version control system over the “duplicating and renaming” method of keeping versions of R code.
Git
- Explain, in broad strokes, how Git performs version control.
- Describe what a commit does in the context of Git.
- Describe what a repository is in the context of Git.
GitHub
- Explain how GitHub interacts with a local Git repository.
- Explain what pushing from a local repository to a GitHub repository does.
- Explain what pulling from a GitHub repository to a local repository does.
- Use RStudio’s built-in Git interface to commit changes and push and pull changes from a repository hosted on GitHub.
- Describe a typical workflow for using Git and GitHub within RStudio Cloud.