3 Activating offensive programming
Package wyz.code.offensiveProgramming provides R tools to ease offensive programming exploitation. It aims to provide all the core tools required to do so.
Package wyz.code.testthat uses meta programming to generate testthat test files, you will use as if they had been written manually.
Package wyz.code.metaTesting exploits offensive programming semantic names to induce type parameters and to generate reusable values for tests, thus alleviating the burden to produce data for testing purposes.
Package wyz.code.rdoc provides an API to ease documentation generation in a programmatic way. This is the only package that does not requires offensive programming and that can be used with plain standard R code.
3.1 Package discovery
These packages come with manual pages you could refer to if needed. Indeed, there exists a smarter way to proceed as each of these packages provides a self describing function named op.*Information. It provides tabular information as a data.table that can easily be sorted and filtered out to match your own search criteria.
This is helpful daily as a reminder or as an help to ease discovery and to get quick insight about content.
Let’s see a typical R hands-on session
oi <- opInformation()
oi[category == 'CLASS', . (name, nature)]
#> name nature
#> 1: EvaluationMode EXPORTED
#> 2: FunctionParameterName EXPORTED
#> 3: FunctionParameterTypeFactory EXPORTED
#> 4: TestCaseDefinition EXPORTED
oi[category == 'FUNCTION', . (name, nature)]
#> name nature
#> 1: defineEvaluationModes EXPORTED
#> 2: defineFunctionReturnTypesParameterName EXPORTED
#> 3: defineTestCaseDefinitionsParameterName EXPORTED
#> 4: exploreObjectNamesVerification EXPORTED
#> 5: findFilesInPackage EXPORTED
#> 6: generateStatusSummary INTERNAL
#> 7: getClassTypicalFunctionNames INTERNAL
#> 8: getEllipsisName EXPORTED
#> 9: getObjectClassKind EXPORTED
#> 10: getObjectClassNames EXPORTED
#> 11: getObjectFunctionArgumentNames EXPORTED
#> 12: getObjectFunctionNames EXPORTED
#> 13: hasMainClass INTERNAL
#> 14: identifyOPInstrumentationLevel EXPORTED
#> 15: isAuditable EXPORTED
#> 16: matchFunctionArguments INTERNAL
#> 17: matchFunctionSignature EXPORTED
#> 18: opInformation EXPORTED
#> 19: retrieveFactory EXPORTED
#> 20: retrieveFunctionArgumentNames EXPORTED
#> 21: retrieveFunctionArguments EXPORTED
#> 22: retrieveFunctionReturnTypes EXPORTED
#> 23: retrievePackageFunctionNames EXPORTED
#> 24: retrieveSupportedObjectInformation INTERNAL
#> 25: retrieveTestCaseDefinitions EXPORTED
#> 26: retrieveTestCaseDescriptions EXPORTED
#> 27: runFunction EXPORTED
#> 28: runTestCase EXPORTED
#> 29: runTransientFunction EXPORTED
#> 30: verifyClassName EXPORTED
#> 31: verifyFunctionArguments EXPORTED
#> 32: verifyFunctionName EXPORTED
#> 33: verifyFunctionReturnTypesDefinition EXPORTED
#> 34: verifyName INTERNAL
#> 35: verifyObjectNames EXPORTED
#> 36: verifyTestCaseDefinitions EXPORTED
#> name nature