Hacker News new | ask | show | jobs
by pmontra 1526 days ago
I'm writing a Rails API app (for a customer) that is a client to Alexa's Skill Management API and is a server for a backend app. I have tests but I'm afraid that without a 100% coverage of all corner cases I'll be disappointed by some results and it could be difficult to manually fix the code generated by the program. Am I overly pessimistic?
1 comments

That is a fair concern. The tool only guarantees correctness up to the level checked by the tests you provide. So if all corner cases are not covered, RbSyn will generate some program that passes the tests, but might not pass unspecified corner cases. I suspect the missing cases will be clear with a manual audit of the synthesized code, and you can add update the synthesized code manually or add requisite tests.
> I suspect the missing cases will be clear with a manual audit of the synthesized code

We might just have really different brains but "read the code and figure out everything it doesn't do" is one of the hardest possible tasks for me?

It is a hard task, for sure! But without any tests to convey your intent as a programmer, RbSyn also has no way of knowing what you intended a method's behavior to be.

The running thread here is if you would have written a method and some tests to check that you indeed wrote the method correctly, RbSyn will automate the task of writing the method for you. In other words, it is just like test driven development, where the writing the code part is automated.

By manual audit, I meant you can verify if you need more tests to capture your intended behavior or just take a shorter route and update the synthesized code directly without any new tests for the newly added behavior. One could argue the latter is bad programming practice.