[erlang-questions] Unit Testing gen_server callbacks

Daniel Eliasson <>
Tue Aug 14 08:41:38 CEST 2012


It should be easy enough to unit test such things, just run a handle_call
with the right arguments, and verify that the output and new state is
correct?

I don't think there's a need to actually start the gen_server itself and
unit test the callbacks by going through gen_server:call, if that's what
you mean. In what way do you find it to be fragile?

Best,
Daniel

On 14 August 2012 03:48, Jan Vincent Liwanag <> wrote:

> Hi,
>
> What are your thoughts on unit testing gen_server (or other gen_*)
> callbacks (handle_call, etc) directly? Is this an ok practice? Or should
> unit tests test only the public api?
>
> On my end, I find testing gen_server callbacks to be rather fragile. Eager
> to hear out other thoughts.
>
> Thanks,
>
> Jan Vincent Liwanag
> 
> +63 (999) 888-0247
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120814/333b1f26/attachment.html>


More information about the erlang-questions mailing list