SlideShare a Scribd company logo
Software Testing and the R Language
useR! 2014, U.C.L.A.
Stephen Kaluzny
TIBCO Software Inc.
July 3, 2014
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 1 / 21
Introduction
1 Testing R engines
TIBCO’s approach
Not validating R (Andy Nichols talk on Wednesday)
2 Testing R packages
How does one test a package?
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 2 / 21
Motivation and Background
Company has been working on S/R engines for 26 years
Originally S and S-PLUS with StatSci / MathSoft / Insightful / TIBCO
Now working with TIBCO Enterprise Runtime for R (TERR)
TERR is an embed-able R engine for enterprises
the analytics engine in TIBCO Spotfire visualization software
”Develop in R, Deploy in TERR”
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 3 / 21
Importance of Testing
Need to ensure correct results from the software
Is R giving the correct results?
R Core has this covered fairly well
Do your results match R?
There are now several R engines that need testing, including:
TERR
Renjin (jvm)
ORE Statistics Engine (Oracle)
Test with use of different software libraries e.g.
linear algebra
math functions and statistical distributions (Intel Math Library)
R on special hardware
GPU for linear algebra
multi-core systems
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 4 / 21
Testing the TERR Engine
Developers write unit tests as features (functions) are developed
in C++ and R
Quality Control group write tests for each feature
often converting tests developed for S-PLUS
Quality Control group write regression tests for bugs that are fixed
these tests often cover complex areas of the code
We have created several packages to assist with development and
testing
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 5 / 21
Assertion Test Framework
Based on loop test idea for testing from John Chambers for S version3
Each individual test is an S expression that evaluate to true if
successful
Collection of tests for a function are grouped into a file
Each file is run in clean environment
Metadata at the top of the file is used by the test framework
Entire test system is controlled by a Jenkins job
can request only particular tests
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 6 / 21
Assertion Test Metadata
## TestName: glm.t
## Package: stats
## FunctionalArea: statistical models
## Tags: models, glm, model.frame
## Description: Basic glm function
## RequiredPackages:
## UsesRandom: FALSE
## Author: ctaylor, meriksso, nmockler
## TestType: unit
## TestFormat: assertion
## NotBeforeVersion:
## NotAfterVersion:
## ExcludePlatforms:
## RunsInSnext: TRUE
## RunsInR: TRUE
## RunsInSplus:
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 7 / 21
assertionTest Package
Created to support Assertion Test Framework
Not unlike the testthat package
Key Functions:
assertionTest
the main function, run on a file of expressions
atExpectStop and atExpectWarnings
atUsesRandom
resets seed after each expression
error if .Random.seed changes outside of this function
atSource
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 8 / 21
Assertion Test Stats
Tests are run after every nightly build
3 build platforms (Win-32, Win-64, Linux-64)
4 test platforms (Win7-32, Win7-64, Win8-64, Linux-64)
Two compilers on each platform (Intel and gcc or Microsoft)
Two builds of each compiler/platform combination (Release, Debug)
Results are written to a MySQL database
Over 1000 test files for 16 ”core” packages in TERR
Developer ”unit” assertion tests are run during continous builds
build runs every 10 minutes if there has been a checkin
build results email goes to any developer who made a checkin for that
build
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 9 / 21
Other Tests for TERR
Manual Tests
run by QC group before a release
Performance Tests
spiff test - diff tests (ala Rout.save) with a numerical tolerance
mostly adapted from S-PLUS
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 10 / 21
RinR Package
Evaluates R expressions in a different R interpreter
Includes evaluator functions that evaluate expressions in particular
interpreter
REvaluator - R interpreter
TERREvaluator - TERR interpreter
LocalEvaluator - current interpreter
makeREvaluator - creates evaluators e.g. R2.15.3Evaluator
multiREvaluator - evaluate an expression in multiple interpreters
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 11 / 21
RinR Examples
# From within TERR:
> library(RinR)
> REvaluate(version)
platform x86_64-unknown-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 1.0
year 2014
month 04
day 10
svn rev 65387
language R
version.string R version 3.1.0 (2014-04-10)
nickname Spring Dance
> .libPaths(c(.libPaths(), REvaluate(.libPaths())))
> .libPaths()
[1] "/home/TERR/TERR-intel.140620/library"
[2] "/home/R/R-3.1.0/lib/R/library"
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 12 / 21
RinR Examples (page 2)
RCompare is often used during development
> compareQuant <- RCompare(quantile(c(0,1,1,2,3,5,8,13)))
> class(compareQuant)
[1] "sideBySide"
> compareQuant
R version 3.1.0 (2014-04-10) TERR version 3.0.0 (2014-06-20)
[1,] 0% 25% 50% 75% 100% 0% 25% 50% 75% 100%
[2,] 0.00 1.00 2.50 5.75 13.00 0.00 1.00 2.50 5.75 13.00
[3,]
[4,]
$all.equal
$all.equal$R version 3.1.0 (2014-04-10) vs. TERR version 3.0.0 (2014-06-2
[1] TRUE
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 13 / 21
Future TERR Testing
Add new tests as new features are added
Incorporating tests from core R
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 14 / 21
Testing Packages
One of our biggest challenges
First question from customers: Does package xyzzy work with
TERR?
What does it mean for a package to work?
How do you test over 5000 packages?
Package versions and dependencies add to the challenge
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 15 / 21
Package Testing with R
R CMD check does some testing
runs files in tests
compare to Rout.save files, if the exist
runs examples from help files
compare to Rout.save files, if they exist in tests/Examples
Some packages formal tests that can be run, using these packages:
RUnit : R Unit test framework
scriptests : Transcript-based unit tests that are easy to create and
maintain
svUnit : SciViews GUI API - Unit testing
testit : A simple package for testing R packages
testthat : Testthat code. Tools to make testing fun :)
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 16 / 21
CRAN Test Statistics
CRAN packages from early June, 2014 - 5566 packages
961 (17.3%) have at least one tests directory
230 (4.1%) have target files for comparing test results (‘*.Rout.save‘)
394 of the 961 (7.1%) have actual software tests:
262 (4.7%) use testthat
113 (2.0%) use RUnit
10 (0.2%) use svUnit
5 (0.09%) use testit
4 (0.07%) use scriptests
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 17 / 21
Package Tests
Without creating our own specific tests, from a package we can run:
tests (if they exist)
example code from the help files
code extracted from any vignettes
Problems with this approach
package tests do not always include output to check results
help file code examples seldom have output to compare
help file code examples show usage, not necessarily testing the code
vignette is also to illustrate usage, not for testing the code
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 18 / 21
Testing Packages with TERR
Run tests, help file examples and vignette examples in R and TERR
Compare results of each each expression
Instrumented in a package (‘teaextract‘) that is run from R
use the parallel package to divide up the testing
runs now down to 23 hours from over 6 days
Currently: 1795 CRAN packages run without any errors in TERR
830 give exactly the same results as R
Many packages have a small fraction that do not run
missing a minor function in TERR
Failures with examples that use random numbers, timestamps
Improvement of this system is a priority in the QC group
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 19 / 21
Summary and the Future
Testing R Engines
well covered by R and TIBCO
Testing packages - a big challenge
limited tests in packages, there should be more
use of testthat is a good sign
testCoverage package from Mango Solutions would help
does not solve the problem
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 20 / 21
Questions?
Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 21 / 21

