首页> 外文OA文献 >checkmate: Fast Argument Checks for Defensive R Programming
【2h】

checkmate: Fast Argument Checks for Defensive R Programming

机译:checkmate:用于防御性R节目的快速参数检查

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

Dynamically typed programming languages like R allow programmers to writegeneric, flexible and concise code and to interact with the language using aninteractive Read-eval-print-loop (REPL). However, this flexibility has itsprice: As the R interpreter has no information about the expected variabletype, many base functions automatically convert the input instead of raising anexception. Unfortunately, this frequently leads to runtime errors deeper downthe call stack which obfuscates the original problem and renders debuggingchallenging. Even worse, unwanted conversions can remain undetected and skew orinvalidate the results of a statistical analysis. As a resort, assertions canbe employed to detect unexpected input during runtime and to signalunderstandable and traceable errors. The package "checkmate" provides a plethora of functions to check the typeand related properties of the most frequently used R objects and variabletypes. The package is mostly written in C to avoid any unnecessary performanceoverhead. Thus, the programmer can conveniently write concise, well-testedassertions which outperforms custom R code for many applications. Furthermore,checkmate simplifies writing unit tests using the framework "testthat" byextending it with plenty of additional expectation functions, and registered Croutines are available for package developers to perform assertions onarbitrary SEXPs (internal data structure for R objects implemented as struct inC) in compiled code.
机译:像R这样的动态类型的编程语言允许程序员撰写,灵活和简洁的代码,并使用Aninteractive Read-Eval-Print-Loop(Repl)与语言交互。但是,这种灵活性具有ITSPRICE:由于R解释器没有有关预期VariaBletype的信息,因此许多基本功能会自动转换输入而不是提高ANException。不幸的是,这频繁地导致运行时更深的呼叫堆栈更深入呼叫堆栈,这些呼叫堆栈会使原始问题混淆并呈现调试挑战。更糟糕的是,不必要的转换可以保持未被发现,并且偏离或偏离统计分析的结果。作为度假胜地,Missertions可以用于在运行时检测意外输入,并达到稳定的和可追溯的错误。包“checkmate”提供了一种多种函数,用于检查最常用的R对象和variabletypes的类型的类型。包装主要是用C写入,以避免任何不必要的性能头。因此,程序员可以方便地编写简洁的,良好的测试,这优于许多应用程序的自定义R代码。此外,CheckMate使用大量额外的期望函数使用框架“TestThat”简化了写入单元测试,并且已注册的CRoutines可用于包开发人员,以在编译的代码中执行Inarbitrary Sexert的断言(内部数据结构的内部数据结构) 。

著录项

  • 作者

    Michel Lang;

  • 作者单位
  • 年度 2017
  • 总页数
  • 原文格式 PDF
  • 正文语种
  • 中图分类

相似文献

  • 外文文献
  • 中文文献
  • 专利
代理获取

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号