20145105 "Java Programming" experiment Two summary

Source: Internet
Author: User

Experiment Two Java Object-Oriented programming

First, the contents of the experiment:

    1. Initial mastery of unit testing and TDD
    2. Understanding and mastering object-oriented three elements: encapsulation, polymorphism, modeling
    3. Initial mastery of UML
    4. Familiarity with S.O.L.I.D principles
    5. Understanding Design Patterns

Second, the experimental steps

(a) Unit testing

    1. Three kinds of code: pseudo-code, product code, test code

(1) Pseudo-code

(2) Product Code

(3) test code

(4) Error after test result

(5) Making changes

(6) Test error

    1. TDD (Test driven development, testing-driven development)

(1) New project, New test catalog, new test Case class

(2) Adding test cases (@Test)

(3) Create a new Myutil class in src to implement the method in the test case

(4) Testing, failure to pass

(5) Modify the Myutil class

(6) test again, by

(ii) Object-oriented three elements

    1. Abstraction: Process abstraction, Data abstraction

(1) Process abstraction example (minor changes made)

    1. Encapsulation, inheritance, and polymorphism

(1) Encapsulation of classes in Java, such as the Dog class

(2) test code and results

(3) Creating a class diagram of the dog class in UML

(4) Emulate the dog class to implement Cat class

(5)

Not to be continued!!!

20145105 "Java Programming" experiment Two summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.