我是一名学生,我必须做一个项目。我想从用户故事中生成用例和类图。有什么建议可以这样做。我已经使用了纸莎草插件,但它不能帮助我。它只是将 Java 代码反转为类图
2 回答
Converting a user story into a use case is not something that a tool will help you do, it is, however, something that a tool, like Papyrus and many others, will help you represent and that provides you with graphical elements to extract and visualize structure and behaviour from your analysis of the problem. Tools are, well, tools, not a panacea to your problems as they will not think for you.
Simply stated...
A user story is typically "As a user, I want to do something so I can have a result/benefit.
A use case (which is really textual, BTW) is typically: precondition, actions and responses, post-conditions, alternate scenarios, etc.
In UML, the user becomes an actor and the __do something_ becomes your use case. The result/benefit represents the goal/success factor for your use case (and, in some way, post-conditions). Pre- and post-conditions are constraints. actions and responses can be expressed as interactions (sequence diagrams), activities, and state machines.
From this point on, you have to start thinking about how you will implement this and there are many techniques that can do this (functional decomposition, behavioural decomposition, mapping to patterns such as MVC, etc.). Which one you use will depend on your background, domain or expertise, preference, etc.
阅读您的评论后,我更改了答案。
看看Enterprise Architect。不做那种“魔术”,但仍然有许多工具和图表可以捕获软件分析/设计过程中的大多数步骤。您可以下载免费试用版。