User Tools

Site Tools


arrange_act_assert

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arrange_act_assert [2025/09/03 14:13] – created plidaarrange_act_assert [2025/09/09 16:24] (current) plida
Line 1: Line 1:
 +Source: Software Testing course at ITMO university by Kochubeev Nikolay Sergeevich 
 +
 +
 ====== Arrange Act Assert (AAA) ====== ====== Arrange Act Assert (AAA) ======
  
-Time passes, and tests become unreadable. In just one test there can be way too much arrangement, several actions and dozens of checks. Such a test breaks the main principle: test must explain, not confuse.+Time passes, and [[software_testing|tests]] become unreadable. In just one test there can be way too much arrangement, several actions and dozens of checks. Such a test breaks the main principle: test must explain, not confuse.
  
 Pattern AAA divides test into 3 logical blocks: Pattern AAA divides test into 3 logical blocks:
  
-  * arrange -- environment and data preparation; +  - Arrange -- environment and data preparation. 
-  * act -- calling the action being tested; +  - Act -- calling the action being tested. 
-  * assert -- result check.+  - Assert -- result check.
  
 ==== Arrange ==== ==== Arrange ====
Line 27: Line 30:
 ==== Comparing AAA and GWT ==== ==== Comparing AAA and GWT ====
  
-AAA and GWT are very similar:+AAA and [[given_when_then|GWT]] are very similar:
   * Arrange = Given.   * Arrange = Given.
   * Act = When.   * Act = When.
Line 37: Line 40:
  
   - To many actions in Act -- the test checks for several scenarios at once.   - To many actions in Act -- the test checks for several scenarios at once.
-  - Long and difficult +  - Long and difficult arrangement -- test is unreadable. 
 +  - No asserts or they're not obvious -- unclear what is being checked.
arrange_act_assert.1756908808.txt.gz · Last modified: by plida