Ellis Hughes
@ellis_hughes
Fred Hutch Cancer Research Center - SCHARP - VISC
What is Computer System Validation?
Establishing documentary evidence that your software performs a
in compliance with specifications with a high degree of assurance.
Required for FDA submission
21 CFR 11
General Principles of Software Validation (FDA 2002)
Improved Quality and Safety
Results in Faster Processing
Promotes Trust
Validation
Verification
Validation can be a high bar
Tom Shadyac, et al. BRUCE ALMIGHTY. USA, 2003.
https://media1.tenor.com/images/3267a92e265348c0cc435a7989d65e23/tenor.gif
Develop and get signoff on specifications
Write Code following GPP and record function authorship
Develop Test Cases and get signoff
Write Test Code based on Test Cases
Manually evaluate and document test code results
Review documentation and get final signoffs for release
Super Mario Bros., Nintendo, 1985, NES
source: https://gfycat.com/earnestgiganticdorado
VALIDATION
+
Adam Mckay, et al. STEP BROTHERS . USA, 2008.
https://bethgittings.tumblr.com/post/34641171446
Seattle UseR Organizer
Cascadia R Conf Committee
Worldwide Impact on HIV/AIDS Vaccine Research
Specifications
Code
Test Cases
Test Case Code
Documentation
-- DESCRIPTION
-- man
-- NAMESPACE
-- R
|__functions.R
-- tests
-- vignettes
What are the requirements of the package?
- My RStudio::Conf presentation will
- The contents will cover my teams approach to validation
- Be 15-20 minutes long
- Be entertaining
Recording specifications
Record Specifications in Rmarkdown
Augment Rmarkdown with Roxygen
#' @title Specifications For RStudio Conf 2020 Success
#' @section Last Updated By:
#' Ellis Hughes
#' @section Last Update Date:
#' 2020/01/28
+ _Specifications_
+ 1.1 Presentation must explain validation procedure.
+ 1.2 Presentation will be between 15-20 minutes long
+ 1.3 Be entertaining, sucess measures by causing at least 3 people to laugh.
+ 1.4 (Optional) Fame and Glamour and start branded accessories chain.
Quickly update
Close proximity to the task
De-couple Specifications
-- vignettes
|__Validation
|__Specifications
|__specification_001.Rmd
Queen - I Want To Break Free, 1984
https://imgur.com/gallery/QC6Nllw
Dont worry, I won’t be telling you how to code
Documenting code ownership
#' @title Deliver Jokes
#' @description
#' Deliver jokes with punchlines. Wait 3 seconds for the punchline.
#' @param Setup Joke setup
#' @param Punchline Joke punchline
#' @examples
#' joke('To the person who stole my presentation -','I hope you do not Excel.')
#'
#' @section Last Updated By:
#' Ellis Hughes
#' @section Last Updated Date:
#' 2020/01/29
joke <- function(Setup, Punchline){
print(Setup)
Sys.sleep(3)
print(Punchline)
}
#' @title Deliver Jokes
#' @description
#' Deliver jokes with punchlines. Wait 3 seconds for the punchline.
#' @param Setup Joke setup
#' @param Punchline Joke punchline
#' @param wait how long to wait to serve the punchline
#' @examples
#' joke('To the person who stole my presentation -','I hope you do not Excel.')
#'
#' @section Last Updated By:
#' Not Ellis Hughes
#' @section Last Update Date:
#' 2020/01/30
joke <- function(Setup, Punchline, wait = 3){
print(Setup)
Sys.sleep(wait)
print(Punchline)
}
-- R
|__jokes.R
-- man
|__joke.Rd
-- tests
|__testthat.R
|__testthat
|__test_joke.R
Draw connections between specifications and functions
Source: https://nc3t.com/wp-content/uploads/2014/10/How-to-find-innovation.jpg
Distinct from Unit Tests
A single test case can satisfy multiple specifications
Every single specification must map to at least one test case
Record Test Cases in Rmarkdown
Augment Rmarkdown with Roxygen
#' @title RStudio Conf 2020 Success Test Cases 001
#' @section Last Updated By:
#' Ellis Hughes
#' @section Last Update Date:
#' 2020/01/29
+ _Test Cases_
+ Setup: Create RStudio::Conf 2020 Presentation
+ T 1.1 Test that specifications 1.1, 1.2, and 1.3 are met by practicing presentation on unsuspecting co-workers
- Present to a captive audience of coworkers and later your significant other
+ T 1.1.1 Test that the presentation was informative by asking what your audience learned.
+ T 1.1.2 Time the presentation and make sure it was between 15 and 20 minutes.
+ T 1.1.3 Test that you were entertaining by counting the amount of chuckles (>3)
+ T 1.1.3.1 Alternatively, eye-rolls from your significant other (>4)
-- vignettes
|__Validation
|__Test_Cases
|__test_case_001.Rmd
Implement Test Cases
Record results
Third Party
Benefits
Approach
context('RStudio Conf 2020 Success')
#' @title RStudio Conf 2020 Success
#' @section Last Updated By:
#' Not Ellis Hughes
#' @section Last Update Date:
#' 2020/01/29
test_that('T1.1',{
joke_result <- joke('What do you call a fake noodle?','An Impasta')
expect_true(is_dad_joke(joke_result))
expect_true(caused_laugher(joke_result))
expect_true(embarrased_significant_other(joke_result))
})
testthat
Reporter Objects
| OK F W S | Context
| 3 | RStudio Conf 2020 Success [3.2 s]
-- Results ---------------------------------------
Duration: 3.2 s
OK: 3
Failed: 0
Warnings: 0
Skipped: 0
Using a custom print function the Reporter object
Modular Test Code Documentation
-- vignettes
|__Validation
|__Test_Code
|__test_code_001.R
'Captain Planet and the Planeteers' Theme Song: Turner Broadcasting System
Source: https://www.syfy.com/sites/syfy/files/styles/1100xauto/public/captain-planet.gif
-- DESCRIPTION
-- man
-- NAMESPACE
-- tests
-- R
|__jokes.R
-- vignettes
|__Validation.Rmd
|__Validation.pdf
|__Validation
|__Specifications
|__specification_001.Rmd
|__Test_Cases
|__test_case_001.Rmd
|__Test_Code
|__test_code_001.R
Marie Vendettuoli
Anthony Williams
Jimmy Fulp
Bharathi Lakshminarayanan
Rafael Kuttner
Alicia Sato
Shannon Grant
Paul Stutzman
Kate Ostbye
Many many more people
Presentation available at:
thebioengineer.github.io/validation
github.com/thebioengineer/validation
@ellis_hughes
Presentation brought to you by {sidescroller}