20172333 2017-2018-2 "Program Design and Data Structure" Experiment 2 Report

20172333 2017-2018-2 "Program Design and Data Structure" Experiment 2 Report

Course: "Program Design and Data Structure"
Class: 1723
Name: Yan Yujun
Student ID: 20172333
Experiment Teacher: Wang Zhiqiang
Experiment Date: April 21, 2018
Compulsory/Elective: Compulsory

1. Experiment content

  • Getting started with unit testing and TDD

  • Understand and master the three elements of object-oriented: encapsulation, inheritance, polymorphism

  • Preliminary mastery of UML modeling

  • Become familiar with SOLID principles

  • Learn about design patterns

  • Complete the experiments (1)-(5) on the blue ink cloud.

2. Experimental process and results

  • first commit point

MyUtilltest was tested for the first time through an understanding of pseudocode, production code, and test code, as well as the use of Junit. figure 1

  • second commit point

Study and learn StringBuffer in the way of TDD, and learn to write JUnit test cases by yourself. figure 2

  • third submission point

Expand the design pattern examples, experience the application of OCP principles and DIP principles, and gain a preliminary understanding of design patterns. By taking the remainder operation with your own student number %6, the code is expanded according to the result.

Regarding what the seniors said about the Double-type output is an integer, it is due to the small problem of the definition of the object. Figure 3 Figure 4

  • fourth submission point

Develop a complex class Complex in a TDD fashion. Figure 5

  • fifth submission point

Choose one for Experiment 2 to construct a UML diagram.

3. Problems encountered during the experiment and the solution process

Question 1: Many things that have not been learned before are used in the experiment, which is more troublesome.

Solution to problem 1: For example, JUnit2.0, when I first started working on this thing, Idea's settings could not be opened. Baidu searched for the cause of the problem, and it turned out that it was because the Chinese package was installed, so I finally uninstalled Chinese. , but found that it still can't be opened, so I can only download Idea again. Then I have never heard of the principles of Ocp, Dip, TDD, etc. Suddenly, the experiment requires to compile things according to these principles. All right.
...
other (perception, thinking, etc.)
The last experiment report said that Idea is easy to use. This time, I am really uncomfortable. It is easy to use and easy to use. It is also a great thing to make mistakes. There are many mistakes to myself. Doubting life, before using a virtual machine to deal with errors was just writing errors, but now using Idea is instead doing all kinds of things with Idea.

References

A little explanation of Experiment 2 "Java Object-Oriented Programming"

Experiment 2 Java Object-Oriented Programming

SOLID principles

...

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324856226&siteId=291194637