-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
177 lines (145 loc) · 6.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>easyb makes it easy, man</title>
<meta name="keywords" content="BDD, behavior driven development, java, java bdd, groovy, groovy bdd,
groovy behavior driven development, java behavior driven development, ruby, rspec, easyb, easy bdd" />
<meta name="description" content="easyb is story verification framework built in the spirit of behavior driven development." />
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3500051-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<body>
<!-- start header -->
<div id="header">
<h1><a href="http://www.easyb.org"><span>easyb</span></a></h1>
<h2> -- BDD in java can't get any easier</h2>
</div>
<!-- end header -->
<!-- start page -->
<div id="page">
<!-- start content -->
<div id="content">
<div class="post">
<h2 class="title">Take it easy with easyb</h2>
<div class="entry">
<p>easyb is a behavior driven development framework for the Java platform. By using a specification based Domain Specific Language, easyb aims to enable executable, yet <i>readable</i>
documentation. </p>
<h3>Behavior driven development?</h3>
<p>Behavior driven development (or BDD) isn't anything new or revolutionary-- it's just an evolutionary offshoot of test driven development, in which the word <i>test</i> is replaced by the word
<i>should</i>. Semantics aside, a lot of people have found that the concept of <i>should</i> is a much more natural development driver than the concept of testing. In fact, when you think in
terms of behavior (i.e. shoulds) you'll find that writing specifications is easier to do first, which is the intent of test driven development in the first place.</p>
<h3>Easy?</h3>
<p>easyb specifications are written in Groovy and run via a Java runner that can be invoked via the command line, Maven 2, or Ant. What's more, easyb supports a few different styles of
specifications ranging from RSpec's <code>it</code> to a story based DSL with <code>given</code>s, <code>when</code>s, and <code>then</code>s.
</p>
<p>easyb is all about easy. </p>
<h3>easyb in action</h3>
<p>easyb enables you to verify behavior of normal Java objects, work-flows, etc (basically, anything you write in Java) in a more natural way-- for instance, imagine having a conversation with a
customer who wants you to write something to validate zip codes. </p>
<blockquote>
"Could you please write something that lets my customers know when they've provided an invalid zip code?"
</blockquote>
<blockquote>
"Sure! So, given an invalid zip code, this validation service should notify someone that the zip code is incorrect?"
</blockquote>
<blockquote>
"Right on! Man, you are smart!"
</blockquote>
<p>Notice that nowhere in this conversation did anyone say test! Whether or not you write specifications first or afterwards is up to you; however, assuming that you've already written the zip
code validator, you could construct a story like so:</p>
<ul>
<li>Given that someone mistypes a zip code</li>
<li>And given the zip code validation service is up and running</li>
<li>When validate is invoked</li>
<li>Then the service should indicate the zip code is invalid</li>
</ul>
<p>Using the text above, you can then construct an easyb story like so: </p>
<pre><code>
given "an invalid zip code", {
invalidzipcode = "221o1"
}
and "given the zipcodevalidator is initialized", {
zipvalidate = new ZipCodeValidator()
}
when "validate is invoked with the invalid zip code", {
value = zipvalidate.validate(invalidzipcode)
}
then "the validator instance should return false", {
value.shouldBe false
}
</code></pre>
<p>Is that easy or what? Notice the <code>shouldBe</code> call in the <code>then</code> phrase-- neat, huh?
</p>
<p>Requirements, ideas, code-- they're all evolutionary in ways; consequently, you can refactor the scenario above if you find it helpful. For instance, the same scenario can be written more tersely like so:
<pre><code>
given "the zipcodevalidator is initialized", {
zipvalidate = new ZipCodeValidator()
}
then "the validator should return false with invalid zipcodes", {
zipvalidate.validate("22o1o").shouldBe false
}
</code></pre>
<p>The point being that easyb helps bridge the gap between stakeholders and development by using a language that everyone can understand.</p>
<p>BDD in Java can't get any easier!</p>
</div>
</div>
</div>
<!-- end content -->
<!-- start sidebar -->
<div id="sidebar">
<ul>
<li>
<h2>Overview</h2>
<ul>
<li><a href="./index.html">Home</a></li>
<li><a href="./howtos.html">Stories</a></li>
<li><a href="./howtobb.html">Specifications</a></li>
<li><a href="./download.html">Download</a></li>
</ul>
</li>
<li>
<h2>Details</h2>
<ul>
<li><a href="./running.html">Running easyb</a></li>
<li><a href="./tutorialstack.html">An in-depth tutorial</a></li>
<li><a href="./dsls.html">easyb syntax specification</a></li>
<li><a href="./lic.html">License</a></li>
<li><a href="./source.html">Source code</a></li>
<li><a href="./contact.html">Contact</a></li>
</ul>
</li>
<li>
<h2>Plug-ins</h2>
<ul>
<li><a href="./dbunit.html">DbUnit plug-in</a></li>
</ul>
</li>
<li>
<h2>Resources</h2>
<ul>
<li><a href="http://dannorth.net/introducing-bdd/">Introducing BDD</a> (DanNorth.net)</li>
<li><a href="http://rspec.rubyforge.org/">RSpec</a></li>
<li><a href="http://groovy.codehaus.org/">Groovy</a></li>
<li><a href="http://code.google.com/p/easyb/w/list">easyb wiki</a></li>
<li><a href="./articles.html">Additional resources</a></li>
</ul>
</li>
</ul>
<div style="clear: both;"> </div>
</div>
<!-- end sidebar -->
</div>
<!-- end page -->
<div id="footer">
</div>
</body>
</html>