More Related Content

What's hot

Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++
Hong Le Van
 
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Pavneet Singh Kochhar
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++Test
Engineering Software Lab
 
UNIT TESTING
UNIT TESTINGUNIT TESTING
UNIT TESTING
Marius Crisan
 
Unit Test Presentation
Unit Test PresentationUnit Test Presentation
Unit Test Presentation
Sayedur Rahman
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
Amr E. Mohamed
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Scott Leberknight
 
Assessing Unit Test Quality
Assessing Unit Test QualityAssessing Unit Test Quality
Assessing Unit Test Quality
guest268ee8
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
David Berliner
 
Practical unit testing in c & c++
Practical unit testing in c & c++Practical unit testing in c & c++
Practical unit testing in c & c++
Matt Hargett
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
CodeOps Technologies LLP
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
Derek Smith
 
Refactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGRefactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENG
Luca Minudel
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
Pokpitch Patcharadamrongkul
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
UTC Fire & Security
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
Lee Englestone
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real World
Dror Helper
 
J Unit
J UnitJ Unit
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJava
Krunal Parmar
 
Google test training
Google test trainingGoogle test training
Google test training
Thierry Gayet
 

What's hot (20)

Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++
 
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++Test
 
UNIT TESTING
UNIT TESTINGUNIT TESTING
UNIT TESTING
 
