Java Lab Report III: Agile Development and XP practice

Source: Internet
Author: User
Tags coding standards delete key version control system

Experimental content

1. XP Basics

2. XP Core Practice

3. Related Tools

Experimental steps

(i) Agile Development and XP

Software engineering is the process of applying the systematic, orderly and quantifiable methods to the development, operation and maintenance of the softwares. Software engineering covers the following areas: Software requirements analysis, software design, software construction, software testing and software maintenance. People have many technologies, practices, habits and ideologies in the process of developing, operating, and maintaining software. Software engineering unifies these related technologies and processes into one system, called the "development process". The purpose of the software development process is to improve the efficiency of software development, operation and maintenance, and improve the quality of software, customer satisfaction, reliability and maintainability of software. It is not enough to have ideas of all kinds of processes, and we have a series of tools to ensure that these ideas can operate efficiently in practice. The important point of software development is not to see how many theories you can make, but also how you apply them to related tools, such as the combination of unit tests in Java and JUnit applications, and modeling to be combined with Umbrello or staruml applications. Programming learning is a process that is learned. A common formula is: Software engineering = development process + Tools Xin Zou Two formulas given by the teacher: SW = program + Software engineering and SW Enterprise = Software + business model development process you can refer to the software team and the development process of learning Xin Zou teacher. The common development processes are:

    • RUP (Rational Unified Process)
    • PSP (Personal software Process)
    • TSP (Team software Process)
    • Agile Process
    • ......

Agile Development (development) is a human-centric, iterative, and progressive approach to development. "Agile Processes" are a collection of values and methodologies. Since 2001, some experts in the software industry have started advocating "agile" values and processes that affirm the value of popular practices, but emphasize that agile practices can bring value.
Among them, extreme programming (EXtreme PROGRAMMING,XP) is
is a new and fast method of software development. The XP team uses on-site customers, special planning methodologies, and ongoing testing to provide rapid feedback and comprehensive communication:

    • XP is a methodology developed to target software that meets customer needs
    • XP is a practice-based software engineering process and thought
    • XP believes that code quality is more important than people generally think.
    • XP is ideal for small, responsible, self-motivated teams to develop software that requires uncertainty or rapid change

XP software development is what is expressed through the XP guidelines:

    • Communication: XP believes that communication between project members is key to the success of the project and regards communication as the main driver of coordination and cooperation in the project.
    • Simple: XP assumes that the future cannot be reliably predicted, and it is economically unwise to consider it now, so you should not think too much about the future but should focus on the urgent needs.
    • Feedback: XP considers the system itself and its code to be a reliable basis for reporting on the progress and status of the system development. The feedback of system development status can be used as a means to determine the progress of system development and determine the next development direction of the system.
    • Courage: It represents XP's view that people are one of the most important aspects of software development. In the development of a software product human participation throughout its entire life cycle, is the courage to eliminate the dilemma, let the team to the local optimal left behind, to achieve more significant goals. Demonstrates XP's basic trust in "people make projects successful".

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.

(ii) Coding standards

An important understanding of writing code is that "most of the time the program is for people to see", the programming standard makes the code easier to read and understand, and can even guarantee fewer errors. 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.

The layout in the coding standard is a good example, although the layout does not affect the function of the program, but it can affect the readability. The process of the layout of the pursuit of clear, beautiful, is a procedural style important factors.

III) pair programming

Pairing programming is an important practice in XP. In pair programming mode, a pair of programmers work side-by-shoulder, equally, and in complementary way. They sit in front of a computer, facing the same monitor, working with the same keyboard and the same mouse. They analyze together, design together, write test cases together, encode together, do unit tests together, do integration testing together, write documents together, and so on. There are two roles in pairing programming:

    • The driver (Driver) is the person who controls the keyboard input.
    • The Navigator (Navigator) plays the role of pilotage and reminding.

