Use cases for color guessing game

Asked

Viewed 44 times

1

In order to practice APOO I am trying to apply use cases to a simple game of guessing a color.

Here it would be it visually. The user can try to guess as many times as he wants, or restart the game by clicking on "Reset".

Adivinhe a cor

Although simple, it seems to fit three use cases here:

Start game

  1. Game secretly chooses a random color from three available.
  2. Game displays neutral color (gray).

Play game

Precondition: game started

  1. Player chooses one color from three available.
  2. Game displays chosen color.
  3. If color equal to hidden, informs that the player has won.
  4. If different color from hidden, informs that the player has lost.
  5. Player can repeat the move (step 1) as many times as he wants.

Restart

  1. Player requests start of new game.
  2. Use case Start Game becomes available.

I have three questions:

  • Use cases are well (correctly) defined?

  • Player is an actor (external to the system); game is also an actor? As the use case diagram in this case (would be an actor within the limits of the system, for example)?

  • In Restart, another use case is called. Actually this use case needs to be called every time the application starts. How do I represent this in the use case diagram? Or is this not correct (it should only be a precondition, for example)?

1 answer

0


  1. No, they are not well defined. The system should not be his own actor. The player makes sense to be an actor and their two use cases are correct, bring something of value to the same: play game and restart game.

  2. and 3. The use case starting game makes no sense. It should be a Constraint (a precondition) of the other two use cases.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.