Unit Test Presentation
Unit Test PresentationUnit Test Presentation
Unit Test Presentation
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Assessing Unit Test Quality
Assessing Unit Test QualityAssessing Unit Test Quality
Assessing Unit Test Quality
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
 
Practical unit testing in c & c++
Practical unit testing in c & c++Practical unit testing in c & c++
Practical unit testing in c & c++
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Refactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGRefactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENG
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real World
 
J Unit
J UnitJ Unit
J Unit
 
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJava
 
Google test training
Google test trainingGoogle test training
Google test training
 

Similar to Software Testing and the R language

Optimizing Your Agile Testing Processes
Optimizing Your Agile Testing ProcessesOptimizing Your Agile Testing Processes
Optimizing Your Agile Testing Processes
Stanton Champion
 
Devops - Continuous Integration And Continuous Development
Devops - Continuous Integration And Continuous DevelopmentDevops - Continuous Integration And Continuous Development
Devops - Continuous Integration And Continuous Development
SandyJohn5
 
IIBA and Solvera May Event - Testing w Agile slides
IIBA and Solvera May Event - Testing w Agile slidesIIBA and Solvera May Event - Testing w Agile slides
IIBA and Solvera May Event - Testing w Agile slides
SaskatchewanIIBA
 
But Did You Test It
But Did You Test ItBut Did You Test It
But Did You Test It
Ruth Blakely
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
priya_trivedi
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
Priya Sharma
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
priya_trivedi
 
Introduction to testing.
Introduction to testing.Introduction to testing.
Introduction to testing.
Jithinctzz
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
IJERD Editor
 
Unit Tests? It is Very Simple and Easy!
Unit Tests? It is Very Simple and Easy!Unit Tests? It is Very Simple and Easy!
Unit Tests? It is Very Simple and Easy!
Return on Intelligence
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Applitools
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
harinderpisces
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
Greg.Helton
 
Quality Assurance Process
Quality Assurance ProcessQuality Assurance Process
Quality Assurance Process
Bala Subramanian
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Anuj Arora
 
Track g semiconductor test program - testinsight
Track g  semiconductor test program - testinsightTrack g  semiconductor test program - testinsight
Track g semiconductor test program - testinsight
chiportal
 
On the application of SAT solvers for Search Based Software Testing
On the application of SAT solvers for Search Based Software TestingOn the application of SAT solvers for Search Based Software Testing
On the application of SAT solvers for Search Based Software Testing
jfrchicanog
 
Solving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous TestingSolving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous Testing
Perfecto by Perforce
 
Testing Presentation
Testing PresentationTesting Presentation
Testing Presentation
sureshpkumar
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
Attila Bertók
 

Similar to Software Testing and the R language (20)

Optimizing Your Agile Testing Processes
Optimizing Your Agile Testing ProcessesOptimizing Your Agile Testing Processes
Optimizing Your Agile Testing Processes
 
Devops - Continuous Integration And Continuous Development
Devops - Continuous Integration And Continuous DevelopmentDevops - Continuous Integration And Continuous Development
Devops - Continuous Integration And Continuous Development
 
IIBA and Solvera May Event - Testing w Agile slides
IIBA and Solvera May Event - Testing w Agile slidesIIBA and Solvera May Event - Testing w Agile slides
IIBA and Solvera May Event - Testing w Agile slides
 
