[{"data":1,"prerenderedAt":61},["ShallowReactive",2],{"wiki-test-design-state-transition-testing-en":3},{"meta":4,"html":8,"headings":9,"words":60},{"title":5,"description":6,"published":7,"updated":7},"State transition testing","State transition testing: states, events, guard conditions and actions, the state table with invalid transitions, coverage from all states to N-switch.","2026-11-03","\u003Cp>\u003Cstrong>State transition testing\u003C/strong> is a black-box test technique in which \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"test-case\">test cases\u003C/span> are designed to exercise elements of a state transition model. The model describes the states of a test object, the events it reacts to and the transitions between states that the events cause. The technique is used when the response of a system to an input depends not only on the input, but also on what happened before.\u003C/p>\n\u003Cp>State models come from automata theory. In 1978 T. S. Chow published in IEEE Transactions on Software Engineering a method for testing software designs modeled as finite-state machines, and the ISTQB glossary names Chow as the source of the term N-switch coverage. Today the technique is one of the four black-box test techniques of the ISTQB Foundation Level syllabus (version 4.0.1, section 4.2.4). The Advanced Level Test Analyst syllabus (version 4.0, 2025, section 3.2.2) adds N-switch and round-trip coverage. The standard ISO/IEC/IEEE 29119-4:2021 describes the technique in clause 5.2.8 and its coverage measurement in clause 6.2.8.\u003C/p>\n\u003Ch2 id=\"the-problem-state-transition-testing-solves\" class=\"wiki-heading\">The problem state transition testing solves\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"the-problem-state-transition-testing-solves\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>Many objects react to the same input in different ways. A &quot;Cancel&quot; button cancels an order that is waiting for payment, refunds an order that has been paid, and does nothing for an order that has already been shipped. A password that is correct opens the account after one failed attempt and does not open it after three, because the account is locked by then. The input is the same, the result depends on the state.\u003C/p>\n\u003Cp>Techniques that look only at input values do not see this dependency. \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"equivalence-partitioning\">Equivalence partitioning\u003C/span> and \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"decision-table\">decision tables\u003C/span> describe one reaction to one combination of inputs. They do not describe sequences: what happens if the order is paid, then cancelled, then the payment event arrives again. \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"defect\">Defects\u003C/span> of this kind appear in the order of events, not in the values.\u003C/p>\n\u003Cp>A state model makes the dependency explicit. It lists the states, says which events are allowed in each of them and where each event leads. Test cases are then derived as paths through the model, and coverage shows which states and transitions the tests have exercised.\u003C/p>\n\u003Ch2 id=\"elements-of-a-state-model\" class=\"wiki-heading\">Elements of a state model\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"elements-of-a-state-model\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>A state model consists of a few elements. The table lists them with examples from the order life cycle used below.\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-3\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Element\u003C/th>\n\u003Cth>Meaning\u003C/th>\n\u003Cth>Example\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>State\u003C/td>\n\u003Ctd>Condition in which the object waits for events\u003C/td>\n\u003Ctd>Paid\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Event\u003C/td>\n\u003Ctd>Occurrence that can cause a transition\u003C/td>\n\u003Ctd>ship\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Transition\u003C/td>\n\u003Ctd>Change from a source state to a target state\u003C/td>\n\u003Ctd>Paid to Shipped\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Guard condition\u003C/td>\n\u003Ctd>Condition that must be true for the transition to fire\u003C/td>\n\u003Ctd>payment approved\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Action\u003C/td>\n\u003Ctd>Behavior performed during the transition\u003C/td>\n\u003Ctd>send tracking number\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Initial state\u003C/td>\n\u003Ctd>State in which the object starts\u003C/td>\n\u003Ctd>Pending payment\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Final state\u003C/td>\n\u003Ctd>State after which the object accepts no events\u003C/td>\n\u003Ctd>Delivered, Cancelled\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>The ISTQB syllabus writes a transition label as \u003Ccode>event [guard condition] / action\u003C/code>. The guard condition and the action are omitted when there are none or when they are not relevant to the tester. Transitions are considered instantaneous. A transition can lead back into the same state: a declined payment leaves the order waiting for payment and shows an error.\u003C/p>\n\u003Cp>Guard conditions split one event into several transitions. The event \u003Ccode>pay\u003C/code> from the state Pending payment leads to Paid when the payment is approved and stays in Pending payment when it is declined. For the tester these are two different transitions, and each needs its own test.\u003C/p>\n\u003Ch2 id=\"state-diagram\" class=\"wiki-heading\">State diagram\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"state-diagram\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>A \u003Cstrong>state diagram\u003C/strong> shows the states as nodes and the valid transitions as arrows labeled with events. The order life cycle of an online shop has five states and six valid transitions:\u003C/p>\n\u003Cdiv class=\"wiki-code wiki-code--plain\">\u003Cpre>\u003Ccode> start\n   |\n   v\n+-----------------+   pay [declined] / show error\n| Pending payment |--------------------------+\n|                 |&lt;-------------------------+\n+-----------------+\n   |          |\n   | cancel   | pay [approved] / send receipt\n   |          v\n   |     +------+\n   |     | Paid |----------------------+\n   |     +------+                      |\n   |          |                        | cancel / refund\n   |          | ship / send tracking   |\n   |          v                        |\n   |     +---------+                   |\n   |     | Shipped |                   |\n   |     +---------+                   |\n   |          |                        |\n   |          | deliver                |\n   |          v                        |\n   |     +-----------+                 |\n   |     | Delivered |                 |\n   |     +-----------+                 |\n   v                                   |\n+-----------+                          |\n| Cancelled |&lt;-------------------------+\n+-----------+\u003C/code>\u003C/pre>\u003C/div>\n\u003Cp>The transitions are numbered for reference in the rest of the article:\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-4\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>No.\u003C/th>\n\u003Cth>Source state\u003C/th>\n\u003Cth>Event [guard] / action\u003C/th>\n\u003Cth>Target state\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>T1\u003C/td>\n\u003Ctd>Pending payment\u003C/td>\n\u003Ctd>pay [approved] / send receipt\u003C/td>\n\u003Ctd>Paid\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>T2\u003C/td>\n\u003Ctd>Pending payment\u003C/td>\n\u003Ctd>pay [declined] / show error\u003C/td>\n\u003Ctd>Pending payment\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>T3\u003C/td>\n\u003Ctd>Pending payment\u003C/td>\n\u003Ctd>cancel\u003C/td>\n\u003Ctd>Cancelled\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>T4\u003C/td>\n\u003Ctd>Paid\u003C/td>\n\u003Ctd>cancel / refund\u003C/td>\n\u003Ctd>Cancelled\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>T5\u003C/td>\n\u003Ctd>Paid\u003C/td>\n\u003Ctd>ship / send tracking\u003C/td>\n\u003Ctd>Shipped\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>T6\u003C/td>\n\u003Ctd>Shipped\u003C/td>\n\u003Ctd>deliver\u003C/td>\n\u003Ctd>Delivered\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>The diagram shows only what is allowed. It does not show what happens when an event arrives in a state that has no arrow for it, for example \u003Ccode>cancel\u003C/code> for a shipped order.\u003C/p>\n\u003Ch2 id=\"state-table\" class=\"wiki-heading\">State table\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"state-table\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>A \u003Cstrong>state table\u003C/strong> is a model equivalent to a state diagram. Its rows are states, its columns are events together with guard conditions, and each cell holds the target state and the action. Unlike the diagram, the state table shows the invalid transitions explicitly. The ISTQB syllabus leaves such cells empty; in the table below a dash marks them:\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-6\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>State\u003C/th>\n\u003Cth>pay [approved]\u003C/th>\n\u003Cth>pay [declined]\u003C/th>\n\u003Cth>cancel\u003C/th>\n\u003Cth>ship\u003C/th>\n\u003Cth>deliver\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Pending payment\u003C/td>\n\u003Ctd>Paid / send receipt\u003C/td>\n\u003Ctd>Pending payment / show error\u003C/td>\n\u003Ctd>Cancelled\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Paid\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>Cancelled / refund\u003C/td>\n\u003Ctd>Shipped / send tracking\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Shipped\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>Delivered\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Delivered\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Cancelled\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>The table has 25 cells: 6 valid transitions and 19 invalid ones. Building the table forces a decision for every cell. A cell that nobody can fill is a question to the authors of the requirements: should a paid order that is cancelled during packing be refunded, or rejected?\u003C/p>\n\u003Ch3 id=\"invalid-transitions\" class=\"wiki-heading\">Invalid transitions\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"invalid-transitions\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h3>\n\u003Cp>An \u003Cstrong>invalid transition\u003C/strong> is an event that arrives in a state where it is not allowed. The \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"expected-result\">expected result\u003C/span> of such a test is defined by the requirements. Usually the object stays in the same state, no action is performed, and the user or the calling system receives an error. Some events are ignored without an error by design, for example a repeated \u003Ccode>deliver\u003C/code> from a courier system. The test checks the state after the event, not only the message.\u003C/p>\n\u003Cp>Invalid transitions are not always reachable through the user interface. A user interface can hide the &quot;Ship&quot; button for an unpaid order while the API behind it still accepts the request. Tests of invalid transitions are therefore also run below the user interface, where the event can be sent directly.\u003C/p>\n\u003Ch2 id=\"coverage-criteria\" class=\"wiki-heading\">Coverage criteria\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"coverage-criteria\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>The ISTQB syllabus defines three coverage criteria for state transition testing. Each is measured as a percentage: exercised coverage items divided by all coverage items.\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-3\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Criterion\u003C/th>\n\u003Cth>Coverage items\u003C/th>\n\u003Cth>Order example\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>All states coverage\u003C/td>\n\u003Ctd>States\u003C/td>\n\u003Ctd>5 states\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Valid transitions coverage (0-switch)\u003C/td>\n\u003Ctd>Single valid transitions\u003C/td>\n\u003Ctd>6 transitions\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>All transitions coverage\u003C/td>\n\u003Ctd>Valid and invalid transitions of the state table\u003C/td>\n\u003Ctd>6 valid and 19 invalid\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>The criteria form a hierarchy. Full valid transitions coverage guarantees full all states coverage. Full all transitions coverage guarantees both. The syllabus calls valid transitions coverage the most widely used criterion and recommends all transitions coverage as a minimum for mission-critical and safety-critical software.\u003C/p>\n\u003Ch3 id=\"all-states-coverage\" class=\"wiki-heading\">All states coverage\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"all-states-coverage\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h3>\n\u003Cp>All states coverage requires every state to be reached at least once. In the order example two test cases are enough: one goes through Pending payment, Paid, Shipped and Delivered, the other cancels the order. The criterion is weak: it can be met without exercising the refund (T4) or the declined payment (T2).\u003C/p>\n\u003Ch3 id=\"valid-transitions-coverage\" class=\"wiki-heading\">Valid transitions coverage\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"valid-transitions-coverage\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h3>\n\u003Cp>Valid transitions coverage requires every valid transition to be exercised at least once. It is also called 0-switch coverage. A test case is a sequence of events, and one test case can exercise several transitions. Three test cases cover all six transitions of the example; they are listed in the section on test cases below.\u003C/p>\n\u003Ch3 id=\"all-transitions-coverage\" class=\"wiki-heading\">All transitions coverage\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"all-transitions-coverage\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h3>\n\u003Cp>All transitions coverage adds every invalid transition of the state table. The syllabus recommends testing one invalid transition per test case. Two invalid events in one test case can cause defect masking: the first defect hides the second. In the example the 19 invalid transitions need at least 19 test cases. The valid transitions fit into their first steps, which bring the order into the state where the invalid event is sent.\u003C/p>\n\u003Ch3 id=\"n-switch-coverage\" class=\"wiki-heading\">N-switch coverage\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"n-switch-coverage\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h3>\n\u003Cp>\u003Cstrong>N-switch coverage\u003C/strong> is the coverage of sequences of N+1 consecutive valid transitions. Valid transitions coverage is the case N = 0. 1-switch coverage requires every pair of consecutive transitions, where the second starts in the state where the first ends. The order example has six such pairs:\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-2\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>State between\u003C/th>\n\u003Cth>Pairs of transitions\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Pending payment\u003C/td>\n\u003Ctd>T2 then T1, T2 then T2, T2 then T3\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Paid\u003C/td>\n\u003Ctd>T1 then T4, T1 then T5\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Shipped\u003C/td>\n\u003Ctd>T5 then T6\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>The pair T2 then T2 is two declined payments in a row. It checks that the second attempt is still accepted after the first one fails, which single transitions do not show. According to the Test Analyst syllabus, 0-switch and 1-switch coverage are frequently used in practice, and 2-switch or higher coverage is indicated only for a high risk of failure. The same syllabus defines \u003Cstrong>round-trip coverage\u003C/strong>: a round trip is a loop that starts and ends in the same state, with no other state occurring twice in it.\u003C/p>\n\u003Ch2 id=\"test-cases-for-the-order-example\" class=\"wiki-heading\">Test cases for the order example\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"test-cases-for-the-order-example\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>The following test cases achieve full valid transitions coverage. Each row is a sequence of events from the initial state Pending payment.\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-4\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Test case\u003C/th>\n\u003Cth>Events\u003C/th>\n\u003Cth>States passed\u003C/th>\n\u003Cth>Transitions\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>ST-1\u003C/td>\n\u003Ctd>pay [declined], pay [approved], ship, deliver\u003C/td>\n\u003Ctd>Pending payment, Pending payment, Paid, Shipped, Delivered\u003C/td>\n\u003Ctd>T2, T1, T5, T6\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>ST-2\u003C/td>\n\u003Ctd>cancel\u003C/td>\n\u003Ctd>Pending payment, Cancelled\u003C/td>\n\u003Ctd>T3\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>ST-3\u003C/td>\n\u003Ctd>pay [approved], cancel\u003C/td>\n\u003Ctd>Pending payment, Paid, Cancelled\u003C/td>\n\u003Ctd>T1, T4\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>ST-1 and ST-2 together reach all five states, so they achieve all states coverage. ST-3 adds the refund, the only transition the first two miss. Each test case checks the state and the action after every event: the error message after the declined payment, the receipt, the tracking number, the refund.\u003C/p>\n\u003Cp>Tests of invalid transitions follow the same pattern with one invalid event at the end. For example:\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-3\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Test case\u003C/th>\n\u003Cth>Events\u003C/th>\n\u003Cth>Expected result\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>ST-4\u003C/td>\n\u003Ctd>pay [approved], ship, cancel\u003C/td>\n\u003Ctd>Error; state stays Shipped; no refund\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>ST-5\u003C/td>\n\u003Ctd>ship\u003C/td>\n\u003Ctd>Error; state stays Pending payment; no tracking number\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>ST-6\u003C/td>\n\u003Ctd>cancel, pay [approved]\u003C/td>\n\u003Ctd>Error; state stays Cancelled; no payment is taken\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>The test cases are written in the usual form with \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"precondition\">preconditions\u003C/span>, steps and expected results; the structure is described in the article \u003Ca href=\"/en/wiki/test-management/test-case\" class=\"wiki-link wiki-link--article\">Test case\u003C/a>. The guard conditions often hide input partitions: &quot;payment approved&quot; and &quot;payment declined&quot; are the result of card data, amount limits and the response of the payment provider. Choosing values for them is the subject of \u003Ca href=\"/en/wiki/test-design/equivalence-partitioning-and-boundary-values\" class=\"wiki-link wiki-link--article\">equivalence partitioning and boundary values\u003C/a>.\u003C/p>\n\u003Ch2 id=\"visualizing-the-flow\" class=\"wiki-heading\">Visualizing the flow\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"visualizing-the-flow\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>The diagram and the table are two views of one model, and each shows what the other hides. The diagram shows the flow: the main path from the initial state to the final states, loops and branches. The table shows completeness: every pair of state and event, including the invalid ones.\u003C/p>\n\u003Cp>Test cases can be drawn on the diagram as paths. Marking the path of each test case makes gaps visible: an arrow that no path crosses is a transition without a test. The same check can be made with the transition list: a column per test case and a mark for each transition it exercises.\u003C/p>\n\u003Cp>Larger models use richer notations. The Test Analyst syllabus names extended finite state machines, Harel statecharts and UML state machines. Harel's 1987 paper describes statecharts as state-transition diagrams extended with hierarchy, concurrency and communication. Hierarchy keeps a diagram readable: a state &quot;Active&quot; can contain Paid and Shipped, and one \u003Ccode>cancel\u003C/code> arrow from &quot;Active&quot; stands for several transitions. For test design such a model is flattened back into a table, so that each transition and each invalid cell can be counted.\u003C/p>\n\u003Cblockquote>\n\u003Cp>A state diagram in a specification is often a summary. RFC 9293, which defines TCP, says of its own state diagram that it is only a summary and must not be taken as the total specification. Test cases are derived from the full description of the behavior, not only from the picture.\u003C/p>\n\u003C/blockquote>\n\u003Ch2 id=\"where-the-technique-applies\" class=\"wiki-heading\">Where the technique applies\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"where-the-technique-applies\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>The technique applies to anything whose behavior depends on a history of events. Typical areas:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>User interface flows\u003C/strong>: multi-step forms and wizards, sign-in with locking after a number of failed attempts, sessions that expire.\u003C/li>\n\u003Cli>\u003Cstrong>Protocols\u003C/strong>: connection handling and message sequences. TCP, as described in RFC 9293, has eleven connection states, from LISTEN and SYN-SENT to TIME-WAIT and CLOSED.\u003C/li>\n\u003Cli>\u003Cstrong>Workflows\u003C/strong>: life cycles of documents, orders, tickets and \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"defect-report\">defect reports\u003C/span>. The states of a defect report are described in the article \u003Ca href=\"/en/wiki/test-management/defect-report\" class=\"wiki-link wiki-link--article\">Defect report\u003C/a>.\u003C/li>\n\u003Cli>\u003Cstrong>Embedded and control software\u003C/strong>: devices with operating modes, where an event allowed in one mode is dangerous in another.\u003C/li>\n\u003C/ul>\n\u003Cp>The model has to stay small enough to review. When the number of states grows, the model is split by concern or built with nested states. When the states hide many combinations of conditions, a decision table is used for each state.\u003C/p>\n\u003Ch2 id=\"state-transition-testing-and-related-techniques\" class=\"wiki-heading\">State transition testing and related techniques\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"state-transition-testing-and-related-techniques\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cp>State transition testing is often confused with techniques that also produce paths or rules. The table compares them.\u003C/p>\n\u003Cdiv class=\"wiki-table wiki-table--cols-4\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Technique\u003C/th>\n\u003Cth>What the model describes\u003C/th>\n\u003Cth>Coverage items\u003C/th>\n\u003Cth>Strength\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>State transition testing\u003C/td>\n\u003Ctd>States, events and transitions\u003C/td>\n\u003Ctd>States, transitions, N-switches\u003C/td>\n\u003Ctd>Order of events, invalid events\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Decision table testing\u003C/td>\n\u003Ctd>Combinations of conditions and actions\u003C/td>\n\u003Ctd>Feasible columns of the table\u003C/td>\n\u003Ctd>Complex rules for one input\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Use case testing\u003C/td>\n\u003Ctd>Interactions of an actor with the system\u003C/td>\n\u003Ctd>Main and alternative scenarios\u003C/td>\n\u003Ctd>End-to-end user goals\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Equivalence partitioning\u003C/td>\n\u003Ctd>Partitions of input values\u003C/td>\n\u003Ctd>Partitions\u003C/td>\n\u003Ctd>Choice of values\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Cp>A decision table describes one reaction to a combination of conditions; a state model describes how reactions change over time. They are often used together: the guard conditions of a transition with several conditions are expanded into a decision table, described in \u003Ca href=\"/en/wiki/test-design/decision-table-testing\" class=\"wiki-link wiki-link--article\">decision table testing\u003C/a>.\u003C/p>\n\u003Cp>A \u003Cspan class=\"wiki-term\" tabindex=\"0\" data-wiki-term=\"use-case\">use case\u003C/span> also describes a sequence, but from the point of view of the actor and the goal, not of the object and its states. One use case, such as &quot;buy a product&quot;, can pass through several states of the order. \u003Ca href=\"/en/wiki/test-design/use-case-testing\" class=\"wiki-link wiki-link--article\">Use case testing\u003C/a> checks that the goal is reached on each scenario; state transition testing checks that the object reacts correctly to every event in every state, including events the scenarios never send.\u003C/p>\n\u003Ch2 id=\"terms\" class=\"wiki-heading\">Terms\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"terms\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cdiv class=\"wiki-table wiki-table--cols-2\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Term\u003C/th>\n\u003Cth>Meaning\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>State transition testing\u003C/td>\n\u003Ctd>Black-box test technique in which test cases are designed to exercise elements of a state transition model\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>State diagram\u003C/td>\n\u003Ctd>Diagram of the states of an object and the valid transitions between them\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>State table\u003C/td>\n\u003Ctd>Table of states and events whose cells hold target states and actions; empty cells are invalid transitions\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Guard condition\u003C/td>\n\u003Ctd>Condition that must be true for an event to cause a transition\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Invalid transition\u003C/td>\n\u003Ctd>Event that arrives in a state where the model does not allow it\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Valid transitions coverage\u003C/td>\n\u003Ctd>Share of valid transitions exercised by the tests; also called 0-switch coverage\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>All transitions coverage\u003C/td>\n\u003Ctd>Share of valid and invalid transitions of the state table exercised or attempted by the tests\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>N-switch coverage\u003C/td>\n\u003Ctd>Coverage of sequences of N+1 consecutive valid transitions\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Round trip\u003C/td>\n\u003Ctd>Loop that starts and ends in the same state, with no other state occurring twice\u003C/td>\n\u003C/tr>\n\u003C/tbody>\n\u003C/table>\u003C/div>\n\u003Ch2 id=\"sources\" class=\"wiki-heading\">Sources\u003Cbutton type=\"button\" class=\"wiki-heading__anchor\" data-wiki-anchor=\"sources\" aria-label=\"Copy link to section\" data-copied-label=\"Link to section copied\">\u003Csvg class=\"wiki-heading__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z\"/>\u003C/svg>\u003Csvg class=\"wiki-heading__icon wiki-heading__icon--done\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z\"/>\u003C/svg>\u003C/button>\u003C/h2>\n\u003Cul>\n\u003Cli>\u003Ca href=\"https://www.istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf\" target=\"_blank\" rel=\"noopener\" class=\"wiki-link wiki-link--external\">ISTQB Certified Tester Foundation Level Syllabus v4.0.1, ISTQB, 2024\u003Csvg class=\"wiki-link__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z\"/>\u003C/svg>\u003Cspan class=\"wiki-visually-hidden\">(opens in a new tab)\u003C/span>\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://www.istqb.org/wp-content/uploads/sdm-uploads/ISTQB-CTAL-TA-Syllabus-v4.0-EN-4.pdf\" target=\"_blank\" rel=\"noopener\" class=\"wiki-link wiki-link--external\">ISTQB Certified Tester Advanced Level Test Analyst Syllabus v4.0, ISTQB, 2025\u003Csvg class=\"wiki-link__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z\"/>\u003C/svg>\u003Cspan class=\"wiki-visually-hidden\">(opens in a new tab)\u003C/span>\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://glossary.istqb.org/\" target=\"_blank\" rel=\"noopener\" class=\"wiki-link wiki-link--external\">ISTQB Glossary\u003Csvg class=\"wiki-link__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z\"/>\u003C/svg>\u003Cspan class=\"wiki-visually-hidden\">(opens in a new tab)\u003C/span>\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://www.iso.org/standard/79430.html\" target=\"_blank\" rel=\"noopener\" class=\"wiki-link wiki-link--external\">ISO/IEC/IEEE 29119-4:2021, Software and systems engineering, Software testing, Part 4: Test techniques\u003Csvg class=\"wiki-link__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z\"/>\u003C/svg>\u003Cspan class=\"wiki-visually-hidden\">(opens in a new tab)\u003C/span>\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://doi.org/10.1109/TSE.1978.231496\" target=\"_blank\" rel=\"noopener\" class=\"wiki-link wiki-link--external\">Testing Software Design Modeled by Finite-State Machines, T. S. Chow, IEEE Transactions on Software Engineering, vol. SE-4, no. 3, 1978\u003Csvg class=\"wiki-link__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z\"/>\u003C/svg>\u003Cspan class=\"wiki-visually-hidden\">(opens in a new tab)\u003C/span>\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://doi.org/10.1016/0167-6423%2887%2990035-9\" target=\"_blank\" rel=\"noopener\" class=\"wiki-link wiki-link--external\">Statecharts: a visual formalism for complex systems, D. Harel, Science of Computer Programming, vol. 8, no. 3, 1987\u003Csvg class=\"wiki-link__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z\"/>\u003C/svg>\u003Cspan class=\"wiki-visually-hidden\">(opens in a new tab)\u003C/span>\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://www.rfc-editor.org/rfc/rfc9293.html\" target=\"_blank\" rel=\"noopener\" class=\"wiki-link wiki-link--external\">RFC 9293, Transmission Control Protocol (TCP), IETF, August 2022\u003Csvg class=\"wiki-link__icon\" viewBox=\"0 0 256 256\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\u003Cpath d=\"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z\"/>\u003C/svg>\u003Cspan class=\"wiki-visually-hidden\">(opens in a new tab)\u003C/span>\u003C/a>\u003C/li>\n\u003C/ul>\n",[10,14,17,20,23,27,30,33,36,39,42,45,48,51,54,57],{"id":11,"level":12,"text":13},"the-problem-state-transition-testing-solves",2,"The problem state transition testing solves",{"id":15,"level":12,"text":16},"elements-of-a-state-model","Elements of a state model",{"id":18,"level":12,"text":19},"state-diagram","State diagram",{"id":21,"level":12,"text":22},"state-table","State table",{"id":24,"level":25,"text":26},"invalid-transitions",3,"Invalid transitions",{"id":28,"level":12,"text":29},"coverage-criteria","Coverage criteria",{"id":31,"level":25,"text":32},"all-states-coverage","All states coverage",{"id":34,"level":25,"text":35},"valid-transitions-coverage","Valid transitions coverage",{"id":37,"level":25,"text":38},"all-transitions-coverage","All transitions coverage",{"id":40,"level":25,"text":41},"n-switch-coverage","N-switch coverage",{"id":43,"level":12,"text":44},"test-cases-for-the-order-example","Test cases for the order example",{"id":46,"level":12,"text":47},"visualizing-the-flow","Visualizing the flow",{"id":49,"level":12,"text":50},"where-the-technique-applies","Where the technique applies",{"id":52,"level":12,"text":53},"state-transition-testing-and-related-techniques","State transition testing and related techniques",{"id":55,"level":12,"text":56},"terms","Terms",{"id":58,"level":12,"text":59},"sources","Sources",2484,1793718881752]