Re: Testing D database calls code for regression

2018-03-19 Thread Ali via Digitalmars-d-learn
On Friday, 16 March 2018 at 20:17:49 UTC, aberba wrote: How will you test D code which makes calls to database to detect bugs and regression. Unlike where you can inject data like assert (2+1 == 3), database interfacing code will be crazy... Or there's some mocking available for such cases.

Re: Testing D database calls code for regression

2018-03-19 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 19, 2018 at 06:45:49PM +, aberba via Digitalmars-d-learn wrote: [...] > The thing about functional programming where functions are > decoupled/testable doesn't seem to apply to database call code. I > guess its because databases introduces a different state...another > point of

Re: Testing D database calls code for regression

2018-03-19 Thread aberba via Digitalmars-d-learn
On Monday, 19 March 2018 at 00:56:26 UTC, H. S. Teoh wrote: On Sun, Mar 18, 2018 at 07:51:18PM +, aberba via Digitalmars-d-learn wrote: On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote: > On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via > Digitalmars-d-learn wrote: > > [...]

Re: Testing D database calls code for regression

2018-03-18 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Mar 18, 2018 at 07:51:18PM +, aberba via Digitalmars-d-learn wrote: > On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote: > > On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via Digitalmars-d-learn > > wrote: > > > [...] > > > > The usual way I do this is to decouple the code

Re: Testing D database calls code for regression

2018-03-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 18, 2018 19:51:18 aberba via Digitalmars-d-learn wrote: > On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote: > > On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via > > > > Digitalmars-d-learn wrote: > >> [...] > > > > The usual way I do this is to decouple the code from

Re: Testing D database calls code for regression

2018-03-18 Thread aberba via Digitalmars-d-learn
On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote: On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via Digitalmars-d-learn wrote: [...] The usual way I do this is to decouple the code from the real database backend by templatizing the database driver. Then in my unittest I can

Re: Testing D database calls code for regression

2018-03-16 Thread nani via Digitalmars-d-learn
On Friday, 16 March 2018 at 20:17:49 UTC, aberba wrote: How will you test D code which makes calls to database to detect bugs and regression. Unlike where you can inject data like assert (2+1 == 3), database interfacing code will be crazy... Or there's some mocking available for such cases.

Re: Testing D database calls code for regression

2018-03-16 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via Digitalmars-d-learn wrote: > How will you test D code which makes calls to database to detect bugs > and regression. Unlike where you can inject data like assert (2+1 == > 3), database interfacing code will be crazy... Or there's some mocking >

Testing D database calls code for regression

2018-03-16 Thread aberba via Digitalmars-d-learn
How will you test D code which makes calls to database to detect bugs and regression. Unlike where you can inject data like assert (2+1 == 3), database interfacing code will be crazy... Or there's some mocking available for such cases. Especially when more features are developed on top.