Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This software development process relies on some well-defined requirements to be met. The latter becomes specific test cases. Each test case must be met at any time of the software life; that is if any code is altered, the tests must continue to be met. Traditionally, we write a test first from the lists list of test cases and expect the test to failsfail; the latter is an expected outcome as the no code is written yet. The third step is to write the code and run the test again. These two steps may be repeated until the test passes. Once the test passes, the code is refactored; this phase organises the code again, so that it becomes highly maintainable (see diagram below).

...

The last phase of the (TDD) development cycle requires to once again structure again the code, without changing its behaviour. In R, this step often requires shorten shortening of lengthy functions into a more manageable and maintainable size.

...

The benefits of refactoring brings some R functions that can be maintained more easily. The reduced size of the code should enhances enhance comprehension, through self-documentation of the logical flow of the implementation and meaningful naming of variables and helper functions.

...

This function identifies the R environment used during the execution of the R code. Two possible R environment environments can be used:

  1. the R environment referred as .GlobalEnvis used by default in the console of R Studio or a an R script.

  2. The R environment ds.test_env is used by the testing framework.

...