Ellis Hughes
@ellis_hughes
thebioengineer
Fred Hutch Cancer Research Center - SCHARP - VISC
@ellis_hughes
thebioengineer
What is Computer System Validation?
Establishing documentary evidence that your software performs a
in compliance with specifications with a high degree of assurance.
Typical Answer
Required for FDA submission
21 CFR 11
General Principles of Software Validation (FDA 2002)
Unspoken Benefits
Improved Quality and Safety
Results in Faster Processing
Promotes Trust
Tom Shadyac, et al. BRUCE ALMIGHTY. USA, 2003.
https://media1.tenor.com/images/3267a92e265348c0cc435a7989d65e23/tenor.gif
Fill out a form for specifications, planned uses, environments
Write Code and record function authorship in some excel file
Get another form to document test cases, testing environment, …
Maybe the last form to show that testing plan is comprehensive
Manually evaluate tests and screenshot results
Review documentation, combine into final report and 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
Steps to Validation
Advantages
R package development process
Native to programmers
Satisfies requirements
Iterative development
Reusable
- My presentation will
- The contents will cover my teams approach to validation
- Be 15-20 minutes long
- Be entertaining
Specification Files
markdown format
Single file per specification
Clearly defined
Independent
Close proximity to the task
Key Information to capture
#' @title Specifications For Presentation Success
#' @section Last Updated By:
#' Ellis Hughes
#' @section Last Update Date:
#' 2025/01/01
+ _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.
Queen - I Want To Break Free, 1984
https://imgur.com/gallery/QC6Nllw
Documenting Code
Who wrote the code
When they wrote it
Update ownership when code are updated
Roxygen Tags
Value
#' @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:
#' 2030/01/01
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('Why did the PowerPoint Presentation cross the road?','To get to the other slide.')
#'
#' @section Last Updated By:
#' Joe King
#' @section Last Update Date:
#' 2030/04/01
joke <- function(Setup, Punchline, wait = 3){
print(Setup)
Sys.sleep(wait)
print(Punchline)
}
Draw connections between specifications and functions
Source: https://nc3t.com/wp-content/uploads/2014/10/How-to-find-innovation.jpg
A single test case can satisfy multiple specifications
Every specification must be satisfied by least one test case
Good Test Cases
Documenting Test Cases
Roxygen Tags
#' @section Last Updated By:
#' Ellis Hughes
#' @section Last Update Date:
#' 2030/01/01
#' @section Specification coverage:
#' T1.1: S1.1, S1.2, S1.3
+ _Test Cases_
+ Setup: Create 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)
Implement Test Cases
Record results
Third Party
Benefits
Documenting Test Code:
Roxygen Tags
#' @title T1.1
#' @section Last Updated By:
#' Jess Terr
#' @section Last Update Date:
#' 2030/01/01
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 from {testthat}
| OK F W S | Context
| 3 | test_case_001 [3.2 s]
-- Results ---------------------------------------
Duration: 3.2 s
OK: 3
Failed: 0
Warnings: 0
Skipped: 0
Using a custom function to extract results from Reporter object
What we have so far
Final Elements Required
Sign off page
Environment information
Generate report on the click of a button
'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_rpharma
github.com/thebioengineer/validation_rpharma
@ellis_hughes
Presentation brought to you by {sidescroller}