<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: rgb(255, 255, 255); font-size: 12px; font-family: Consolas, 'Liberation Mono', Courier, monospace; color: rgb(51, 51, 51); line-height: 16px; position: static; z-index: auto; "><div class="line" id="LC71" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><rant></div><div class="line" id="LC71" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; ">Can someone who knows better explain how this evil child of -spec:</div><div class="line" id="LC71" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="c" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(153, 153, 136); font-style: italic; "><br></span></div><div class="line" id="LC71" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="c" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(153, 153, 136); font-style: italic; ">%% @doc The gen_server code_change/3 callback, called when performing</span></div><div class="line" id="LC72" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="c" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(153, 153, 136); font-style: italic; ">%% a hot code upgrade on the server. Currently unused.</span></div><div class="line" id="LC73" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">-</span><span class="ni" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(128, 0, 128); ">spec</span> <span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">code_change</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">(</span><span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">OldVsn</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">State</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Extra</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">)</span> <span class="o" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-weight: bold; ">-></span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">{</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">ok</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">State</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">}</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">|</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">{</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">error</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Reason</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">}</span></div><div class="line" id="LC74" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "> <span class="k" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-weight: bold; ">when</span></div><div class="line" id="LC75" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">OldVsn</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">::</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Vsn</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">|</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">{</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">down</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Vsn</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">},</span></div><div class="line" id="LC76" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Vsn</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">::</span> <span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">term</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">(),</span></div><div class="line" id="LC77" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">State</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">::</span> <span class="nl" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">#state</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">{},</span></div><div class="line" id="LC78" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Extra</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">::</span> <span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">term</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">(),</span></div><div class="line" id="LC79" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Reason</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">::</span> <span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">term</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">().</span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="nf" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(153, 0, 0); font-weight: bold; ">code_change</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">(_</span><span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">OldVsn</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">State</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">_</span><span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">Extra</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">)</span> <span class="o" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-weight: bold; ">-></span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">{</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">ok</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">,</span> <span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">State</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">}.</span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; "><br></span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">...is not a total waste of too many talented people's time over the more transparent:</span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; "><br></span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">code_change(</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; ">_</span><span class="nv" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(0, 128, 128); ">OldVsn</span>, State = #state{}, _Extra) -> {ok, State}.</div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; "><br></span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; ">...or is spec just a diabolical case of over-engineering that is at once both incredibly onerous and bug-prone justified in the cause of the weaknesses of some ill-designed test tool?</div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><br></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; ">My gut reaction is that if you feel that you NEED TO DO TDD style testing, you should take the time parse the source and not bloat it beyond readability by inflicting conventions on the development of the source that will simply distract and so *cause* the bugs you think that you are testing for.</div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><br></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; ">A better use of developer time would be to enforce documentation of the intention of the function.</div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; "><br></span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; "></rant></span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; ">/s</div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; vertical-align: baseline; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; "><br></span></div></pre><div><br></div></body></html>