Quick and easy generation of int[] sequences for Codility and Leetcode algorithm challenge test cases
Recently I've been catching up on modern Java.. I haven't used it on the job since Java 5 came out. I've been practicing algorithms on Codility and Leetcode.
The algorithm puzzles on these sites almost always use int
and/or int[]
arguments and return types, and sometimes have BigO performance requirements. To test your algorithms properly, you need to generate very large input arrays, of sizes up to 100,000 with values from +/- 1 billion. My test cases weren't anywhere near as comprehensive as those run by Codility when you submit you solution, and I wanted a way to quickly create tests to cover edge cases and very large inputs.
I started using the data tables feature in the awesome Spock testing fram