Comments - Unit-Testing T-SQL Projects - TechHui2024-03-29T09:19:59Zhttp://www.techhui.com/profiles/comment/feed?attachedTo=1702911%3ABlogPost%3A129814&xn_auth=noMakes sense. I've been on an…tag:www.techhui.com,2014-06-21:1702911:Comment:1298282014-06-21T05:44:30.376ZBrianhttp://www.techhui.com/profile/Brian268
<p>Makes sense. I've been on an ORM bender lately so (for better or worse) am currently of the mindset that it is the One True Way (tm) .. etc..</p>
<p></p>
<p>Anyway fair enough.. definitely times where doing plain ol' sql makes sense!</p>
<p>Makes sense. I've been on an ORM bender lately so (for better or worse) am currently of the mindset that it is the One True Way (tm) .. etc..</p>
<p></p>
<p>Anyway fair enough.. definitely times where doing plain ol' sql makes sense!</p> @Brian: Sorry, I think the fi…tag:www.techhui.com,2014-06-21:1702911:Comment:1298262014-06-21T01:32:52.146ZDavid Chunghttp://www.techhui.com/profile/DavidChung
<p>@Brian: Sorry, I think the first segment you quoted was poorly written so allow me to clarify:</p>
<p>If we had unit tests for the T-SQL functionality that the front-end ultimately invokes, then the discrepancies would be picked up...</p>
<p>The point I was trying to make with this post was to make sure that all expectations are stated. If your application is dependent on T-SQL functionality, then you need to state what its expectations are. In this post, I provided one method to do…</p>
<p>@Brian: Sorry, I think the first segment you quoted was poorly written so allow me to clarify:</p>
<p>If we had unit tests for the T-SQL functionality that the front-end ultimately invokes, then the discrepancies would be picked up...</p>
<p>The point I was trying to make with this post was to make sure that all expectations are stated. If your application is dependent on T-SQL functionality, then you need to state what its expectations are. In this post, I provided one method to do so.</p>
<p>I agree with your comment but I think it is beyond the scope of this post.</p> Sorry I may be misunderstandi…tag:www.techhui.com,2014-06-21:1702911:Comment:1298832014-06-21T00:36:15.086ZBrianhttp://www.techhui.com/profile/Brian268
<p>Sorry I may be misunderstanding you.</p>
<p></p>
<p>You say..</p>
<blockquote><p><span>Changes in the T-SQL system can potentially break the front-end since assumptions may have changed. So here is where unit-testing comes into play. If we had unit tests for the front-end components that ultimately invokes the T-SQL functions and the functionality changes, then the tests should pick up the discrepancies and most likely fail, thus alerting developers that the system change isn't…</span></p>
</blockquote>
<p>Sorry I may be misunderstanding you.</p>
<p></p>
<p>You say..</p>
<blockquote><p><span>Changes in the T-SQL system can potentially break the front-end since assumptions may have changed. So here is where unit-testing comes into play. If we had unit tests for the front-end components that ultimately invokes the T-SQL functions and the functionality changes, then the tests should pick up the discrepancies and most likely fail, thus alerting developers that the system change isn't complete.</span></p>
</blockquote>
<p>then later..</p>
<blockquote><p><span> I believe that the front-end application should be using some form of object layer to interface with the database.</span></p>
<p></p>
</blockquote>
<p>These statements seem contradictory - I agree with the second bit - use an ORM here and you can split out the back-end munging tests from the front-end business logic tests. Then you can simply implement stub implementations to make writing test cases pretty trivial. So by extra work I mean why not use an ORM for simpler code and test cases rather than writing a bunch of complicated ones.</p>
<p></p>
<p></p> @Brian: Please elaborate. Wha…tag:www.techhui.com,2014-06-20:1702911:Comment:1299832014-06-20T08:04:38.080ZDavid Chunghttp://www.techhui.com/profile/DavidChung
<p>@Brian: Please elaborate. What is much work? Rewrite what?</p>
<p>@Brian: Please elaborate. What is much work? Rewrite what?</p> If you have to do that much w…tag:www.techhui.com,2014-06-20:1702911:Comment:1298232014-06-20T07:53:33.745ZBrianhttp://www.techhui.com/profile/Brian268
<p>If you have to do that much work why not rewrite using an ORM?</p>
<p>If you have to do that much work why not rewrite using an ORM?</p>