Software Development and Project Management

In UML, which diagram is suitable for showing how the state of an object changes in response to events (a button press, a timer expiring, a temperature being reached and so on), as in the control software of a rice cooker?

  1. AClass diagram
  2. BUse case diagram
  3. CState machine diagram
Show answer and explanation

Answer: C. State machine diagram

A state machine diagram (state transition diagram) shows the possible states, which event causes a move to which state (a transition), and the actions taken at that time. It is often used to design software whose behavior depends on its current state even for the same input, as in the control of embedded devices. A class diagram shows the static structure of classes, their attributes and operations, and the relationships between classes. A use case diagram shows the functions of the system as seen by its users (actors).

  • A. This diagram shows the static structure of classes, their attributes and operations, and their relationships; it does not show changes of state.
  • B. This diagram shows the relationships between users (actors) and the functions of the system (use cases).
  • C. Correct. It shows states and the transitions between them caused by events.
Practice this topic Back to topic

Related calculators

Books on Software Development and Project Management Ad

As an Amazon Associate I earn from qualifying purchases.

More Software Development and Project Management questions

  1. In UML, which diagram shows the messages (calls and replies) exchanged between several objects in time order from top to bottom?
  2. Among the levels of module strength (cohesion) used to evaluate module independence, which has the highest strength and is considered most desirable?
  3. Among the types of coupling between modules, which is the weakest and gives the highest module independence?
  4. Which GoF design pattern makes the objects that depend on an object be notified automatically when that object's state changes?
  5. When a static analysis tool is used on firmware source code, which problem is it best suited to finding without running the program?