Offensive Programming Book
Welcome
Book version
Book production
Preamble
1
Programming styles
1.1
Defensive programming style
1.2
Offensive programming style
2
Application in R language
2.1
A simple case
2.2
Defensive programming
2.3
Offensive programming
2.3.1
What are the differences?
2.3.2
Semantic argument naming
2.4
Back to definition
3
Activating offensive programming
3.1
Package discovery
4
The type factory
4.1
Get recorded types inventory
4.2
Understanding the model
4.3
Register your own type
4.4
Get access to verification functions
4.5
Some hints
4.6
Enforcing use of your own type factory
5
Semantic names
5.1
What is semantic naming?
5.1.1
Naming recommendation
5.1.2
Semantic naming
5.2
Verifying names
5.2.1
Verifying a function parameter or return type declaration
5.2.2
Verifying a class name
5.2.3
Verifying a function name
5.2.4
Get naming balance from an R object
6
Evaluation modes
6.1
Understanding evaluation modes
6.2
Instantiating evaluation mode
7
Running functions
7.1
Prerequisites
7.2
Transient invocations
7.2.1
Nominal case
7.2.2
Prerequisite mismatch
7.2.3
Object function call
7.3
Persistent invocations
7.3.1
Verifying recorded information
7.3.2
Nominal persistent case
7.3.3
Subtile change
7.3.4
Call case with named and positional parameters
7.3.5
Call case with ellipsis
7.3.6
Second call case with ellipsis
8
Running test cases
8.1
Embedding test cases
8.2
Discovering test cases
8.2.1
Test case verifications
8.2.2
Getting instrumented functions
8.2.3
Getting test cases descriptions
8.3
Running test cases
8.3.1
Run a single test case
8.3.2
Run several test cases
9
Generating
testthat
test files
9.1
Package
wyz.code.testthat
in action
9.1.1
Setting up the context
9.1.2
Loading objects
9.1.3
Unit test file generation
9.2
Generated unit test file content
9.3
Caveats
10
Meta-testing
10.1
Traditional way of testing
10.1.1
Empirical approach
10.1.2
More industrial approach
10.2
Meta testing
10.2.1
Meta testing approach
10.2.2
Create a wrapper function
10.2.3
Getting some complexity knowledge
10.2.4
Firing massive tests
10.3
A more complex example
10.3.1
Create a wrapper function
10.3.2
Getting some complexity knowledge
10.3.3
Firing massive tests
10.4
An example using ellipsis
10.4.1
Create a wrapper function
10.4.2
Getting some complexity knowledge
10.4.3
Firing massive tests
10.5
A tricky example
10.5.1
Create wrapper function
10.5.2
Getting some complexity knowledge
10.5.3
Firing massive tests
10.6
Pitfalls to avoid
11
Generating
R
documentation
11.1
Conceptual approach
11.2
Vignettes
11.3
API
11.4
Best generation strategy
11.5
Pure
R
function
11.6
Offensive programming
R
function
11.7
Known limits
11.8
Opportunities
12
Implementation figures
12.1
File statistics
12.2
Code statistics
12.3
Tests and coverage
13
Conclusion
13.1
Benefits of offensive programming
13.2
Concerns of offensive programming
13.3
Your feedback is welcome
Explicit - Lege feliciter
instigator Fabien GELINEAU
Offensive Programming Book
Explicit - Lege feliciter