20165214 Experiment 3 Agile Development and XP Practice

The cover of the lab report

Course: Java Programming Class: Class 1652 Name: Zhu Wenyuan Student ID: 20165214

Instructor: Lou Jiapeng Experiment Date: April 28, 2018

Experiment time: 15:35 - 17:15 Experiment number: 3

Experiment Name: Agile Development and XP Practice

Experiment requirements:
1. Complete the experiment and write the experiment report. Note that the experiment report focuses on the operation results, the problems encountered and the analysis.
2. Count your own PSP (Personal Software Process) time in the experimental report;
3. Master the ability to use IDEA to complete basic programming and program debugging.

2. Experimental content:

  1. XP Basics
  2. XP Core Practices
  3. Related tools

3. Experimental steps

(1) Code formatting

  • 1. Create a new project "Exp3" in IDEA, create a "CodeStandard" class under the project, and enter the code for testing (the format is not adjusted):

  • 2. Install the alibaba plug-in in IDEA, right-click the class name after installation, and then click "Code Specification Scan"

  • 3. Find irregularities in the code:

  • 4. Click Reformate Code in the Code directory to format the code:

  • 5. I think the best thing to use in the Code directory is Override Methods

It provides method rewriting of some classes in the Java.lang package, which is very convenient when we do method rewriting.

(2) Invite your partner to join the code cloud project and perform Junit test on your partner's code.

  • 1. Create a "teamwork" project in my code cloud and invite your partner to become a "developer".

  • 2. Introduce the Complex code of the partner in experiment 2, add multiple Junit test cases and compile:

A "green bar" appears, passing the test.

  • 3. Use the git statement on the command line to transfer the code to the new common project created by my partner and I, then enter git log and take a screenshot:

  • 4. Our code cloud link

(3) Refactoring exercises

  • 1. Download a partner's code. Code of my choice:

  • 2. Problems and analysis in the code
    • Question 1: The class name LYK cannot reflect the function of the program. This program is to calculate the number of combinations. I think it should be changed to Combination;
    • Question 2: The recursive function name cannot reflect the corresponding function, so it can be changed to Caculate;
    • Problem 3: There is a lack of handling for the case where the input is an illegal character.
  • 3. Based on the above questions, I refactored the code as follows:

  • 4. Run Junit test on the modified code:

A "green bar" appears and the result is correct.

(4) Learning of Java Cryptography Algorithms

  • 1. Carefully read Mr. Lou's blog Java Cryptography Algorithm

  • 2. Write a program that implements MD5 encryption and run it, enter abc, and get the following results

  • 3. Read and run Mr. Lou's DES algorithm program and run it, and get the following results

  • 4. Read and run Mr. Lou's RSA algorithm program and run it, and get the following results

  • 5. Code cloud link

  • 6. PSP time

step time consuming percentage
demand analysis 5min 7.7%
design 20min 30.8%
Code 30min 46.2%
test 10min 15.4%
analysis Summary 10min 15.4%

Fourth, the problems encountered and solutions

  • Question 1: In the step (3) of the experiment, the code of the partner I downloaded needs to be input on the command line, but when I run IDEA, it runs directly without letting me input command line parameters.
  • Problem 1 solution: I found a solution. Under the run directory in IDEA, there is a

    column of Program arguments in Edit Configurations to define the parameters of the command line~

  • Question 2: In the process of writing the cryptographic algorithm, I want to use the object of the Console class to make the entered password not displayed, but I don't know why, the same code cannot be run in IDEA, and the line of entering the password is reached. Just report an error, and it can run in Linux.
  • Problem 2 solved: The reason has not been found yet.

Five, experience

This experiment is simpler than the last experiment, but I learned a lot, especially the powerful password functions in Java. This is closely linked to our profession. Out of interest, I found another article about the use and extension of the salted hash function in Java ( click here ). After reading it, I felt very knowledgeable, so I would like to share it~
I thought Java seemed to be related to our professional It doesn't matter, I changed my mind after this experiment. I found that Java can easily implement many cryptographic algorithms, which is very convenient. In the future, you can learn more about this content and move closer to our profession~

Guess you like

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