0

uml activity diagram

Context: This is from a practice exam, and we aren't sure what the proper answer was

Question: What is a possible order of actions for this activity diagram?

Options:

  • A->B->D or A->B->C->D

  • A->B->C->D or A->B->C->D->E

  • A->B->C->D->E or C->A->B->E

  • A->B->C->D or C->A->B->E

  • Diagram is illegal

The first bar is called a FORK (where the flows after it happen simultaneously), the second bar is called a JOIN (where the flows join/sync up together) There is inconsistent behavior, C would need to happen at the same time as A->B->D or A->B->E and neither are options in the question.

A fellow student argues that it would be the 4th option because C just needs to happen at some point in the sequence (before the join).

What option do you think is right?

1
  • This is more of a constructive question about understanding activity diagrams and forks, joins, (merges were out of the scope of the class)... I'm more curious about how to approach it properly than the actual answer. Commented Jul 12, 2023 at 10:21

2 Answers 2

2

In an exam setting with a multiple-choice question like that, where you don't immediately see what the right answer must be, you go into elimination mode: Strike off the answer options that are (clearly) wrong, and hopefully you are left with one option that is the least wrong or could actually be right.

In this case,

  • the diagram is valid, so that removes option 5.
  • a choice must be made between D and E, so any sequence that includes both must be wrong. That eliminates options 2 and 3.
  • option 1 has a proposed execution order that doesn't include C, which also is inconsistent with the diagram. So, strike option 1.
  • option 4 shows 2 valid orderings out of a much larger set of possible orderings. While that makes the option look incomplete, it is not wrong either. Given the set of options, this is the least wrong one and therefor most likely the one you are expected to give.
6
  • What would make it invalid? Commented Jul 13, 2023 at 4:44
  • 1
    @AP, omitting the JOIN node from the diagram would make it invalid and using a shape that doesn't have a defined meaning for an activity diagram as well. Commented Jul 13, 2023 at 7:02
  • 1
    Each answer has two options that are OR-ed. Strictly speaking answer 1 cannot be eliminated because one of the options, A->B->C->D , is possible. The beauty of OR - you do not have to be totally right to be correct. ..... Either the instructor is throwing the class a crafty curve - multiple correct answers, OR, a class in flow/processing logic neglected to teach fundamental boolean algebra needed for understanding activity diagrams. Commented Jul 13, 2023 at 22:28
  • 1
    @radarbob, by that reasoning, options 2 and 3 can't be eliminated either, because there is a valid ordering on one side of the OR. I don't think it is intended to interpret the use of "or" strictly according to boolean algebra. Commented Jul 14, 2023 at 6:25
  • @BartvanIngenSchenau if they had a MERGE instead of join, would it have changed anything? Commented Jul 14, 2023 at 13:06
2

they are all wrong

"Forks are used to split an incoming transition into concurrent multiple transitions"

so the answer is:

parallel(A->B->(D or E), C)

Hopefully you have a quantum computer to make sure concurrency is strictly obeyed!

4
  • so it's not illegal? Commented Jul 12, 2023 at 12:32
  • 1
    no the diagram is fine, it just doesn't make sense to ask what order the individual tasks run in across forks Commented Jul 12, 2023 at 12:40
  • 1
    The question is what is possible not what are all possible. With UML exams you need to be careful with those meanings. So in this case you have to eliminate all incorrect flows (i.e. answer options containing them) and if all flows in an answer option are possible within this flow (even if it doesn't cover all possibilities that can be achieved as a result of the diagram), the answer is correct. Commented Jul 13, 2023 at 11:36
  • arguable, and obviously if you get the question in an exam you have to choose an option. But that doesnt mean the question cant be badly phrased Commented Jul 14, 2023 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.