Re:Show HN: Given an API, Generate client libraries in Node,...
by sunkarapk on Friday January 03, 2014 @10:08AM
(#7005740)
Tests is one of the main priority and I am planning to do them soon.
This current program just a small step in the right direction. :)
EDIT: Currently, I have a test suite at https://github.com/pksunkara/alpaca/tree/testing which tests the generated client libraries of an example API with the respective server.
Re:Show HN: Given an API, Generate client libraries in Node,...
by X4 on Friday January 03, 2014 @11:27AM
(#7006232)
That sounds cool! Is there a way to automatically generate BDD style Tests?
Have a look at http://funkload.nuxeo.org/intro.html
Re:Show HN: Given an API, Generate client libraries in Node,...
by dsl on Saturday January 04, 2014 @04:56AM
(#7010605)
If you have programmatically generated code, generating tests is almost completely useless (especially if the same code is generating the tests as well).
A bunch of passing tests shouldn't make you feel comfortable able releasing something to production. Proper code review and monitoring of client failures on your servers should make you confident.
Re:Show HN: Given an API, Generate client libraries in Node,...
by Robin_Message on Friday January 03, 2014 @11:55AM
(#7006453)
I'm confused by this comment. What would the tests test?
My thinking is that, if trusted to output a library that matches the API spec, there is no need to test that API. However, that does require that Alpaca is well-tested enough to be trusted - would you be happy with tests in Alpaca itself, or should it generate tests too?
Re:Show HN: Given an API, Generate client libraries in Node,...
by jxf on Friday January 03, 2014 @12:47PM
(#7006787)
I guess it depends on whether you view Alpaca as (a) "it's a starting point for generating your API", or (b) "it's the authoritative source and the only way to generate your API". If you use it like (b) you don't need tests, but Alpaca does. If you use it like (a) Alpaca still needs tests, but the buck stops with you.
Re:Show HN: Given an API, Generate client libraries in Node,...
by Robin_Message on Friday January 03, 2014 @02:59PM
(#7007727)
Ah, using it as a starting point, that you then want to test. That makes sense, thanks :)
Overall, I'm not sure that the time savings is as big as it first appears, but I think it's great for quick projects.
[0] http://thrift.apache.org/