Coverart for item
The Resource Testing R code, Richard Cotton, DataCamp, Cambridge, Massachusetts, USA

Testing R code, Richard Cotton, DataCamp, Cambridge, Massachusetts, USA

Label
Testing R code
Title
Testing R code
Statement of responsibility
Richard Cotton, DataCamp, Cambridge, Massachusetts, USA
Creator
Contributor
Author
Subject
Language
eng
Member of
Cataloging source
NhCcYBP
http://library.link/vocab/creatorName
Cotton, Richard
Dewey number
005.3028/7
Illustrations
illustrations
Index
index present
LC call number
QA76.73.R3
LC item number
C68 2017
Literary form
non fiction
Nature of contents
  • dictionaries
  • bibliography
http://library.link/vocab/relatedWorkOrContributorName
ProQuest (Firm)
Series statement
Chapman & Hall/CRC, the R series
http://library.link/vocab/subjectName
  • R (Computer program language)
  • Computer software
Label
Testing R code, Richard Cotton, DataCamp, Cambridge, Massachusetts, USA
Instantiates
Publication
Note
"A Chapman & Hall book."
Bibliography note
Includes bibliographical references and indexes
Carrier category
online resource
Carrier category code
  • cr
Carrier MARC source
rdacarrier
Content category
text
Content type code
  • txt
