tag:blogger.com,1999:blog-1697388841986104302.post2784969825637431601..comments2023-07-02T10:36:44.294-05:00Comments on Agile in a Flash: Arrange-Act-AssertAgileotterhttp://www.blogger.com/profile/10773578598860454277noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-1697388841986104302.post-62842030206232142902010-04-19T13:21:38.855-05:002010-04-19T13:21:38.855-05:00I think it adds more than marginal value. Check o...I think it adds more than marginal value. Check out my post about Why and what is Arrange Act Assert here http://www.arrangeactassert.com/why-and-what-is-arrange-act-assert/Jag Reehalhttp://www.arrangeactassert.comnoreply@blogger.comtag:blogger.com,1999:blog-1697388841986104302.post-28694176424344772722009-03-26T22:49:00.000-05:002009-03-26T22:49:00.000-05:00Oh, now that I re-read this, I remember that I ori...Oh, now that I re-read this, I remember that I originally wrote the code funky:<BR/><BR/>@Test public void applyFine() {<BR/> Patron patron = new Patron();<BR/> patron.setBalance(0);<BR/> // ...<BR/>}<BR/><BR/>on purpose, so as to show Arrange-Assert-Act-Assert:<BR/><BR/>@Test public void applyFine() {<BR/> Patron patron = new Patron();<BR/> assertEquals(0, patron.fineBalance());<BR/><BR/> patron.applyFine(10);<BR/> <BR/> assertEquals(10, patron.fineBalance());<BR/>}<BR/><BR/>Now that I coded this and saw that I didn't like it with 4 chunks, I deleted the first blank line. Thus visually, at least, any precondition assert is probably just treated as part of "Arrange."Jeff Langrhttps://www.blogger.com/profile/10499693020049210645noreply@blogger.comtag:blogger.com,1999:blog-1697388841986104302.post-64199427121839248232009-03-26T07:03:00.000-05:002009-03-26T07:03:00.000-05:00G/W/T you hear more in AT, AAA/BOC/etc in unit tes...G/W/T you hear more in AT, AAA/BOC/etc in unit test.<BR/>But yes.<BR/><BR/>This is one of those incredibly simple ideas that effectively fights writers' block for testers. G/W/T, AAA, BOC, regardless of the name I've seen people break out of a funk just by reciting it.<BR/><BR/>And when that breaks down, I like "write the assert first", because that further focuses the mind.Agileotterhttps://www.blogger.com/profile/10773578598860454277noreply@blogger.comtag:blogger.com,1999:blog-1697388841986104302.post-89999060640813531542009-03-26T03:30:00.000-05:002009-03-26T03:30:00.000-05:00Is that also a synonym for Given/When/Then?Is that also a synonym for Given/When/Then?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1697388841986104302.post-6213606024949660092009-03-25T16:00:00.000-05:002009-03-25T16:00:00.000-05:00Right. I just used to call it "setup, execute, ver...Right. I just used to call it "setup, execute, verify." I like the idea of a standard mnemonic, and AAA seems more memorable.Jeff Langrhttps://www.blogger.com/profile/10499693020049210645noreply@blogger.comtag:blogger.com,1999:blog-1697388841986104302.post-82873124236742104472009-03-25T15:57:00.000-05:002009-03-25T15:57:00.000-05:00AKA "BOC" for Build, Operate, Check.AKA "BOC" for Build, Operate, Check.Agileotterhttps://www.blogger.com/profile/10773578598860454277noreply@blogger.com