Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>One very useful usage it to make test cases clearer, not only for the business analyst but for yourself/your team. </p> <p>When time passes and you've forgotten what the exact test case was all about, having LOP is very helpful. You can have the spec at hand, and even document the rules in source code comments, but those artifacts don't get executed. Code is!</p> <p>You can also make the program very clear, but more clearer than a "language oriented" description would be almost impossible.</p> <p>Consider this fictional fragment. </p> <p><strong>NOTE</strong> Is not that java is LOP but there are some frameworks that whose intention is to do something like the following, that is, make a test case easier to follow.</p> <pre><code>package a; import static a.Help.*; public class Test { public void test(){ Object value = ""; Object obtained = ""; assert that( expected( value , isEqualTo( obtained ) ) ); } } </code></pre> <p>This is a very simple example. The value in this code is the line that gets executed says what the test is all about:</p> <pre><code> assert that( expected( value , isEqualTo( obtained ) ) ); </code></pre> <p>That is very clear, it reads:</p> <blockquote> <p><em>assert that expected value is equal to obtained</em></p> </blockquote> <p>Well this is very simple. But you can have any kind of business rule an just read it literally. </p> <blockquote> <p>assert client mortgage is processed when it reach... etc. etc</p> </blockquote> <p>Martin Fowler explains about this and mention <a href="http://code.google.com/p/hamcrest/" rel="nofollow noreferrer">Hamcrest</a> a framework to do this.</p> <p>Here's the <a href="http://www.infoq.com/presentations/domain-specific-languages" rel="nofollow noreferrer">link</a> <em>( I'm not completely sure if this where he talks about Hamcrest or is it another one :P sorry )</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload