1 / 24

619 Final Review

619 Final Review. Last updated Fall 2012. Paul Ammann. Agenda. Review Topics Covered Highlight Key Technical Concepts Identify Areas for Study on Final Final May Test Several Concepts in a Given Question Goal: Strong Showing on Final. Procedural Abstractions (Liskov 1-3). Specifications

mary-beard
Télécharger la présentation

619 Final Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 619 Final Review Last updated Fall 2012 Paul Ammann

  2. Agenda • Review Topics Covered • Highlight Key Technical Concepts • Identify Areas for Study on Final • Final May Test Several Concepts in a Given Question • Goal: • Strong Showing on Final

  3. Procedural Abstractions (Liskov 1-3) • Specifications • Preconditions (Requires Clause) • Postconditions (Effects Clause) • Modifies Clause • You Can Read and Write Such Specifications • Issues: • Minimality • Underdetermined Behavior • Deterministic Implementations • Generality

  4. Exceptions (Liskov 4, Bloch 9) • Rationale for Exceptions • Total vs. Partial Specifications • Replacing Preconditions with Defined Behavior • Role of “FailureException” • Specifications Include Exception Returns • Checked vs. Unchecked Exceptions • Bloch’s List of Standard Exceptions • Masking vs. Reflection

  5. Data Abstraction (Liskov 5) • Fundamental Topic • Expect Significant Exam Coverage • Specifications for: • Overview (Typical “Object”) • Abstraction Function (toString()) • Representation Invariant (repOk()) • Methods • You Can Expect to Write/Modify Some or All of These • Understanding, not Formality, is the Focus

  6. More Data Abstraction (Liskov 5) • IntSet and Poly Examples • Mutability • Reasoning about Data Abstractions • Role of Abstraction Function • Value of Abstraction Function in Specific Examples • Role of Representation Invariant • Value of Representation Invariant in Specific Examples • How to Argue a that Method Meets its Contract • Other Issues • Exposing the Rep • Adequacy

  7. Iteration Abstraction (Liskov 6) • Specifying Iterators • Preconditions and Postconditions • Constraints on Modifications While Generator is in Use • Implementing Iterators in Java • Abstraction Functions for Iterators • Value of Abstraction Function in Specific Examples • Abstraction Function For Extensions • Allowing a prev() as well as a next() method • Allowing a remove() method

  8. Type Hierarchy (Liskov 7) • Fundamental Topic • Substitution Principle • Uses of Type Hierarchy • Extending Behavior vs. Multiple Implementations • Mechanisms • Extensions, Abstract Classes, Interfaces • Understanding Overriding vs. Overloading • Dynamic Dispatching • Apparent Type vs. Actual Type

  9. Type Hierarchy (Liskov 7) • Reasoning About Subtypes • Signature Rule • Rules for Exceptions • Methods Rule • Preconditions/Postconditions • More Rules for Exceptions • Properties Rule

  10. Polymorphic Abstraction (Liskov 8) • Element Subtype vs. Related Subtype • Comparable vs Comparator • Addable vs. Adder • Be Prepared to Analyze and/or Complete an Implementation

  11. Specifications (Liskov 9) • Specificand Sets • Generality vs. Restrictiveness • Redundancy • Definitions • Examples • Relevance to Type Abstraction Methods Rule

  12. Design Patterns (Liskov 15) • Introduction to Design Patterns • Characterization of Patterns • Name • Problem • Solution • Consequences • Example Patterns • Factory, Singleton, Bridge, Decorator, Command, Iterator, State, Template

  13. Creating and Destroying Objects (Bloch 2) • Static Factories • Builders vs. Parameterized Constructors • Singletons • Noninstantiability • Unnecessary Object Creation • Eliminate Obsolete References

  14. Methods Common to All Objects (Bloch 3) • equals() • Transitivity, Symmetry, Substitution for Subtypes • hashcode() • Consistency with equals() • toString() • clone() • Why is Liskov’s clone() (page 97) wrong? • Comparable

  15. Classes and Interfaces (Bloch 4) • Immutability • Why it is Preferable • How to Achieve • Composition vs. Inheritance • Why is Composition Preferable? • Potential Problems for Inheritance • Mechanisms to Prohibit Inheritance

  16. Generics (Bloch 5) • Replacing raw types with generics • Eliminating unchecked warnings • Generic interactions with Lists vs. Arrays • Covariant Arrays vs. Invariant Generics • Generifying types and methods • Bounded wildcards • Relaxing the invariance of generics

  17. Enums and Annotations (Bloch 6) • Using enums instead of int constants • Using instance fields instead of ordinals • Use EnumSet instead of bit fields • Use EnumMap instead of ordinal indexing • Emulate extensible enums with interfaces • Prefer annotations to naming patterns • Consistently use Override annotation • Use marker interfaces to define types

  18. Methods (Bloch 7) • Parameter validity • Defensive copies • Method signature design • Being careful with overloading • Varargs • Empty arrays/collections vs. null returns • JavaDoc for exposed API

  19. General Programming (Bloch 8) • Variable Scope • For-each contructs • Library usage, primitives vs. boxed • Strings vs. appropriate types • Interface usage • Beware pointless optimization • Naming conventions

  20. Concurrency (Bloch 10) • Simple Thread Interactions • Shared Access to Mutable Data • Synchronized Methods • Possible Executions in the Absence of Synchronization • Roles for wait() and notify() • Bloch’s Alien Method Examples

  21. Specification Checking • Specifications for Common Properties • Temporal Logic for Specification • Computational Tree Logic (CTL) • Linear Temporal Logic (LTL) • Simple Specification Patterns • Kansas State University material • Links on course schedule • Huth and Ryan is also a excellent source

  22. Secure Programming • Introduction to Secure Implementation • What is software NOT supposed to do? • Bugs • Misuse Cases • Vulnerabilities/Exploits • You need to think about the bad guy! • Most vulnerabilities are simple mistakes • YOUR software can be better

  23. Special Topics • JUnit • What is JUnit • How to use JUnit • How to write tests in JUnit • Contract model and JUnit Theories • How to extract basic tests from a contract • Cover each exceptional condition • Cover “normal” behavior • May require several tests

  24. Wrap Up • Final Exam • Closed Book/Closed Notes • But One (1) 8.5x11 sheet of paper, handwritten • Covered Material • Liskov: Chapters 1-9; 15 • Bloch: Chapters 2-10 • Plus special topics • Temporal Logic, Advanced JUnit, Security • Questions?

More Related