Experimental content 1. Initial mastery of unit testing and TDD2. Understand and master the object-oriented three elements: encapsulation, inheritance, polymorphism 3. Initial mastery of UML modeling 4. Familiarity with S.O.L.I.D principles 5. Understanding Design Patterns
(a) Unit test (1) three codes
(2) TDD (test driven devlopment, testing-driven development)
(ii) Object-oriented three elements (1) abstract
Use loop structure to simplify code (not coded here)
(2) encapsulation, inheritance and polymorphism
(iii) design pattern preliminary (1) S.O.L.I.D principle
- SRP (Single Responsibility Principle, sole responsibility principle)
- OCP (open-closed Principle, open-closed principle) ———— software entities (classes, modules, functions, etc.) should be open to expansion, closed to modifications.
- means realization: (1) Abstraction and Inheritance (2) interface-oriented programming
- LSP (Liskov substitusion Principle,liskov substitution principle)
- ISP (Interface segregation Principle, interface separation principle)
- DIP (Dependency inversion Principle, dependency inversion principle)
(2) Pattern and Design pattern (3) Example of design pattern
IV) Exercise 1 using TDD to design the complex to implement the plural class.
2. Experiment report to count your PSPTime
Steps |
Time Consuming |
percentage |
Demand analysis |
20 minutes |
13.3% |
Design |
About 10 minutes. |
6.67% |
Code implementation |
1 hours 30 minutes or so |
60% |
Test |
30 minutes |
20% |
Analysis Summary |
In fact, the debugging process is not complicated, we must be sure of their output |
3. Implement to have pseudo-code, product code, test code. 4. Summarize the benefits of unit testing
Prevent the program from appearing dead Corner, help programmers to organize ideas, find the problem
It is easier to find problems early on, problems are not easy to accumulate, can be solved immediately
Problems encountered:
1 Experimental building virtual machine response is still not good, so most of them are done in their own computers.
2. After putting the animal and the dog and cat classes together, they are not compiled successfully, and then they are compiled and passed in a different class.
3 when doing character control tests, it is easy to make mistakes when you do not pay attention to input.
The beginning of the 4.Complex defines the display as void type, which is not convenient for testing, and is possible after changing to a string type.
201,352,140,000 Sub-Benefits (2) ——-Java Object-oriented programming