Though UML notation is widely recognized as lingua franca for software development, many developers still lack skills for applying it efficiently. Methodologists, practitioners and tool vendors need to share their experience in order to find out ways how to get the most use from modeling and avoid abusing it. With this whitepaper, we start a series of best practices in applying UML that are driven from No Magic expertise in multiple software development projects and buildingMagicDraw tool. We hope that they will help you to change the way you model and make it more efficient!
Software Development and Modeling with UML
Modeling is the core of modern software development. Like every larger engineering task, software development needs a plan. Models serve us as a plan and allow achieving multiple goals:
- Provide structure for problem solving;
- Experiment to explore multiple solutions;
- Furnish abstractions to manage complexity;
- Reduce time-to-market for business problem solutions;
- Decrease development costs;
- Manage the risk of mistakes.
Only when developing very small systems, we may start from scratch and bypass modeling.
You DON’T need modeling: Small one-person projects that do not need to be maintained and will not be transferred to somebody else might not require modeling.
You DO need modeling: Large projects that involve large teams, are developed iteratively, and need to be maintained cannot be successful with out models.
In large projects modeling speeds up implementation while elevating quality and user satisfaction. We model in all software development activities starting from business analysis and requirements definition to testing of the constructed software system.
Software systems are constantly growing in size and complexity, and without efficient modeling skills you cannot be successful. A Software Development Magazine Salary Survey in 2005 has revealed that the most important skills needed to produce quality projects and products are architecture modeling and design, which ranked higher than programming, QA, testing, and requirements management.
Recently, we witness intense battles in the field of the software development process. While almost all approaches have gone from the old waterfall approach to iterative development, they argue a lot about formality, roles, activities and artifacts, tools, and which workflows should be emphasized.
Since modeling is the core of development and UML is the de facto standard as the modeling notation, all of those
processes make use of UML. However, the way they use it differs quite a lot. RUP advocates a UML centric approach to software design, which requires UML modeling tools. Agile methods – XP, Scrum, Lean – advocate informal modeling and using whiteboards, paper, and simple text or drawing editors as a compliment to UML tools. While we are in none of these camps, we strongly believe that using modeling tool can help you a lot.
Here is just a short list of helpful UML tool features:
- Create and maintain a repository of model data;
- Reuse model elements in multiple diagrams;
- Create nice diagrams using automated layout functions;
- Apply built in design patterns;
- Use automated model transformations;
- Generate documentation from your model;
- Analyze your model using automated tools;
- Enable teamwork within one modeling project.
Experience is the worst teacher – it always gives the test first and the instructions afterward.
Let’s get some instructions before you apply UML in your projects – you can count on our experience, which resulted in the best practices presented below.
Best Practice #1: Apply a subset of UML relevant to your role
80%–20% rule: 80% of the users apply only 20% of the features.
Table 2 – Applicability of UML Modeling Skills
Business analysts will mostly apply use case and activity diagrams for capturing processes and requirements, also very simple class diagrams for domain analysis and state diagrams for defining lifecycle of important business objects. They will need extensions of UML for modeling enterprise architecture concepts like organizational structure or business goals.
Software architects will apply all UML diagrams, but they would not go into implementation details. Architects need to capture overall system structure in high level concepts. In most cases, they will be fine with package, component, and deployment diagrams; and will model only the most important classes and interactions. When building classical layered systems, they might use the robustness diagram – a simple extension of the UML class diagram – for identifying major components in interfaces, business logic, and data layers.
Developers will not model all parts of the system, but they would go into low level implementation details on the most important system parts, e.g. data structures. They use detailed class and interaction diagrams. Most probably, they will also need UML extensions for capturing technology specific details like relational database structures or XML schema elements.
Quality assurance engineers need to analyze UML diagrams prepared by business and system analysts, and base their test cases on use case workflows. They will need object diagrams for modeling test data and activity diagrams for modeling test action flows and rules. For those who do more technical testing like unit testing (though in the most of recent approaches it is done by programmers), stress or load testing might need to model interactions using either sequence or activity diagrams.
The lesson learned: You don’t need to know and use the complete UML specification. Learn and apply only the subset that is relevant to your role!
This is the first part of the Best Practices for Applying UML article. Follow this link for the second part.