We are making an interface to interact with a prioprietary database called KDB.
We want to test all aspects of that interface against test kdb code.
We would like a third party (yourself) to write those tests to ensure we can meet an independently set specification.
The overall task will be much larger and complicated but initially we would like:
Java unit tests for the functions:
abs, acos, all, any, asc, asin, atan, attr, avg, avgs, ceiling, cos, count, desc, dev, differ, distinct, enlist, exit, exp, exp, fills, first, flip, floor, get, getenv, group, gtime, iasc, idesc, inv, key, last, log, lower, ltime, ltrim, max, maxs, mcount, med, min, mins, mmu, neg, not, null, parse, prd, prds, rand, ratios, ratios, raze, read0, read1, reciprocal, reverse, rotate, rtrim, sdev, show, signum, sin, sqrt, string, svar, system, tables, tan, til, til, trim, type, upper, value, var, views, where
For each function we would want a test of the most significant data types. e.g. for the fill operation ^ we would have a test like so:
[login to view URL]
public class FillOpTest {
@Test public void fill0() { check("9 8 7 6^1 2 3 0N", "1 2 3 6"); }
@Test public void fill1() { check("9^1 2 3 0N", "1 2 3 9"); }
@Test public void fill2() { check("-1.0^1.1 2.2 0n 4.4 0n 5.5", "1.1 2.2 -1 4.4 -1 5.5"); }
@Test public void fill3() { check("-1^1.1 2.2 0n 4.4 0n 5.5", "1.1 2.2 -1 4.4 -1 5.5"); }
@Test public void fill4() { check("`jim^``tom```jerry", "`jim`tom`jim`jim`jerry"); }
@Test public void fill5() { check("(`a`b`c`d!3 2 1 0N) ^ `a`b!0N 30", ""); }
@Test public void fill6() { check("9^0Nh", "9"); }
@Test public void fill7() { check("0N^0Nh", "0N"); }
@Test public void fill8() { check("\"abcde\"^\"z z z\"", "zbzdz"); }
}
The check command here takes 2 arguments:
1. Would show the input to kdb
2. The expected string output from KDB.