java software development tools

In Stormpath (a user management and authentication services), we are serious about quality and efficiency. Any good craftsman, has only talent is not enough, you also need the right tool for the job. Engineering is not just science, but an art. So, in Stormpath, even though we have the talent, we continue to look for useful tools required. Our engineers have been eager to share new tool rest of the team. Now, let's recommendation tool for all Java developers talented.

In this article, I'll share the tools we use Java team daily work, and how to use them, share some practical tips.

1.Groovy

We use Groovy to write Java test. why? Because it provides these capabilities:

Relaxed Java syntax: This is a Java syntax, but some other rules, such as semicolons, variable types, access modifiers are optional. For the latter test is significant, because the access modifier is not strict, you can read the test and assert the internal state of the class. For example, we assume the following class:

A few of my favorite Java development tools, recommended 8 to you!

 

If you want to test setBar (String) method normal (that is able to modify the correct value of the bar), you can use Groovy easily read variable values. Such an operation is not allowed in Java (without involving the premise Java reflection mechanism).

A few of my favorite Java development tools, recommended 8 to you!

 

Powerful assertion: Groovy provides a powerful and diverse assert, is called power assertion statement. Groovy's powerful assertion can clearly demonstrate the failure of verification results. In addition, it is more readable than Java.

A few of my favorite Java development tools, recommended 8 to you!

 

Can be written with Groovy:

A few of my favorite Java development tools, recommended 8 to you!

 

When an assertion fails it will show a very clear description:

A few of my favorite Java development tools, recommended 8 to you!

 

Mocking: When using Java, dynamic simulation framework (eg: EasyMock, PowerMock and the Mockito) is very popular, these frames can easily be used in Groovy. Yay!

2. Support REST style

We provide back-end REST API service to create and manage accounts, a number of the SDK, Java SDK provide our client specific modeling language to do simple interactions. Some SDK also provides Web pages to interact with back-end and thus do not have to write code.

In order to ensure network interoperability framework, they must show the same. So we need to create a series of HTTP-based test. This is our Compatibility Test Tool. The project is maintained by our SDK engineers who specialize in more than one language. Therefore, we need cross-language testing tools, thank God Rest-assured here.

Rest-assured is Java Domain Specific Language (DSL domain-specific language) is used to test REST services, it is easy to use and approachable, even not used for Java developers is incredibly powerful. It provides advanced features, such as details of the configuration, filter, custom analysis, cross-site request forgery (CSRF) and OAuth 2.0. It provides a very simple syntax: given-when-then.

A few of my favorite Java development tools, recommended 8 to you!

 

3.Cargo Plugin

In order for our Java SDK in accordance with TCK check, we need to open one of our Web services to test the implementation of the above. Listen to reason, then, we need to build automated test each time, Gargo Plugin is born to do this.

Cargo simple manner using standard packaging containers for various applications. We use Cargo effortlessly run our code on different Servlet container (such as Jetty and Tomcat) in. We only need to configure Cargo Maven2 Plugin in our pom file to start a Servlet container (Tomcat7), in the testing phase of the recent War compile the package, you can see the configuration in our example Servlet plug-in.

4.Git

What you do not know a thing about Git we can discuss it? Want to understand Git, you can see their About page.

Our Java SDK team around the world, and almost never sit together with each other. Git protect every line of code we write, here are some great command, saving us a lot of time:

  • git mv -force foo.java Foo.java: change the file name in a case-sensitive file system is very troublesome, this command allows git aware foo.java rename Foo.java
  • git diff-tree –no-commit-id –name-only -r <commit_ID>:查看所有在<commit_ID>这次提交中更改的文件。
  • git diff –name-only SHA1 SHA2:列举出在SHA1和SHA2两次提交之间所有更改的文件。
  • 在一个文件的历史提交记录中查询某个字符串:创建search.sh文件,粘贴下面代码:
A few of my favorite Java development tools, recommended 8 to you!

 

5.GitHub

GitHub不仅仅为我们的Git项目提供托管服务,它为代码开源并让全世界都看到做出了巨大贡献。这鼓舞了人们去尝试、去交流、去练习,很大程度提高了每个人的项目质量和大家的技术水平。

GitHub允许我们跟进我们的issue.游客可以提交新需求和报告bug。他们也可以收到我们项目进展的通知。

6.Maven

Maven已经足够出名了。所以我不会用长篇幅解释为什么我们使用Maven做构建管理。然而我可以分享几个技巧,让你的Maven更得心应手:

管理依赖:在一个多模块的项目中,你需要在根pom.xml的标签中定义每一个依赖。一旦你这样做,所有下层模块都可以不需要指定版本。这种管理依赖的方式(比如版本升级)可以集中处理,所有下层模块都会自动识别。比如在根pom.xml:

A few of my favorite Java development tools, recommended 8 to you!

 

下层模块的pom.xml:

A few of my favorite Java development tools, recommended 8 to you!

 

阻止下层模块编译:在发布的时候我们需要所有下层模块一起发布,但是我们如何避免某个模块(比如example)发布呢?很简单,只需要把下面的pom文件加入到你不想发布的模块:

A few of my favorite Java development tools, recommended 8 to you!

 

跳过集成测试:我们有很多集成测试需要很长时间编译。这些测试确保了后端整体运行正常.在频繁的本地部署期间,我们多次因为新功能或修复bug而更改代码。并不需要每次在本地构建的时候执行这些测试,这会拖慢开发进度。因此我们要确保我们的Java SDK只在我们的CI服务器上运行的时候执行集成测试。可以通过下面方法:

根pom.xml文件:

A few of my favorite Java development tools, recommended 8 to you!

 

So you can imagine, all integrated test files ending with IT to ensure the normal operation of the configuration, such as: ApplicationIT.groovy or I18nIT.groovy

Then, if we want to run integration tests, we construct the following: mvn clean install -DskipITs = false

7.JWT Inspector

Our Java SDK use to transmit data over a secure and reliable manner JWT (JSON Web Token). When we tested the investigation, we need to analyze JWT content received from the browser to the. token information may be in the URL, cookie, or local storage. JWT Inspector is a browser plug-in, so that we can decode JSON Web Token from the console or the built-in interface. You do not need to track the token information in your app. You simply click on the button plugin, JWT Inspector will automatically display all the information you need, then you can copy any token information.

8.Postman

We rely heavily REST API requests, write REST request is not convenient, specific syntax depends on the tools we use, such as curl or HTTPie. Both are easy to read, but the syntax is hard to remember. Usually, when we need to troubleshoot the problem, we need to test some requests. When a problem, we can not determine the cause it is a request or backend. We wasted a lot of time to question our written request is correct.

Postman make it easy to write REST API request. It also provides many functions, such as saving, the multiplexing request, the generated code (java, python, curl, etc.), may also be sequentially executed batch request. Postman through friendly interface to help you build complex command, you need to do is fill out a form, simply can not stick up.

Weinan website optimization summary

Use the right tools not only help you save time and improve efficiency, but also improve the quality of your work and enjoy their daily work. We should always pay attention to discover and learn new tools. A start may take some effort, but you will always be aware of their time it is worth it.

Guess you like

Origin www.cnblogs.com/a5651651616/p/12229946.html