From e19446eb24a63e8d24010b0f6cc9d1665b81279e Mon Sep 17 00:00:00 2001 From: Raz Luvaton Date: Tue, 23 Feb 2021 19:44:25 +0200 Subject: [PATCH] Added another quote for AAA --- sections/testingandquality/aaa.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sections/testingandquality/aaa.md b/sections/testingandquality/aaa.md index bc357b2c..9615442b 100644 --- a/sections/testingandquality/aaa.md +++ b/sections/testingandquality/aaa.md @@ -59,3 +59,16 @@ test('Should be classified as premium', () => { From the book [XUnit Patterns](http://xunitpatterns.com/Four%20Phase%20Test.html): > It is important for the test reader to be able to quickly determine what behavior the test is verifying. It can be very confusing when various behaviors of the system under test (SUT) are being invoked, some to set up the pre-test state (fixture) of the SUT, others to exercise the SUT and yet others to verify the post-test state of the SUT. Clearly identifying the four phases makes the intent of the test much easier to see. + + +### "A useful technique [...] is that writing the Assert first is a great place to start." +From the article [Arrange, Act, Assert](https://xp123.com/articles/3a-arrange-act-assert/) by Bill Wake which first observed and named the pattern + +> **Where to Begin?** +> +> You might think that the Arrange is the natural thing to write first, since it comes first. +When I’m systematically working through an object’s behaviors, I may write the Act line first. +> +> But a useful technique I learned from Jim Newkirk is that writing the Assert first is a great place to start. When you have a new behavior you know you want to test, Assert First lets you start by asking “Suppose it worked; how would I be able to tell?” With the Assert in place, you can do what Industrial Logic calls “Frame First” and lean on the IDE to “fill in the blanks.” + +