Experiment Two Java Object-Oriented programming
First, the contents of the experiment:
- Initial mastery of unit testing and TDD
- Understanding and mastering object-oriented three elements: encapsulation, polymorphism, modeling
- Initial mastery of UML
- Familiarity with S.O.L.I.D principles
- Understanding Design Patterns
Second, the experimental steps
(a) Unit testing
- 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
- 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
- Abstraction: Process abstraction, Data abstraction
(1) Process abstraction example (minor changes made)
- 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