How to pair programming, why to pair programming, we refer to pair programming and two people cooperation, the focus is:

    • 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.
    • Drivers and pilots constantly rotate their roles and do not work for more than an hour, and take 15 minutes off each hour of work. The navigator has to control the time.
    • Active participation. Any task is the responsibility of the two people, and the responsibility of all. There is no "My Code", "Your Code" or "his/her code", only "our code".
    • There are only horizontal gaps, and there is no level difference. They are pairs, and although they may have different levels of seniority, both sides have equal decision-making rights in terms of analysis, design, or coding.

Teamwork is a spirit that is emphasized in many places, and the smallest team is a one-to-two team, and the team spirit starts with pairing programming. The most important thing for people to get along with in social life is honesty, empathy and mutual benefit. Pair programming in the people will be divided, how to cooperate more effectively to do things wrong people, master these can be a lifelong benefit, how to affect the small partners, we refer to two people cooperation: to make hamburgers.

(iv) version control

The collective ownership of XP means that everyone is responsible for all the code, which in turn means that everyone can change any part of the code. Pair programming contributes a lot to this practice: by working in different pairs, all programmers can see the full code. One of the main advantages of collective ownership is to increase the speed of the development process, because any programmer can fix it once there is an error in the code. This means that the code is placed in a place where everyone can easily get it, and we call it a code repository. This leads to another topic called versioning (version control).

Versioning provides a number of benefits for both teams and individuals.

    • Versioning provides item-level undo (undo) functionality: Nothing is a finalized version, and any error must be easily rolled back. Let's say you're using the world's most complex word processing system. It has all the features you can think of, that is, the DELETE key is not supported. Imagine how cautious and slow you are when typing, especially when a large document is approaching the end of the day, a careless will start again (imagine you select all the text, accidentally pressed the DELETE key, because there is no undo function, had to re-enter). Edit text and versioning are the same, and anytime you need to roll back, whether it's one hours, a day, or a week, it makes your team work free and fast, and is confident about correcting bugs.
    • Versioning allows multiple people to work on the same code, as long as they follow certain control principles. There is no longer a case where one person overwrites another person's edited code, causing the person's modification to be invalid.
    • The version control system preserves the history of changes made in the past. If you encounter some surprising code, the version control system can easily find out who did it, what was changed, how long it was modified, and if so, why.
    • The version control system also supports the release of multiple software versions while developing on the mainline. There is no need for the entire team to stop working when the software is released, and there is no need to freeze the code.
    • Version control is also a project-level time machine, you can choose any time to accurately view the project at the time of the situation. This is useful for research and is the basis for reproducing a previously problematic release

(v) Reconstruction

    • Let's look at the concept of refactoring first:

      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.

      One of the key prerequisites in refactoring is to "not change the external behavior of the software", which guarantees that we will not bring new bugs to the original system while reconstructing the original system, so as to ensure the security of the reconstruction. How to ensure that the software external behavior is not changed? The reconstructed code should be able to pass the unit test. How can you make it easier to read, easier to maintain, and easy to change? The design pattern gives the goal of refactoring.

(vi) The experimental process:

Source->format in the 1,eclipse menu or ctrl+shift+f with shortcut keys can be indented as specified by Eclipse specification

2, learn git simple to use

3, refactoring

4, pair experiment

Also attached to the Experiment Report blog

Experimental time (no pairing game programming)

Steps Take Percentage
Demand analysis 1h 13.3%
Design 2h 26.6%
Code implementation 4h 53.3%
Test 0 0
Analysis Summary 30min 6.7%

Experimental Summary (no pairing game programming)

The most practical knowledge learned through this experiment is the use of refactoring Raname: How to modify a name. It is an improvement in eclipse, and is now quick and easy to modify, when the name is accidentally misspelled at the time of the program, or if the name needs to be modified to make it more meaningful. I think this function is very convenient and user-friendly.

Also learned to refactor the encapsulation function, you can encapsulate the member variables, as well as Source->generate toString () ... Generates a ToString method for the student class. In the experiment, we realized that the structure was improved by refactoring, and the code was optimized.

Teammate Blog:http://www.cnblogs.com/lalacindy/

Java Lab Report III: Agile Development and XP practice

Related Article

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.