20165328 Experiment 3 "Agile Development and XP Practice" Experiment Report

1. Practice-1:

  • Requirements: Refer to http://www.cnblogs.com/rocedu/p/6371315.html#SECCODESTANDARD to 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 the function that makes you feel good. Submit a screenshot, add your own student number watermark
  • code show as below:
  • 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));
    }
    }
  • Code specification checking;
  • After modification:
  • Use Reform Code

2. Practice-2:

  • Requirements: Add your learning partner to your own project on the code cloud. After confirming that your partner's project has been added to your own, download the partner's Comeplex code for experiment 2, add no less than three JUint unit test cases, and git add . ;git commit -m "add content to your student number";git push.
  •            Submit a screenshot of the partner project git log, including the above git commit information, and add your own student number watermark information.
  • Screenshot of adding partner successfully:

 

  • git log screenshot:
  • Code cloud upload project screenshot:

3. Practice-3:

  • Requirements: Complete the refactoring exercises, download your partner's code, perform at least three refactorings, submit a screenshot of the refactored code, add your own student ID watermark, and submit your partner's code cloud project link:
  • Since the content about refactoring in the blog "IDEA Simple Tutorial" was lost, after I learned about the refactoring content on the Internet, I chose the following three refactoring method exercises:
  • Rename: Change Example7_3 to Chonggou
  • Put the cursor on Example7_3, press Shift+F6, and enter Chonggou in the pop-up window
  • Successful screenshot:
  • extension method: add hello method;
  • 选中System.out.println("hello,you are welcome!");
  • Press Alt+Ctrl+m
  • Type hello in the pop-up window
  • Successful screenshot:
  • Inline method: inline hello back
  • Select hello in main
  • Press Alt+Ctrl+n
  • Check Inline all invocations and remove the method(2 occurrences) to confirm
  • After the extension method and the inline method are used together, I do nothing, as shown in the screenshot below;
  • Code Cloud Link: Code Cloud

4. Practice-4:

  • Requirements: Refer to http://www.cnblogs.com/rocedu/p/6683948.html to 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
  • Screenshot of cryptography code running:
  • Refactoring: Rename, change Mima to Shiyan3, the screenshot is as follows:
  • After standard scanning of the cryptographic code, the screenshot is as follows:
  • Code Cloud Link: Code Cloud

 

Guess you like

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