Debugging

Published

2024-09-04

Warning

The contents for section are under development. Thank you for your patience.

Expand the callout boxes below to review the previous testing chapters:

Test suite covers:

  1. Getting started with 10.2 Setting up testthat tests in your app-package

  2. An introduction to 10.3.4 BDD test functions

  3. Make running tests during development easier by setting 10.4.1 Keyboard shortcuts

Specifications dives into:

  1. The differences between 11.1 Application requirements, 11.1.1 User Specifications, 11.1.2 Features, and 11.1.3 Functional Requirements

  2. The 11.3 BDD and testthat functions (describe() and it()) are introduced

  3. Tracking features, requirements and tests with a 11.4 Traceability Matrix

The applications in Chapter 11 (Specifications) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 11 applications:

list_apps(regex = '^11')
## # A tibble: 1 × 2
##   branch         last_updated       
##   <chr>          <dttm>             
## 1 11_tests-specs 2024-09-03 22:33:22

Test tools covers:

  1. Where to store and how to use test 12.1 Test fixtures and 12.2 Test helpers

  2. Checking test coverage during 12.2.2 Test development

  3. Creating snapshots and 12.3.1 Reviewing _snaps/

The applications in Chapter 12 (Test tools) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 12 applications:

list_apps(regex = '^12')
## # A tibble: 3 × 2
##   branch               last_updated       
##   <chr>                <dttm>             
## 1 12.1_tests-fixtures  2024-09-14 07:13:41
## 2 12.2_tests-helpers   2024-09-03 22:39:27
## 3 12.3_tests-snapshots 2024-09-03 22:42:57

Testing modules includes strategies for:

  1. Testing returned values with 13.1.1 Testing return values

  2. Passing module arguments with 13.1.3 Testing module parameters

  3. Checking 13.2 Module test coverage and 13.2.1 Testing module outputs

The applications in Chapter 13 (Testing modules) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 13 applications:

list_apps(regex = '^13')
## # A tibble: 1 × 2
##   branch           last_updated       
##   <chr>            <dttm>             
## 1 13_tests-modules 2024-09-03 23:11:59
  1. Introduction to 14.2 Setting up shinytest2

  2. Using shinytest2 to 14.3 Record a test

  3. Exporting test values with 14.5 The test.mode option

The applications in Chapter 14 (System tests) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 14 applications:

list_apps(regex = '^14')
## # A tibble: 1 × 2
##   branch          last_updated       
##   <chr>           <dttm>             
## 1 14_tests-system 2024-09-03 23:23:17

Debugging is an essential skill for any programmer, and it’s not restricted to fixing errors or broken code.

Utility functions

Debugging apps

Exploring code