But Did You Test It
But Did You Test ItBut Did You Test It
But Did You Test It
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Introduction to testing.
Introduction to testing.Introduction to testing.
Introduction to testing.
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Unit Tests? It is Very Simple and Easy!
Unit Tests? It is Very Simple and Easy!Unit Tests? It is Very Simple and Easy!
Unit Tests? It is Very Simple and Easy!
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
 
Quality Assurance Process
Quality Assurance ProcessQuality Assurance Process
Quality Assurance Process
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Track g semiconductor test program - testinsight
Track g  semiconductor test program - testinsightTrack g  semiconductor test program - testinsight
Track g semiconductor test program - testinsight
 
On the application of SAT solvers for Search Based Software Testing
On the application of SAT solvers for Search Based Software TestingOn the application of SAT solvers for Search Based Software Testing
On the application of SAT solvers for Search Based Software Testing
 
Solving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous TestingSolving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous Testing
 
Testing Presentation
Testing PresentationTesting Presentation
Testing Presentation
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
 

More from Lou Bajuk

R Consortium update for EARL Boston Oct 2017
R Consortium update for EARL Boston Oct 2017R Consortium update for EARL Boston Oct 2017
R Consortium update for EARL Boston Oct 2017
Lou Bajuk
 
Reusing and Managing R models in an Enterprise
Reusing and Managing  R models in an EnterpriseReusing and Managing  R models in an Enterprise
Reusing and Managing R models in an Enterprise
Lou Bajuk
 
R consortium update EARL London Sept 2017
R consortium update EARL London Sept 2017R consortium update EARL London Sept 2017
R consortium update EARL London Sept 2017
Lou Bajuk
 
Making Data Science accessible to a wider audience
Making Data Science accessible to a wider audienceMaking Data Science accessible to a wider audience
Making Data Science accessible to a wider audience
Lou Bajuk
 
R Consortium Update for EARL June 2017
R Consortium Update for EARL June 2017R Consortium Update for EARL June 2017
R Consortium Update for EARL June 2017
Lou Bajuk
 
Streaming analytics overview for R
Streaming analytics overview for RStreaming analytics overview for R
Streaming analytics overview for R
Lou Bajuk
 
Tibco streaming analytics overview and roadmap
Tibco streaming analytics overview and roadmapTibco streaming analytics overview and roadmap
Tibco streaming analytics overview and roadmap
Lou Bajuk
 
Embracing data science for smarter analytics apps
Embracing data science for smarter analytics appsEmbracing data science for smarter analytics apps
Embracing data science for smarter analytics apps
Lou Bajuk
 
EARL Sept 2016 R consortium
EARL Sept 2016 R consortiumEARL Sept 2016 R consortium
EARL Sept 2016 R consortium
Lou Bajuk
 
R in BI and Streaming Applications for useR 2016
R in BI and Streaming Applications for useR 2016R in BI and Streaming Applications for useR 2016
R in BI and Streaming Applications for useR 2016
Lou Bajuk
 
Applying the R Language to BI and Real Time Applications
Applying the R Language to BI and Real Time ApplicationsApplying the R Language to BI and Real Time Applications
Applying the R Language to BI and Real Time Applications
Lou Bajuk
 
Applying R in BI and Real Time applications EARL London 2015
Applying R in BI and Real Time applications EARL London 2015Applying R in BI and Real Time applications EARL London 2015
Applying R in BI and Real Time applications EARL London 2015
Lou Bajuk
 
Extending the R language to BI and Real-time Applications JSM 2015
Extending the R language to BI and Real-time Applications JSM 2015Extending the R language to BI and Real-time Applications JSM 2015
Extending the R language to BI and Real-time Applications JSM 2015
Lou Bajuk
 
Using the R Language in BI and Real Time Applications (useR 2015)
Using the R Language in BI and Real Time Applications (useR 2015)Using the R Language in BI and Real Time Applications (useR 2015)
Using the R Language in BI and Real Time Applications (useR 2015)
Lou Bajuk
 
Real time applications using the R Language
Real time applications using the R LanguageReal time applications using the R Language
Real time applications using the R Language
Lou Bajuk
 
