CHAPTER 7

Testing with Objects

images

In This Chapter

  • Modeling objects and links
  • Comparing the Class and Object diagrams
  • Testing the Class diagram with Object diagrams
  • Modeling the Composite Structure diagram
  • Modeling collaborations and collaboration occurrences

images

The Object diagram provides the means to explore specific facts. The Class diagram models definitions and rules. The contrast of these two diagrams is a great benefit to modelers. Most often we talk about a problem using concepts and general rules about how things work. When there is a dispute over the interpretation of a concept or a rule, we often apply examples, specific data, and circumstances that either prove or disprove our interpretation. The Object diagram is the UML tool for modeling an example.

Throughout a project we want to verify that what we have modeled is accurate. Verification requires test cases that exercise the definitions and rules we've captured in our Class diagram. Modeling a test case requires the means to represent specific data, relationships, and behaviors. The Object diagram is ideally suited to model the data and relationships of the test cases, while the Interaction diagrams model the behavior. Interaction diagrams (covered in Chapters 8 through 10) describe how objects use one another's services. ...

Get UML™ Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.