Content type MARC source
rdacontent
Contents
  • How Run-Time Testing Will Help You
  • Testing for Lack of Output
  • 3.6.
  • Varying the Strictness of Expectations
  • 3.7.
  • Providing Additional Information on Failure
  • 3.8.
  • Case Study: Calculating Square Roots
  • 3.8.1.
  • Exercise: Find More Tests for square_root
  • 3.9.
  • 1.4.
  • Other Expectations
  • 3.9.1.
  • Exercise: Testing the Return Type of Replicates
  • 3.10.
  • Organising Tests Using Contexts
  • 3.11.
  • Running Your Tests
  • 3.12.
  • Customizing How Test Results Are Reported
  • 3.13.
  • How Development-Time Testing Will Help You
  • Alternatives
  • 3.14.
  • Summary
  • 4.
  • Writing Easily Maintainable and Testable Code
  • 4.1.
  • Don't Repeat Yourself
  • 4.1.1.
  • Case Study: Drawing Lots of Plots
  • 4.1.2.
  • 1.5.
  • Idea 1: Use Variables Rather Than Hard-Coded Values
  • 4.1.3.
  • Idea 2: For Values That You Want To Change Everywhere, Update Global Settings
  • 4.1.4.
  • Idea 3: Wrap the Contents into a Function
  • 4.1.5.
  • Exercise: Reducing Duplication
  • 4.2.
  • Keep It Simple, Stupid
  • 4.2.1.
  • Summary
  • Simplifying Function Interfaces
  • 4.2.2.
  • Idea 1: Pass Arguments for Advanced Functionality to Another Function
  • 4.2.3.
  • Exercise: Outsourcing Argument Checking
  • 4.2.4.
  • Idea 2: Having Wrapper Functions for Specific Use Cases
  • 4.2.5.
  • Exercise: Wrappers for Formatting Currency
  • 4.2.6.
  • 2.
  • Idea 3: Auto-Guessing Defaults
  • 4.2.7.
  • Exercise: Providing Better Defaults for write.csv
  • 4.2.8.
  • Idea 4: Split Functionality into Many Functions
  • 4.2.9.
  • Exercise: Decomposing the quantile Function
  • 4.2.10.
  • Cyclomatic Complexity
  • 4.2.11.
  • Run-Time Testing with assertive
  • How to Reduce Cyclomatic Complexity
  • 4.2.12.
  • Exercise: Calculating Leap Years
  • 4.3.
  • Summary
  • 5.
  • Integrating Testing into Packages
  • 5.1.
  • How to Make an R Package
  • 5.1.1.
  • 2.1.
  • Prerequisites
  • 5.1.2.
  • Package Directory Structure
  • 5.1.3.
  • Including Tests in Your Package
  • 5.2.
  • Case Study: The hypotenuser Package
  • 5.3.
  • Checking Packages
  • 5.3.1.
  • Using Assertions
  • Exercise: Make a Package with Tests
  • 5.4.
  • Using Version Control, Online Package Hosting, and Continuous Integration
  • 5.4.1.
  • Version Control with git
  • 5.4.2.
  • Online Project Hosting
  • 5.4.3.
  • Continuous Integration Services
  • 5.5.
  • 2.1.1.
  • Testing Packages on CRAN
  • 5.5.1.
  • Testing Packages with r-hub
  • 5.6.
  • Calculating Test Coverage Using coveralls.io
  • 5.7.
  • Summary
  • 6.
  • Advanced Development-Time Testing
  • 6.1.
  • Machine generated contents note:
  • Chaining Assertions Together with Pipes
  • Code with Side Effects
  • 6.1.1.
  • Exercise: Writing a Test That Handles Side Effects
  • 6.2.
  • Testing Complex Objects
  • 6.2.1.
  • Exercise: Testing a Complex Object
  • 6.3.
  • Testing Database Connections
  • 6.3.1.
  • 2.2.
  • Option 1: Mock the Connection
  • 6.3.2.
  • Option 2: Mock the Connection Wrapper
  • 6.3.3.
  • Option 3: Mock the Specific Query Functions
  • 6.3.4.
  • Summarizing the Pros and Cons of Each Database Method
  • 6.4.
  • Testing Rcpp Code
  • 6.4.1.
  • Using Predicates: is and has Functions
  • Getting Set Up to Use C++
  • 6.4.2.
  • Case Study: Extending the hypotenuser Package to Include C++ Code
  • 6.4.3.
  • Exercise: Testing an Rcpp Function
  • 6.5.
  • Testing Write Functions
  • 6.5.1.
  • Exercise: Writing INI Configuration Files
  • 6.6.
  • 2.2.1.
  • Testing Graphics
  • 6.6.1.
  • Generating the Report from the markdown
  • 6.6.2.
  • Including Graphics Tests in Packages
  • 6.6.3.
  • Exercise: Write a Graphics Test Report
  • 6.7.
  • Summary
  • 7.
  • Exercise: Using Predicates and Assertions
  • Writing Your Own Assertions and Expectations
  • 7.1.
  • Quick, Nearly Good Enough Option
  • 7.2.
  • Writing Scalar Predicates
  • 7.2.1.
  • Exercise: Writing a Custom Scalar Predicate
  • 7.2.2.
  • Writing Type Predicates
  • 7.3.
  • 2.3.
  • Writing Scalar Assertions
  • 7.3.1.
  • Exercise: Writing a Custom Scalar Assertion
  • 7.4.
  • Writing Vector Predicates
  • 7.4.1.
  • Exercise: Writing a Vector Predicate
  • 7.5.
  • Writing Vector Assertions
  • 7.5.1.
  • Virtual Package System
  • Exercise: Writing a Vector Assertion
  • 7.6.
  • Creating Custom Expectations
  • 7.6.1.
  • Exercise: Create a Custom Expectation
  • 7.7.
  • Summary
  • A.
  • Answers to Exercises
  • A.1.
  • 2.4.
  • Preface
  • A.1.1.
  • Exercise: Are You Ready?
  • A.2.
  • Chapter 2
  • A.2.1.
  • Exercise: Using Predicates and Assertions
  • A.2.2.
  • Exercise: Examining an Object
  • A.2.3.
  • Tour of the assertive Package
  • Exercise: Inspecting Files and Directories
  • A.2.4.
  • Exercise: Testing Properties of Matrices
  • A.2.5.
  • Exercise: Explore Your R Setup
  • A.2.6.
  • Exercise: Checking Customer Data
  • A.2.7.
  • Exercise: Calculating the Harmonic Mean
  • A.3.
  • 2.4.1.
  • Chapter 3
  • A.3.1.
  • Exercise: Using expect_equal
  • A.3.2.
  • Exercise: Using expect_error
  • A.3.3.
  • Exercise: Using expect_output
  • A.3.4.
  • Exercise: Find More Tests for square_root
  • A.3.5.
  • 1.
  • assertive.base
  • Exercise: Testing the Return Type of Replicates
  • A.4.
  • Chapter 4
  • A.4.1.
  • Exercise: Reducing duplication
  • A.4.2.
  • Exercise: Outsourcing Argument Checking
  • A.4.3.
  • Exercise: Wrappers for Formatting Currency
  • A.4.4.
  • 2.4.2.
  • Exercise: Providing Better Defaults for write.csv
  • A.4.5.
  • Exercise: Decomposing the quantile Function
  • A.4.6.
  • Exercise: Calculating Leap Years
  • A.5.
  • Chapter 5
  • A.5.1.
  • Exercise: Make a Package with Tests
  • A.6.
  • assertive.properties
  • Chapter 6
  • A.6.1.
  • Exercise: Writing a Test That Handles Side Effects
  • A.6.2.
  • Exercise: Testing a Complex Object
  • A.6.3.
  • Exercise: Testing an Rcpp Function
  • A.6.4.
  • Exercise: Writing INI Configuration Files
  • A.6.5.
  • 2.4.3.
  • Exercise: Write a Graphics Test Report
  • A.7.
  • Chapter 7
  • A.7.1.
  • Exercise: Writing a Custom Scalar Predicate
  • A.7.2.
  • Exercise: Writing a Custom Scalar Assertion
  • A.7.3.
  • Exercise: Writing a Vector Predicate
  • A.7.4.
  • assertive.types
  • Exercise: Writing a Vector Assertion
  • A.7.5.
  • Exercise: Create a Custom Expectation
  • 2.4.4.
  • assertive.numbers
  • 2.4.5.
  • Exercise: Examining an Object
  • 2.4.6.
  • Introduction
  • assertive.files
  • 2.4.7.
  • Exercise: Inspecting Files and Directories
  • 2.4.8.
  • assertive.strings
  • 2.4.9.
  • assertive.matrices
  • 2.4.10.
  • Exercise: Testing Properties of Matrices
  • 2.4.11.
  • 1.1.
  • assertive.sets
  • 2.4.12.
  • assertive.models
  • 2.4.13.
  • assertive.reflection
  • 2.4.14.
  • Exercise: Explore Your R Setup
  • 2.4.15.
  • assertive.datetimes
  • 2.4.16.
  • Interacting vs. Programming
  • assertive.data, assertive.data.us, and assertive.data.uk
  • 2.4.17.
  • Exercise: Checking Customer Data
  • 2.4.18.
  • assertive.code
  • 2.5.
  • Controlling Severity
  • 2.6.
  • Fail Early, Fail Often
  • 2.7.
  • 1.2.
  • Case Study: Calculating the Geometric Mean
  • 2.7.1.
  • Exercise: Calculating the Harmonic Mean
  • 2.8.
  • Alternatives
  • 2.9.
  • Summary
  • 3.
  • Development-Time Testing with testthat
  • 3.1.
  • Two Kinds of Testing
  • Using Unit Tests
  • 3.2.
  • Structure of a Unit Test
  • 3.2.1.
  • Exercise: Using expect_equal
  • 3.2.2.
  • How Equal Is Equal?
  • 3.3.
  • Testing Errors
  • 3.3.1.
  • 1.3.
  • Exercise: Using expect_error
  • 3.4.
  • Different Types of Expectation
  • 3.5.
  • Testing Warnings and Messages
  • 3.5.1.
  • Chaining Expectations Together with Pipes
  • 3.5.2.
  • Exercise: Using expect_output
  • 3.5.3.
