20165320 Java Experiment 3: Agile Development and XP Practice

Experiment content:

Agile development and XP practice one

Experimental requirements:

Install the alibaba plugin to solve the specification problem in the code. Use the tool (Code->Reformate Code) in IDEA to reformat the following code, and then study the Code menu to find a function that makes you feel the best. Submit a screenshot and add your student ID watermark.

Experimental steps:

1. Install the alibaba plugin as required by the teacher's blog

2. Create a new CodeStandard project

Enter the following code:

public class CodeStandard {
public static void main(String [] args){
StringBuffer buffer = new StringBuffer();
buffer.append('S');
buffer.append("tringBuffer");
System.out.println(buffer.charAt(1));
System.out.println(buffer.capacity());
System.out.println(buffer.indexOf("tring"));
System.out.println("buffer = " + buffer.toString());
if(buffer.capacity()<20)
buffer.append("1234567");
for(int i=0; i<buffer.length();i++)
System.out.println(buffer.charAt(i));
}
}

3. Modify the code according to the requirements of the plug-in prompt:

4. Modified code:

Agile Development and XP Practice II

Experimental requirements:

Add your learning partner to your own project on the code cloud. After confirming that the partner's project is added to your own, download the Complex code of partner experiment 2, add no less than three JUnit unit test cases, and git add .; git after the test is successful commit -m "Add content to your student number"; git push; submit a screenshot of the git log of the partner project, including the above git commit information, and add your own student number watermark information.

Experimental steps:

1. First add your partner to your code cloud project, and then enter his project to download the Complex code

2. Add three JUnit unit tests according to the experimental requirements. The running screenshots are as follows:

3. In the git bash clone partner's project, upload your own changes to the code cloud. The screenshots are as follows:

Code cloud link:

Agile Development and XP Practice III

Experimental requirements:

Complete the refactoring exercises, download your partner's code, perform at least three refactorings, submit a screenshot of the refactored code, and add your own student ID watermark. Submit your partner's code cloud project link.

Experimental steps:

1. Create a new Complex5325 project, and refactor the code input of the partner, class name, private, tostring.

2. The screenshot is as follows:

3. Partner code cloud connection: https://gitee.com/BESTI-IS-JAVA-2018/20165325.git

4. Summary of shortcut keys for related refactorings:

快速调取一个方法:Ctrl+Alt+M

快速提取常量:Ctrl+Alt+C 

快速提取变量:Ctrl+Alt+V

快速提取成员变量:Ctrl+Alt+F

快速更改类名:Shift+F6

Agile development and XP practice four

Experiment requirements: Complete the learning of Java cryptography related content in pairs, combined with refactoring, git, and code standards. Submit the learning outcome code cloud link and representative results screenshots, with a student ID watermark.

Experimental steps:

1. Screenshots of related results:


2. Code cloud project link: https://gitee.com/BESTI-IS-JAVA-2018/20165325/tree/master/Exp3_Des

Problems encountered in the experiment

1. The following error occurs when uploading the code to the code cloud:

Solution: Use the following code to force upload -- git push -f origin master

Experimental PSP:

step time consuming percentage
demand analysis 40m 25%
design 60m 37.5%
accomplish 20m 12.5%
test 20m 12.5%
analysis Summary 20m 12.5%

Guess you like

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