Three experimental reports of Java experiment

Source: Internet
Author: User

First, the contents of the experiment

1. XP Basics

2. XP Core Practice

3. Related Tools

Second, the experimental process (this test is done on their own computer, no use of the experimental building)

(i) Agile Development and XP

1.XP is a methodology developed to target software that meets customer needs

2.XP is a practice-based software engineering process and thought

3.XP believes that code quality is more important than people generally think

4.XP is ideal for small, responsible, self-motivated teams to develop software that requires uncertainty or rapid change

The basis for successful use of a practice in an XP environment is presented through the rules of XP, including: Quick feedback, hypothesis simplicity, incremental changes, advocating for change, and quality of work.

XP software development is the cornerstone of XP activities, including: coding, testing, listening, design.

Project member users ' successful implementation of XP activities is presented through XP practices, including programming, team, and process-related 12 practices

(ii) Coding standards

Programming standards include: Descriptive names, clear expressions, straightforward control flow, readable code and annotations, and the importance of consistently using certain rules and idioms when pursuing these content.

Using the shortcut keys in Eclipse Ctrl+shift+f can be indented according to the specification set by Eclipse.

Standard format

The general naming conventions in Java are:

1. To embody the meaning of each

2. Terms for packages, classes, variables

3. Method name with the verb

4. Package name all lowercase, such as: IO,AWT

5. The first letter of the class name should be capitalized, such as: Helloworldapp

6. The first letter of the variable name is lowercase, such as: UserName

7. Method name first Letter lowercase: setName

......

(iii) Pair programming

Pairing programming is an important practice in XP.

There are two roles in pairing programming:

Drivers: Write design documents, conduct coding and unit tests, and other XP development processes.

Navigator: Review the driver's documentation, the driver's implementation of the development process such as coding, consider the coverage of unit tests, think about the need for and how to refactor, and help drivers solve specific technical problems.

Key Note: Work effectively to do things wrong to people.

(iv) version control

You can use Git status to view the status of the code, show that there is no tracking code, with Git add <file> Add, we use git add helloworld.* to add the information of the file to be submitted to the index library. When we use git commit, Git commits the file based on the contents of the index library. This is done locally, shutting down the lab environment removes the code, and if you want to save the code to a remote hosting server, you need to use Git push, which is equivalent to completing the save operation before the experiment is complete.

(v) Reconstruction

Refactoring (refactor) is to change the structure within the software without changing the external behavior of the software, making it easier to read, easy to maintain, and easy to change.

1. The first function of refactoring is rename, which can change names to classes, packages, methods, and variables.

How to modify: Click the name you want to change with your mouse, select the Refactor->rename in the Eclipse menu ...

2. Encapsulation class

Select a class that needs to be encapsulated, such as name, age, ID class, and then Refactor->encapsulate Field in the menu in eclipse

Every time the student information is printed this code violates the dry principle, causing code duplication and normal refactoring to use the extract Method in eclipse

The purpose of modifying the software:

1. Add new features;

2. The original function has a bug;

3. Improve the structure of the original procedures;

4. Optimize the performance of the original system.

A complete refactoring process consists of:

1. Check out code from the version control system library

2. Read the code (including test code)

3. Found bad smell

4.Refactoring

5. Run All Unit Tests

6. Check in code from the codebase

(vi) Practice Item 1. To write a software in the form of pairing programming, blog to give the knot to the classmate's blog URL, you can take pictures to show the pairing programming situation, You can refer to other school assignments. 2. Record the TDD and refactoring process, do not test code less than the business code, eclipse the Refactor menu under the refactoring skills not less than 5 3. Team code to use git in the lab building hosting, to use the knot pair of classmate's account hosting. 4. The program should have GUI interface, reference user interface and user experience 5. program functions from the Pea pod game to choose a Java implementation, note: The project can not be duplicated between the team, the class representative coordination. 6. Report the time of your PSP (Personal software Process)

In this experiment, the topic of our group is to design snake games.

The product code is as follows:

Pseudo code:

1. Design a behavior 30, classified as 50, a courtyard consisting of a lattice

2. Define a snake and an egg, the snake eats an egg, and randomly generates an egg at random place in the yard.

3. The snake eats an egg and adds 5 points.

4. If the body of the egg becomes longer, the game continues, and the game ends if the snake touches the border or its own body after the game is launched.

Game run results such as:

PSP Time Statistics

Steps

Take

Percentage

Demand analysis

25min

8.2%

Design

80min

26.2%

Code implementation

120min

39.3%

Test

55min

18%

Analysis Summary

25min

8.2%

Third, the experiment harvest and summary

The difficulty coefficient of this experiment is large, according to the experiment instruction book, the previous several tasks are not too complex, according to the guidance can be very easy to implement, and let us know how to quickly standardize the format of the code and the application method of refactoring. But for the final game design this link, my partner and I realized that the Java knowledge that I usually learn is not enough to complete this experiment, so I borrowed the online and snake game related code, carefully read, understand the code content, and carefully debug the code, and finally completed the most difficult part of the experiment. In the process of studying the code, I have deepened the application of git, and after mastering this tool, it is very useful for our future programming learning. At the same time, we need to continue to learn more about Java development, not just content with books, not just to understand the code, more importantly, to write code, in-person experience to gain more.

Four, knot to the Classmate blog address: http://www.cnblogs.com/disturbia/

Three experimental reports of Java experiment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.