Control code
MSTDDA4786512
Dimensions
unknown
Extent
1 online resource (xvii, 177 pages ):
Form of item
online
Isbn
9781498763660
Isbn Type
(electronic bk.)
Media category
computer
Media MARC source
rdamedia
Media type code
  • c
Other physical details
illustrations.
Reproduction note
Electronic reproduction.
Specific material designation
remote
Label
Testing R code, Richard Cotton, DataCamp, Cambridge, Massachusetts, USA
Publication
Note
"A Chapman & Hall book."
Bibliography note
Includes bibliographical references and indexes
Carrier category
online resource
Carrier category code
  • cr
Carrier MARC source
rdacarrier
Content category
text
Content type code
  • txt
Content type MARC source
rdacontent
Contents
  • How Run-Time Testing Will Help You
  • Testing for Lack of Output
  • 3.6.
  • Varying the Strictness of Expectations
  • 3.7.
  • Providing Additional Information on Failure
  • 3.8.
  • Case Study: Calculating Square Roots
  • 3.8.1.
  • Exercise: Find More Tests for square_root
  • 3.9.
  • 1.4.
  • Other Expectations
  • 3.9.1.
  • Exercise: Testing the Return Type of Replicates
  • 3.10.
  • Organising Tests Using Contexts
  • 3.11.
  • Running Your Tests
  • 3.12.
  • Customizing How Test Results Are Reported
  • 3.13.
  • How Development-Time Testing Will Help You
  • Alternatives
  • 3.14.
  • Summary
  • 4.
  • Writing Easily Maintainable and Testable Code
  • 4.1.
  • Don't Repeat Yourself
  • 4.1.1.
  • Case Study: Drawing Lots of Plots
  • 4.1.2.
  • 1.5.
  • Idea 1: Use Variables Rather Than Hard-Coded Values
  • 4.1.3.
  • Idea 2: For Values That You Want To Change Everywhere, Update Global Settings
  • 4.1.4.
  • Idea 3: Wrap the Contents into a Function
  • 4.1.5.
  • Exercise: Reducing Duplication
  • 4.2.
  • Keep It Simple, Stupid
  • 4.2.1.
  • Summary
  • Simplifying Function Interfaces
  • 4.2.2.
  • Idea 1: Pass Arguments for Advanced Functionality to Another Function
  • 4.2.3.
  • Exercise: Outsourcing Argument Checking
  • 4.2.4.
  • Idea 2: Having Wrapper Functions for Specific Use Cases
  • 4.2.5.
  • Exercise: Wrappers for Formatting Currency
  • 4.2.6.
  • 2.
  • Idea 3: Auto-Guessing Defaults
  • 4.2.7.
  • Exercise: Providing Better Defaults for write.csv
  • 4.2.8.
  • Idea 4: Split Functionality into Many Functions
  • 4.2.9.
  • Exercise: Decomposing the quantile Function
  • 4.2.10.
  • Cyclomatic Complexity
  • 4.2.11.
  • Run-Time Testing with assertive
  • How to Reduce Cyclomatic Complexity
  • 4.2.12.
  • Exercise: Calculating Leap Years
  • 4.3.
  • Summary
  • 5.
  • Integrating Testing into Packages
  • 5.1.
  • How to Make an R Package
  • 5.1.1.
  • 2.1.
  • Prerequisites
  • 5.1.2.
  • Package Directory Structure
  • 5.1.3.
  • Including Tests in Your Package
  • 5.2.
  • Case Study: The hypotenuser Package
  • 5.3.
  • Checking Packages
  • 5.3.1.
  • Using Assertions
  • Exercise: Make a Package with Tests
  • 5.4.
  • Using Version Control, Online Package Hosting, and Continuous Integration
  • 5.4.1.
  • Version Control with git
  • 5.4.2.
  • Online Project Hosting
  • 5.4.3.
  • Continuous Integration Services
  • 5.5.
  • 2.1.1.
  • Testing Packages on CRAN
  • 5.5.1.
  • Testing Packages with r-hub
  • 5.6.
  • Calculating Test Coverage Using coveralls.io
  • 5.7.
  • Summary
  • 6.
  • Advanced Development-Time Testing
  • 6.1.
  • Machine generated contents note:
  • Chaining Assertions Together with Pipes
  • Code with Side Effects
  • 6.1.1.
  • Exercise: Writing a Test That Handles Side Effects
  • 6.2.
  • Testing Complex Objects
  • 6.2.1.
  • Exercise: Testing a Complex Object
  • 6.3.
  • Testing Database Connections
  • 6.3.1.
  • 2.2.
  • Option 1: Mock the Connection
  • 6.3.2.
  • Option 2: Mock the Connection Wrapper
  • 6.3.3.
  • Option 3: Mock the Specific Query Functions
  • 6.3.4.
  • Summarizing the Pros and Cons of Each Database Method
  • 6.4.
  • Testing Rcpp Code
  • 6.4.1.
  • Using Predicates: is and has Functions
  • Getting Set Up to Use C++
  • 6.4.2.
  • Case Study: Extending the hypotenuser Package to Include C++ Code
  • 6.4.3.
  • Exercise: Testing an Rcpp Function
  • 6.5.
  • Testing Write Functions
  • 6.5.1.
  • Exercise: Writing INI Configuration Files
  • 6.6.
  • 2.2.1.
  • Testing Graphics
  • 6.6.1.
  • Generating the Report from the markdown
  • 6.6.2.
  • Including Graphics Tests in Packages
  • 6.6.3.
  • Exercise: Write a Graphics Test Report
  • 6.7.
  • Summary
  • 7.
  • Exercise: Using Predicates and Assertions
  • Writing Your Own Assertions and Expectations
  • 7.1.
  • Quick, Nearly Good Enough Option
  • 7.2.
  • Writing Scalar Predicates
  • 7.2.1.
  • Exercise: Writing a Custom Scalar Predicate
  • 7.2.2.
  • Writing Type Predicates
  • 7.3.
  • 2.3.
  • Writing Scalar Assertions
  • 7.3.1.
  • Exercise: Writing a Custom Scalar Assertion
  • 7.4.
  • Writing Vector Predicates
  • 7.4.1.
  • Exercise: Writing a Vector Predicate
  • 7.5.
  • Writing Vector Assertions
  • 7.5.1.
  • Virtual Package System
  • Exercise: Writing a Vector Assertion
  • 7.6.
  • Creating Custom Expectations
  • 7.6.1.
  • Exercise: Create a Custom Expectation
  • 7.7.
  • Summary
  • A.
  • Answers to Exercises
  • A.1.
  • 2.4.
  • Preface
  • A.1.1.
  • Exercise: Are You Ready?
  • A.2.
  • Chapter 2
  • A.2.1.
  • Exercise: Using Predicates and Assertions
  • A.2.2.
  • Exercise: Examining an Object
  • A.2.3.
  • Tour of the assertive Package
  • Exercise: Inspecting Files and Directories
  • A.2.4.
  • Exercise: Testing Properties of Matrices
  • A.2.5.
  • Exercise: Explore Your R Setup
  • A.2.6.
  • Exercise: Checking Customer Data
  • A.2.7.
  • Exercise: Calculating the Harmonic Mean
  • A.3.
  • 2.4.1.
  • Chapter 3
  • A.3.1.
  • Exercise: Using expect_equal
  • A.3.2.
  • Exercise: Using expect_error
  • A.3.3.
  • Exercise: Using expect_output
  • A.3.4.
  • Exercise: Find More Tests for square_root
  • A.3.5.
  • 1.
  • assertive.base
  • Exercise: Testing the Return Type of Replicates
  • A.4.
  • Chapter 4
  • A.4.1.
  • Exercise: Reducing duplication
  • A.4.2.
  • Exercise: Outsourcing Argument Checking
  • A.4.3.
  • Exercise: Wrappers for Formatting Currency
  • A.4.4.
  • 2.4.2.
  • Exercise: Providing Better Defaults for write.csv
  • A.4.5.
  • Exercise: Decomposing the quantile Function
  • A.4.6.
  • Exercise: Calculating Leap Years
  • A.5.
  • Chapter 5
  • A.5.1.
  • Exercise: Make a Package with Tests
  • A.6.
  • assertive.properties
  • Chapter 6
  • A.6.1.
  • Exercise: Writing a Test That Handles Side Effects
  • A.6.2.
  • Exercise: Testing a Complex Object
  • A.6.3.
  • Exercise: Testing an Rcpp Function
  • A.6.4.
  • Exercise: Writing INI Configuration Files
  • A.6.5.
  • 2.4.3.
  • Exercise: Write a Graphics Test Report
  • A.7.
  • Chapter 7
  • A.7.1.
  • Exercise: Writing a Custom Scalar Predicate
  • A.7.2.
  • Exercise: Writing a Custom Scalar Assertion
  • A.7.3.
  • Exercise: Writing a Vector Predicate
  • A.7.4.
  • assertive.types
  • Exercise: Writing a Vector Assertion
  • A.7.5.
  • Exercise: Create a Custom Expectation
  • 2.4.4.
  • assertive.numbers
  • 2.4.5.
  • Exercise: Examining an Object
  • 2.4.6.
  • Introduction
  • assertive.files
  • 2.4.7.
  • Exercise: Inspecting Files and Directories
  • 2.4.8.
  • assertive.strings
  • 2.4.9.
  • assertive.matrices
  • 2.4.10.
  • Exercise: Testing Properties of Matrices
  • 2.4.11.
  • 1.1.
  • assertive.sets
  • 2.4.12.
  • assertive.models
  • 2.4.13.
  • assertive.reflection
  • 2.4.14.
  • Exercise: Explore Your R Setup
  • 2.4.15.
  • assertive.datetimes
  • 2.4.16.
  • Interacting vs. Programming
  • assertive.data, assertive.data.us, and assertive.data.uk
  • 2.4.17.
  • Exercise: Checking Customer Data
  • 2.4.18.
  • assertive.code
  • 2.5.
  • Controlling Severity
  • 2.6.
  • Fail Early, Fail Often
  • 2.7.
  • 1.2.
  • Case Study: Calculating the Geometric Mean
  • 2.7.1.
  • Exercise: Calculating the Harmonic Mean
  • 2.8.
  • Alternatives
  • 2.9.
  • Summary
  • 3.
  • Development-Time Testing with testthat
  • 3.1.
  • Two Kinds of Testing
  • Using Unit Tests
  • 3.2.
  • Structure of a Unit Test
  • 3.2.1.
  • Exercise: Using expect_equal
  • 3.2.2.
  • How Equal Is Equal?
  • 3.3.
  • Testing Errors
  • 3.3.1.
  • 1.3.
  • Exercise: Using expect_error
  • 3.4.
  • Different Types of Expectation
  • 3.5.
  • Testing Warnings and Messages
  • 3.5.1.
  • Chaining Expectations Together with Pipes
  • 3.5.2.
  • Exercise: Using expect_output
  • 3.5.3.
Control code
MSTDDA4786512
Dimensions
unknown
Extent
1 online resource (xvii, 177 pages ):
Form of item
online
Isbn
9781498763660
Isbn Type
(electronic bk.)
Media category
computer
Media MARC source
rdamedia
Media type code
  • c
Other physical details
illustrations.
Reproduction note
Electronic reproduction.
Specific material designation
remote

Library Locations

    • Curtis Laws Wilson LibraryBorrow it
      400 West 14th Street, Rolla, MO, 65409, US
      37.955220 -91.772210
Processing Feedback ...