merge tester.R from bdb