The Importance of an Analytics Platform
The Importance of an Analytics PlatformThe Importance of an Analytics Platform
The Importance of an Analytics Platform
Lou Bajuk
 
TERR in BI and Real Time applications
TERR in BI and Real Time applicationsTERR in BI and Real Time applications
TERR in BI and Real Time applications
Lou Bajuk
 
The Compatibility Challenge:Examining R and Developing TERR
The Compatibility Challenge:Examining R and Developing TERRThe Compatibility Challenge:Examining R and Developing TERR
The Compatibility Challenge:Examining R and Developing TERR
Lou Bajuk
 
Deploying R in BI and Real time Applications
Deploying R in BI and Real time ApplicationsDeploying R in BI and Real time Applications
Deploying R in BI and Real time Applications
Lou Bajuk
 
Extending the Reach of R to the Enterprise with TERR and Spotfire
Extending the Reach of R to the Enterprise with TERR and SpotfireExtending the Reach of R to the Enterprise with TERR and Spotfire
Extending the Reach of R to the Enterprise with TERR and Spotfire
Lou Bajuk
 

More from Lou Bajuk (20)

R Consortium update for EARL Boston Oct 2017
R Consortium update for EARL Boston Oct 2017R Consortium update for EARL Boston Oct 2017
R Consortium update for EARL Boston Oct 2017
 
Reusing and Managing R models in an Enterprise
Reusing and Managing  R models in an EnterpriseReusing and Managing  R models in an Enterprise
Reusing and Managing R models in an Enterprise
 
R consortium update EARL London Sept 2017
R consortium update EARL London Sept 2017R consortium update EARL London Sept 2017
R consortium update EARL London Sept 2017
 
Making Data Science accessible to a wider audience
Making Data Science accessible to a wider audienceMaking Data Science accessible to a wider audience
Making Data Science accessible to a wider audience
 
R Consortium Update for EARL June 2017
R Consortium Update for EARL June 2017R Consortium Update for EARL June 2017
R Consortium Update for EARL June 2017
 
Streaming analytics overview for R
Streaming analytics overview for RStreaming analytics overview for R
Streaming analytics overview for R
 
Tibco streaming analytics overview and roadmap
Tibco streaming analytics overview and roadmapTibco streaming analytics overview and roadmap
Tibco streaming analytics overview and roadmap
 
Embracing data science for smarter analytics apps
Embracing data science for smarter analytics appsEmbracing data science for smarter analytics apps
Embracing data science for smarter analytics apps
 
EARL Sept 2016 R consortium
EARL Sept 2016 R consortiumEARL Sept 2016 R consortium
EARL Sept 2016 R consortium
 
R in BI and Streaming Applications for useR 2016
R in BI and Streaming Applications for useR 2016R in BI and Streaming Applications for useR 2016
R in BI and Streaming Applications for useR 2016
 
Applying the R Language to BI and Real Time Applications
Applying the R Language to BI and Real Time ApplicationsApplying the R Language to BI and Real Time Applications
Applying the R Language to BI and Real Time Applications
 
Applying R in BI and Real Time applications EARL London 2015
Applying R in BI and Real Time applications EARL London 2015Applying R in BI and Real Time applications EARL London 2015
Applying R in BI and Real Time applications EARL London 2015
 
Extending the R language to BI and Real-time Applications JSM 2015
Extending the R language to BI and Real-time Applications JSM 2015Extending the R language to BI and Real-time Applications JSM 2015
Extending the R language to BI and Real-time Applications JSM 2015
 
Using the R Language in BI and Real Time Applications (useR 2015)
Using the R Language in BI and Real Time Applications (useR 2015)Using the R Language in BI and Real Time Applications (useR 2015)
Using the R Language in BI and Real Time Applications (useR 2015)
 
Real time applications using the R Language
Real time applications using the R LanguageReal time applications using the R Language
Real time applications using the R Language
 
The Importance of an Analytics Platform
The Importance of an Analytics PlatformThe Importance of an Analytics Platform
The Importance of an Analytics Platform
 
TERR in BI and Real Time applications
TERR in BI and Real Time applicationsTERR in BI and Real Time applications
TERR in BI and Real Time applications
 
