In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Agile development is a human-centered, iterative, step-by-step way of development. In the course of the development of Spring framework, the idea of agile development is shown everywhere. From the idea of "convention is better than configuration" put forward in Spring, we can realize zero configuration and on-demand loading, agile unit testing and modular management mechanism. Learning how to use agile development ideas helps to improve the efficiency of application development and write code that is easy to test. Therefore, in order to become an excellent software development engineer, it is necessary to learn the relevant ideas of agile development.
1. Overview of Agile Development
Agile development is a human-centered, iterative, step-by-step development method. In agile development, the construction of software projects is cut into multiple sub-projects, and the results of each sub-project are tested, integrated and operable. In other words, a large project is divided into multiple interrelated, but can also be run independently of sub-projects, and completed separately, in this software process the software has been in a state of use.
1.1. Agile development principles
Advocate simplicity: if you don't need this feature now, don't add it to your design. There is no need to overdesign the system and reconstruct the system when the requirements change in the future.
Owning change: requirements are changing all the time, and people's understanding of requirements is changing all the time. Project members may change during project development. The views of the stakeholders involved in the project may also change, and so may the goals and standards for pre-customization. Therefore, the development approach must be able to embrace change.
Sustainability: even if a working system has been delivered to the user, the project may fail-to meet the needs of project stakeholders, including that the system should be robust enough to adapt to future development. Sustainability refers to the next major release that holds the operation and support of the system being built. To do this, we should not only build high-quality software, but also create enough documentation to ensure that the next software competition can be carried out effectively.
Incremental change: there is no need to design an all-inclusive framework model in the first place, just design a small, basic core architecture, lay the foundation, and then slowly improve the architecture, or discard it when you don't need it. This is the idea of increment.
Quick feedback: the time between taking action and getting feedback on action is crucial. Working closely with customers to understand and analyze their needs, or to develop a user interface that meets their needs, provides an opportunity for quick feedback.
1.2. Agile development process
Test-driven development (Test-Driven Development,TDD) is a new development method which is different from the traditional software development process. It requires that before writing the code of a function, we should write the test code, and then only write the function code that the test passed, through the test to promote the whole development. This helps to write concise, available and high-quality code with high flexibility and robustness, responds quickly to changes, and speeds up the development process. The basic process of test-driven development: (1), quickly add a test (2), run the test, find that the new test can not pass (3), make some minor changes, make the test program run (4), run the test again as soon as possible, and let the test pass (5), ReFactor the code, eliminate duplicate design, optimize the design structure
Continuous integration: frequently and continuously integrate the work of multiple team members and give feedback. Mainly the use of version controllers such as SVN
Pair programming: two programmers work together on the same machine. One input code, one review. It is mainly combined with testing.
Standing meeting
Small versions are released on a weekly and monthly basis, releasing as many products as possible.
Fewer documents. Agile development is not without documentation, but there are a lot of documentation, that is, test code, which really reflects the needs of users and the use of the system API.
Take cooperation as the center
1.3.Agile development method Scrum
Scrum is an agile development framework, which is an incremental and iterative development process. In this framework, the entire development cycle includes several small iteration cycles, each small iteration cycle becomes a Spint, and the recommended length of each Sprint is 2-4 weeks.
1.4.Test-driven development TDD instance
/ / to facilitate testing, write a test base class package com.smart.web;import org.springframework.mock.web.MockHttpServletRequest;import org.springframework.mock.web.MockHttpServletResponse;import org.springframework.mock.web.MockHttpSession;import org.springframework.web.servlet.HandlerMapping;import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter;import org.testng.annotations.BeforeClass;import org.unitils.UnitilsTestNG;import org.unitils.spring.annotation.SpringApplicationContext;import org.unitils.spring.annotation.SpringBeanByType here @ SpringApplicationContext ({"classpath:applicationContext.xml"}) public class BaseWebTest extends UnitilsTestNG {@ SpringBeanByType public AnnotationMethodHandlerAdapter handlerAdapter; / declare Request and Response mock object public MockHttpServletRequest request; public MockHttpServletResponse response; public MockHttpSession session; / / initial mock object @ BeforeClass public void before () {request = new MockHttpServletRequest (); response = new MockHttpServletResponse (); request.setAttribute (HandlerMapping.INTROSPECT_TYPE_LEVEL_MAPPING, true); request.setCharacterEncoding ("UTF-8") }} package com.smart.web;import org.springframework.web.servlet.ModelAndView;import org.testng.annotations.Test;import org.unitils.spring.annotation.SpringBeanByType;import static org.testng.Assert.assertEquals;import static org.testng.Assert.assertNotNull;public class AddUserViewTest extends BaseWebTest {/ / injection user Management Controller @ SpringBeanByType private UserManageController controller @ Test public void addUserView () throws Exception {/ / set request URI and method request.setRequestURI ("/ admin/user/add"); request.setMethod ("GET"); / / Verification result ModelAndView mav = handlerAdapter.handle (request, response, controller); assertNotNull (mav); assertEquals (mav.getViewName (), "/ addUser");} package com.smart.web Import org.apache.commons.lang.StringUtils;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.servlet.ModelAndView;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;@Controller@RequestMapping ("/ admin/user") public class UserManageController {@ RequestMapping ("/ add") public String addUser () {return "/ addUser" } @ RequestMapping ("/ save") public String saveUser (HttpServletRequest request) {String userName = request.getParameter ("userName"); String password = request.getParameter ("password"); if (StringUtils.isEmpty (userName) | | StringUtils.isEmpty (password)) {request.setAttribute ("errorMsg", "user or password cannot be empty!") ; return "/ addUser";} else {return "/ success";}
If the assert appears red, the test-driven development is unsuccessful. Continue fine-tuning until the assert is all green, indicating that the test-driven development instance is complete. Interested children's shoes can continue to test the Service and Dao layers.
2. Version controller GIT
2.1. The significance of version controller
The foundation of realizing the parallel and concurrency of the development team and improving the development efficiency. Its purpose is to provide effective tracking means for the development of files or directories in the process of software development, to ensure that the lessons return to the old version when needed, to avoid the loss of files, modification and mutual coverage, and to avoid unauthorized access and modification through the access control of the version library, so as to effectively protect enterprise software assets and only property rights.
2.2 、 SVN
2.3 、 GIT
Different from the commonly used CVS and SVN, GIT adopts a distributed version without the support of server-side software, which makes the release and exchange of source code extremely convenient. Each GIT clone is a complete document library with full history and revision tracking capabilities. The most important feature is that the operation of "branch" and "merge" is fast and simple. Support offline work, GIT is the atomic submission accessed by the entire project.
3. Maven, a sharp tool for code construction
Maven is a powerful build tool that can help users build an effective automated build system. From cleaning, compiling, testing to generating reports, to packaging and deployment. Instead of typing commands over and over again, users can use simple commands (mvn clean, install, etc.) to complete the build task.
The life cycle of maven basically includes: project cleaning, initialization, compilation, testing, packaging, integration testing, verification, deployment, site generation and other steps. The maven project cycle is an abstract concept, which means it doesn't do anything substantive, which means that its implementation details are left to maven's powerful plug-ins.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.