Testing

Data-Driven Code Generation of Unit Tests Part 5: Closing Thoughts
Data-Driven Code Generation of Unit Tests
Published: 2017-07-05
Data-Driven Code Generation of Unit Tests Part 5: Closing Thoughts
This post is part 5/5 of my Data-Driven Code Generation of Unit Tests series. In the previous posts in this series, I walked through the idea of performing data-driven code generation for unit tests, as well as how I implemented it in three different programming languages and build systems. This post contains some final thoughts about the effort. Was it worth it? Almost certainly. Although it required substantial up-front effort to set up the unit test generators, this approach found numerous, previously-undetected bugs both within my implementation of the calculation library as well as with legacy implementations. Read more...
Data-Driven Code Generation of Unit Tests Part 4: C#, MSBuild, T4, MS Unit Test
Data-Driven Code Generation of Unit Tests
Published: 2017-07-05
Data-Driven Code Generation of Unit Tests Part 4: C#, MSBuild, T4, MS Unit Test
This post is part 4/5 of my Data-Driven Code Generation of Unit Tests series. This blog post explains how I used C#, MSBuild, T4 Text Templates, and the Microsoft Unit Test Framework for Managed Code to perform data-driven code generation of unit tests for a financial performance analytics library. If you haven’t read it already, I recommend starting with Part 1: Background. As mentioned in Part 2: C++, CMake, Jinja2, Boost, all performance analytics metadata is stored in a single file called metadata. Read more...
Data-Driven Code Generation of Unit Tests Part 3: Java, Maven, StringTemplate, JUnit
Data-Driven Code Generation of Unit Tests
Published: 2017-07-03
Data-Driven Code Generation of Unit Tests Part 3: Java, Maven, StringTemplate, JUnit
This post is part 3/5 of my Data-Driven Code Generation of Unit Tests series. This blog post explains how I used Java, Apache Maven, StringTemplate, and JUnit to perform data-driven code generation of unit tests for a financial performance analytics library. If you haven’t read it already, I recommend starting with Part 1: Background. As mentioned in Part 2: C++, CMake, Jinja2, Boost, all performance analytics metadata is stored in a single file called metadata. Read more...
Data-Driven Code Generation of Unit Tests Part 2: C++, CMake, Jinja2, Boost
Data-Driven Code Generation of Unit Tests
Published: 2017-06-30
Data-Driven Code Generation of Unit Tests Part 2: C++, CMake, Jinja2, Boost
This post is part 2/5 of my Data-Driven Code Generation of Unit Tests series. This blog post explains how I used CMake, Jinja2, and the Boost Unit Test framework to perform data-driven code generation of unit tests for a financial performance analytics library. If you haven’t read it already, I recommend starting with Part 1: Background. All performance analytics metadata is stored in a single metadata file called metadata.csv. This file contains the complete list of calculations, and for each calculation, its settings (i. Read more...
Data-Driven Code Generation of Unit Tests Part 1: Background
Data-Driven Code Generation of Unit Tests
Published: 2017-06-30
Data-Driven Code Generation of Unit Tests Part 1: Background
This post is part 1/5 of my Data-Driven Code Generation of Unit Tests series. At Morningstar, I created a multi-language, cross-platform performance analytics library which implements both online and offline implementations of a number of common financial analytics such as Alpha, Beta, R-Squared, Sharpe Ratio, Sortino Ratio, and Treynor Ratio (more on this library later). The library relies almost exclusively on a comprehensive suite of automated unit tests to validate its correctness. Read more...