Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Fitnesse uses Series 8

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Concluding remarks:

Fitnesse is a very creative software. It tries to close the gap between developers and users. Through the previous introduction, you may also see that, in fact, the final implementation of the code (fixture). These codes are generally written by testers. So it got me thinking:

First, whether it is necessary to develop an acceptance "form" for each demand. If you do this, it means writing a lot of fixture. It takes a lot of time to write this code, which is expensive. Is there a way to achieve roughly the same effect at a lower cost?

Second, is there a bug in the code itself, and will it cost more to debug the code and maintain it in the future?

Third, my view is that automation should only be used in tests that require a large number of regression, fixed functions, and relatively low-level tests, and the test code should be as simple as possible; try not to add complex logic; try to be universal to improve utilization; it takes as little time as possible.

Based on the above understanding, I give a general fixture and fitnesse table here, which is mainly used for interface testing in our company. Of course, it can also be used for general page checking. It has been running for nearly two years, and the effect is OK. Some of fitnesse's built-in fixture should have similar features, but I think it may take longer to find and learn to use than you write, so I wrote it myself.

Package calis.http;import org.apache.http.impl.client.*;import org.apache.http.client.methods.*;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.util.EntityUtils;public class Exist {private String url=null; private String key=null; private String keys [] = null; private String reponseStr; private String result= "NotExist" Public void setStartUrl (String url) {this.url=url;} public void setKeyWords (String s) {key=s; if (key.charAt (0)! ='/') {key= "/" + key;} keys=key.split ("/") } public String verify () {return result;} public void execute () {DefaultHttpClient httpclient = new DefaultHttpClient (); HttpGet httpget = new HttpGet (url); try {HttpResponse response = httpclient.execute (httpget); HttpEntity entity = response.getEntity () If (entity! = null) {reponseStr=EntityUtils.toString (entity, "UTF-8"); if (keys.length > 1) {boolean judge=true; for (int item1polii)

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report