1 / 10

Magnets + magnetic disks = …

Magnets + magnetic disks = …. GTD. GTD Workflow & Processing. GTD Website. http://SlideShare.net GTD Workshop. Interview with David Allen. Overview. More OOP Composition Inheritance Overriding Unit testing. Composition.

taylor
Download Presentation

Magnets + magnetic disks = …

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. Magnets + magnetic disks = …

  2. GTD GTD Workflow & Processing GTD Website http://SlideShare.net GTD Workshop Interview with David Allen

  3. Overview More OOP • Composition • Inheritance • Overriding Unit testing

  4. Composition One object is composed of other objects (e.g. Car is composed of an engine, etc.)

  5. Inheritance • Models “type-of” relationships between classes • Promotes code re-use Base class Superclass Parent class Animal formalName : str poop() : None Dog name : str bark() : None Cat name : str scratch() : None Derived classes Subclasses Child classes Cow moo() : None

  6. Overriding • Method in base/super/parent class is overridden by derived/sub/child class Base class Superclass Parent class Animal formalName : str poop() : None Dog name : str bark() : None poop() : None Cat name : str scratch() : None Derived classes Subclasses Child classes Cow moo() : None

  7. Class under test Unit Testing AAA Pattern for Unit Testing - Arrange all necessary preconditions and inputs. - Act on the object or method under test. - Assert that the expected results have occurred. Test class The unittest module contains a unit testingframework: classes andmethods to facilitatetesting.

  8. Inheritance and Python unittest unittest.TestCase Dice DiceTest

  9. Some more unittest details Special methods in the test class • setUp() – run before each method • tearDown() – run after each method

  10. Kulula airlines

More Related