DOC PREVIEW
UNI CS 1520 - Fundamentals of Python

This preview shows page 1-2-3-23-24-25-26-47-48-49 out of 49 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 49 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Fundamentals of Python: From First Programs Through Data StructuresObjectivesObjectives (continued)IntroductionSoftware Design with UMLUML and ModelingUse Case DiagramsUse Case Diagrams (continued)Slide 9Slide 10Class DiagramsClass Diagrams (continued)Slide 13Slide 14Slide 15Collaboration DiagramsCollaboration Diagrams (continued)From Collaboration Diagram to CodeFrom Collaboration Diagram to Code (continued)InheritanceDocumentationWriting APIsWriting APIs (continued)Revisiting the Student ClassRevisiting the Student Class (continued)Slide 26Preconditions and PostconditionsPreconditions and Postconditions (continued)Enforcing Preconditions with ExceptionsEnforcing Preconditions with Exceptions (continued)Web-Based Documentation with pydocWeb-Based Documentation with pydoc (continued)TestingWhat to TestThree Approaches to Choosing Test DataThree Approaches to Choosing Test Data (continued)When to TestProofs of Program CorrectnessUnit Testing in PythonUnit Testing in Python (continued)Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46SummarySummary (continued)Slide 49Fundamentals of Python:From First Programs Through Data Structures Chapter 12Tools for Design, Documentation, and TestingFundamentals of Python: From First Programs Through Data Structures 2ObjectivesAfter completing this chapter, you will be able to:•Write scenarios and use cases for the analysis phase of a simple software system•Design a simple software system in which the classes have the relationships of aggregation, composition, and inheritance•Use UML diagrams to depict use cases, relationships among classes, and collaborations among objects in a simple software systemFundamentals of Python: From First Programs Through Data Structures 3Objectives (continued)•Write preconditions and postconditions for methods•Raise exceptions in methods when preconditions are violated•Generate Web-based documentation of classes•Write simple unit tests for classesFundamentals of Python: From First Programs Through Data Structures 4Introduction•A program must be well designed, thoroughly documented, and carefully tested–A good design is essential to solving any complex problem–Well-designed and well-written code is, to a certain extent, self-documenting–No matter how carefully you design and document a program, you need to test it with equal care•Computer Assisted Software Engineering (CASE) tools include debuggers, version trackers, profilers, and test bedsFundamentals of Python: From First Programs Through Data Structures 5Software Design with UML•Programmers use various graphical notations to represent analysis and design decisions•UML: Unified Modeling Language–Dominant graphical scheme currently used in object-oriented software development•An excellent and free UML authoring tool is available at http://argouml.tigris.org/Fundamentals of Python: From First Programs Through Data Structures 6UML and Modeling•UML diagrams come in handy during the initial phases of software development–Help programmer visualize, or model, the interactions of human users with proposed system, relationships among its classes, and interactions among its objects•UML includes diagrams for almost any occasion–For example:•Class diagrams•Use case diagrams•Collaboration diagramsFundamentals of Python: From First Programs Through Data Structures 7Use Case Diagrams•A use case is a narrative, in English, of the steps a user takes to perform a single actionFundamentals of Python: From First Programs Through Data Structures 8Use Case Diagrams (continued)•Use cases should include narratives of exceptional conditions and corresponding responsesFundamentals of Python: From First Programs Through Data Structures 9Use Case Diagrams (continued)•Use case diagrams in UML translate narratives of use cases into a pictorial representationFundamentals of Python: From First Programs Through Data Structures 10Use Case Diagrams (continued)•Use cases and use case diagrams enable the programmer to accomplish several things:–Result in a precise statement of the functional requirements of the software system, in other words, the “what it does,” from the users’ perspective–Serve as the basis for writing user documentation, in the form of manuals and online help systems for the software–Allow the programmer to determine which classes need to be chosen or developed to realize the requirements of the systemFundamentals of Python: From First Programs Through Data Structures 11Class Diagrams•During the discovery of classes for a system, their relationships can be modeled with class diagrams–The simplest such diagrams show a relationship of association between two classesFundamentals of Python: From First Programs Through Data Structures 12Class Diagrams (continued)•Associations do not tell us how classes are related–Programmer can also specify a role that a class plays in relation to anotherFundamentals of Python: From First Programs Through Data Structures 13Class Diagrams (continued)Fundamentals of Python: From First Programs Through Data Structures 14Class Diagrams (continued)Fundamentals of Python: From First Programs Through Data Structures 15Class Diagrams (continued)•The arrows representing directed associations can be dropped in favor of using edges with markers that indicate aggregation or compositionFundamentals of Python: From First Programs Through Data Structures 16Collaboration Diagrams•The attributes and operations of a given class are often designed to fit into a sequence of operations that perform a particular task–The actors in these scenarios are software objects or instances of the system’s classes–A system function or task is broken down into a set of method calls on objects, and coordinating these becomes the focus of design•The interactions among objects can be documented in a collaboration diagramFundamentals of Python: From First Programs Through Data Structures 17Collaboration Diagrams (continued)Fundamentals of Python: From First Programs Through Data Structures 18From Collaboration Diagram to CodeFundamentals of Python: From First Programs Through Data Structures 19From Collaboration Diagram to Code (continued)Fundamentals of Python: From First Programs Through Data Structures 20Inheritance•Subclassing helps eliminate redundant code in similar classes•Inheritance relationship between classes is shown with an outlined arrowhead in a class diagramFundamentals of Python:


View Full Document

UNI CS 1520 - Fundamentals of Python

Download Fundamentals of Python
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Fundamentals of Python and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Fundamentals of Python 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?