The Compatibility Challenge:Examining R and Developing TERR
The Compatibility Challenge:Examining R and Developing TERRThe Compatibility Challenge:Examining R and Developing TERR
The Compatibility Challenge:Examining R and Developing TERR
 
Deploying R in BI and Real time Applications
Deploying R in BI and Real time ApplicationsDeploying R in BI and Real time Applications
Deploying R in BI and Real time Applications
 
Extending the Reach of R to the Enterprise with TERR and Spotfire
Extending the Reach of R to the Enterprise with TERR and SpotfireExtending the Reach of R to the Enterprise with TERR and Spotfire
Extending the Reach of R to the Enterprise with TERR and Spotfire
 

Recently uploaded

Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 

Recently uploaded (20)

Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 

Software Testing and the R language

  • 1. Software Testing and the R Language useR! 2014, U.C.L.A. Stephen Kaluzny TIBCO Software Inc. July 3, 2014 Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 1 / 21
  • 2. Introduction 1 Testing R engines TIBCO’s approach Not validating R (Andy Nichols talk on Wednesday) 2 Testing R packages How does one test a package? Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 2 / 21
  • 3. Motivation and Background Company has been working on S/R engines for 26 years Originally S and S-PLUS with StatSci / MathSoft / Insightful / TIBCO Now working with TIBCO Enterprise Runtime for R (TERR) TERR is an embed-able R engine for enterprises the analytics engine in TIBCO Spotfire visualization software ”Develop in R, Deploy in TERR” Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 3 / 21
  • 4. Importance of Testing Need to ensure correct results from the software Is R giving the correct results? R Core has this covered fairly well Do your results match R? There are now several R engines that need testing, including: TERR Renjin (jvm) ORE Statistics Engine (Oracle) Test with use of different software libraries e.g. linear algebra math functions and statistical distributions (Intel Math Library) R on special hardware GPU for linear algebra multi-core systems Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 4 / 21
  • 5. Testing the TERR Engine Developers write unit tests as features (functions) are developed in C++ and R Quality Control group write tests for each feature often converting tests developed for S-PLUS Quality Control group write regression tests for bugs that are fixed these tests often cover complex areas of the code We have created several packages to assist with development and testing Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 5 / 21
  • 6. Assertion Test Framework Based on loop test idea for testing from John Chambers for S version3 Each individual test is an S expression that evaluate to true if successful Collection of tests for a function are grouped into a file Each file is run in clean environment Metadata at the top of the file is used by the test framework Entire test system is controlled by a Jenkins job can request only particular tests Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 6 / 21
  • 7. Assertion Test Metadata ## TestName: glm.t ## Package: stats ## FunctionalArea: statistical models ## Tags: models, glm, model.frame ## Description: Basic glm function ## RequiredPackages: ## UsesRandom: FALSE ## Author: ctaylor, meriksso, nmockler ## TestType: unit ## TestFormat: assertion ## NotBeforeVersion: ## NotAfterVersion: ## ExcludePlatforms: ## RunsInSnext: TRUE ## RunsInR: TRUE ## RunsInSplus: Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 7 / 21
  • 8. assertionTest Package Created to support Assertion Test Framework Not unlike the testthat package Key Functions: assertionTest the main function, run on a file of expressions atExpectStop and atExpectWarnings atUsesRandom resets seed after each expression error if .Random.seed changes outside of this function atSource Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 8 / 21
  • 9. Assertion Test Stats Tests are run after every nightly build 3 build platforms (Win-32, Win-64, Linux-64) 4 test platforms (Win7-32, Win7-64, Win8-64, Linux-64) Two compilers on each platform (Intel and gcc or Microsoft) Two builds of each compiler/platform combination (Release, Debug) Results are written to a MySQL database Over 1000 test files for 16 ”core” packages in TERR Developer ”unit” assertion tests are run during continous builds build runs every 10 minutes if there has been a checkin build results email goes to any developer who made a checkin for that build Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 9 / 21
  • 10. Other Tests for TERR Manual Tests run by QC group before a release Performance Tests spiff test - diff tests (ala Rout.save) with a numerical tolerance mostly adapted from S-PLUS Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 10 / 21
  • 11. RinR Package Evaluates R expressions in a different R interpreter Includes evaluator functions that evaluate expressions in particular interpreter REvaluator - R interpreter TERREvaluator - TERR interpreter LocalEvaluator - current interpreter makeREvaluator - creates evaluators e.g. R2.15.3Evaluator multiREvaluator - evaluate an expression in multiple interpreters Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 11 / 21
  • 12. RinR Examples # From within TERR: > library(RinR) > REvaluate(version) platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 3 minor 1.0 year 2014 month 04 day 10 svn rev 65387 language R version.string R version 3.1.0 (2014-04-10) nickname Spring Dance > .libPaths(c(.libPaths(), REvaluate(.libPaths()))) > .libPaths() [1] "/home/TERR/TERR-intel.140620/library" [2] "/home/R/R-3.1.0/lib/R/library" Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 12 / 21
  • 13. RinR Examples (page 2) RCompare is often used during development > compareQuant <- RCompare(quantile(c(0,1,1,2,3,5,8,13))) > class(compareQuant) [1] "sideBySide" > compareQuant R version 3.1.0 (2014-04-10) TERR version 3.0.0 (2014-06-20) [1,] 0% 25% 50% 75% 100% 0% 25% 50% 75% 100% [2,] 0.00 1.00 2.50 5.75 13.00 0.00 1.00 2.50 5.75 13.00 [3,] [4,] $all.equal $all.equal$R version 3.1.0 (2014-04-10) vs. TERR version 3.0.0 (2014-06-2 [1] TRUE Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 13 / 21
  • 14. Future TERR Testing Add new tests as new features are added Incorporating tests from core R Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 14 / 21
  • 15. Testing Packages One of our biggest challenges First question from customers: Does package xyzzy work with TERR? What does it mean for a package to work? How do you test over 5000 packages? Package versions and dependencies add to the challenge Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 15 / 21
  • 16. Package Testing with R R CMD check does some testing runs files in tests compare to Rout.save files, if the exist runs examples from help files compare to Rout.save files, if they exist in tests/Examples Some packages formal tests that can be run, using these packages: RUnit : R Unit test framework scriptests : Transcript-based unit tests that are easy to create and maintain svUnit : SciViews GUI API - Unit testing testit : A simple package for testing R packages testthat : Testthat code. Tools to make testing fun :) Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 16 / 21
  • 17. CRAN Test Statistics CRAN packages from early June, 2014 - 5566 packages 961 (17.3%) have at least one tests directory 230 (4.1%) have target files for comparing test results (‘*.Rout.save‘) 394 of the 961 (7.1%) have actual software tests: 262 (4.7%) use testthat 113 (2.0%) use RUnit 10 (0.2%) use svUnit 5 (0.09%) use testit 4 (0.07%) use scriptests Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 17 / 21
  • 18. Package Tests Without creating our own specific tests, from a package we can run: tests (if they exist) example code from the help files code extracted from any vignettes Problems with this approach package tests do not always include output to check results help file code examples seldom have output to compare help file code examples show usage, not necessarily testing the code vignette is also to illustrate usage, not for testing the code Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 18 / 21
  • 19. Testing Packages with TERR Run tests, help file examples and vignette examples in R and TERR Compare results of each each expression Instrumented in a package (‘teaextract‘) that is run from R use the parallel package to divide up the testing runs now down to 23 hours from over 6 days Currently: 1795 CRAN packages run without any errors in TERR 830 give exactly the same results as R Many packages have a small fraction that do not run missing a minor function in TERR Failures with examples that use random numbers, timestamps Improvement of this system is a priority in the QC group Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 19 / 21
  • 20. Summary and the Future Testing R Engines well covered by R and TIBCO Testing packages - a big challenge limited tests in packages, there should be more use of testthat is a good sign testCoverage package from Mango Solutions would help does not solve the problem Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 20 / 21
  • 21. Questions? Stephen Kaluzny (TIBCO Software Inc.) Software Testing July 3, 2014 21 / 21