Modeling System States: State-Transition Diagrams and State Tables
Showing the various states a system could be in and how it can change states is a valuable technique for analysis, design, and testing.
One of my consulting clients asked me to review a large requirements specification for a complex machine they were designing. This specification included a long table that described various states the machine could be in at any given time and the behaviors it should exhibit under certain conditions. I could understand the large quantity of text in this table, but it was hard to tell if the summary of system state behavior was complete and accurate.
To test that, I tried an alternative analysis approach. I drew a state-transition diagram — just boxes and arrows — based on the information in the table to show the various states and the allowed changes between them. In this way, I discovered two missing requirements, specific combinations of states and actions that did not have a defined outcome. It was difficult to find those errors by reviewing this bulky textual table, but the picture revealed them immediately.
Software systems involve a combination of functional behavior, data manipulation, and state changes. Real-time systems can exist in one of a limited…