Francesco Rizzi
(NexGen Analytics)
(use the space bar to navigate slides)
...scientific and research codes would benefit from the same attention, especially in terms of making codes accessible, interoperable, and reliable.
This BoF will engage a set of expert panelists and the audience in understanding how we can bring best practices for software engineering to the wider audience of scientific software developers.
pip install <package-name>
Problem: in several cases, junior researchers and postdocs
avoid working with/contributing to large codes
This mostly occurs for non-CS people
A mental barrier, lack of documentation, as well as perception that working on large codes is a divergence from their goal
Separate codes are developed for research purposes etc:
leading to many "one-off" codes
template< class ExecutionPolicy, class RandomIt, class Compare >
void sort( ExecutionPolicy&& policy,
RandomIt first, RandomIt last, Compare comp );
- policy
: execution policy
- first
, last
: random access iterators to the range of elements
- comp
: comparison functor
int main()
{
std::array<int, 10> s = {5, 7, 4, 2, 8, 6, 1, 9, 0, 3};
std::sort(s.begin(), s.end());
print("sorted with the default operator<");
struct {
bool operator()(int a, int b) const { return a < b; }
} customLess;
std::sort(s.begin(), s.end(), customLess);
print("sorted with a custom function object");
std::sort(s.begin(), s.end(), [](int a, int b) { return a > b; });
print("sorted with a lambda expression");
}
(source: C++ doc)
A lag develops and it then becomes harder to catch up
Reliability is thus sacrificed for "progress" and deliverables
Solution:
Tests should be deemed invaluable in research codes
A well-tested research code becomes more easily a reliable production code
Problem:
Stuck with a given test suite/framework to use and increment
Refrain from adding tests because it increases build time:
I know of a production code where developers have a hard limit on the # of tests they can add for a given new feature
Solution:
Separate functional from performance tests
Sometimes refactoring the test suite is needed
Revise the granularity of functional tests
Hierarchical tests: if one "level" fails, do not run the others
francesco.rizzi@ng-analytics.com
https://www.ng-analytics.com