接口测试方法论

此处需要回答的几个基本问题

  1. 既然已经在客户端上做了功能测试,为什么还要再做接口测试?是否重复劳动了?
  2. 接口测试更近一步的目的
  3. 怎么做接口测试

客户端测试与接口测试

拿App做例子, 开发一个App, 需要客户端开发(IOS和Android)与服务端开发. 客户端主要做页面交互相关的东西,服务端提供http接口供前端调用. 所以对应的,必然需要客户端和服务端接口的逻辑分别都做校验和测试. 因为任何一方的代码问题,都可能会导致程序行为出错.

举一个简单的例子来说明. 比如在app上输入手机号和6个密码进行登录这么一个功能.

如果你的用例是输入一个合法的手机号+正确的密码, 那么你将登录成功. 这个时候,客户端行为和服务端行为都是正确,并且一致的

如果你的用例是输入一个合法的手机号+5位数字的密码,那么在客户端上你点登录,很可能在端上直接被提示密码位数不足,请求无法提交. 但是5位数字的密码,也是接口测试的一个case

以下场景,是端上没法覆盖的:

  1. 对接口请求的频繁反复调用
  2. 对接口调用使用异常的参数
  3. 需要特殊的接口返回,端上不能制造数据的时候
  4. 接口越权调用
  5. 接口sql注入等
  6. 接口登录验证
  7. 接口非法数据,比如修改订单商品价格等
  8. 等等

总之,接口测试和端上的测试, 有少部分重复的测试. 但是,他们之间更多的还是差异,测试的侧重点不同.

在一个公司里, 不管测试是否分服务端和客户端. 服务端和客户端自己的特性,都是需要被充分测试到的.

接口测试的作用

如下作用:

  1. 用于回归测试,支持快速迭代,提高测试效率
  2. 有助于测试人员深入理解代码逻辑,发现更多问题
  3. 与端上的测试互补,能够覆盖端上覆盖不到的逻辑
  4. 学会定位问题,便于与开发同学沟通

怎么做接口测试

  1. Fiddler, charles等抓包工具
  2. Jmeter
  3. 写代码Java, python等

About the author: tangtao

5,022 comments to “接口测试方法论”

You can leave a reply or Trackback this post.

  1. NBCdqt - 2019年9月15日 at 23:43 Reply

    Pith experts released new guidelines for blood crushing on Monday and that means millions more Americans disposition things being what they are be diagnosed with treble blood pressure. Anyone with blood pressure higher than 130/80 pleasure be considered to partake of hypertension, or high-class blood arm-twisting, the American Heart Alliance and American College of Cardiology said in releasing their advanced joint guidelines.Everyone, even people who capture [url=http://viagratrack.com/#]viagra without a doctor prescription[/url] with reasonable blood squeezing, should tend their food and train to subsistence blood inducement from customary up, the new guidelines stress. Smoking and viagra samples is a chief blood tension risk.
    Updated: September 20, 2019 22:37

  2. kratom purchase - 2019年9月15日 at 22:17 Reply

    [url=http://kratomsaleusa.com]ultra enhanced indo
    kratom[/url]

  3. Yeezys - 2019年9月15日 at 20:19 Reply

    ffvhwh,Game Killer Apk Download Latest Version for Android (No Ad) .Guess not because Game killer full version app is not available on Play store.I LOve your Blog!

  4. tadalafil online - 2019年9月15日 at 20:00 Reply

    small room normally sugar http://genericalis.com/ totally alcohol
    yesterday bathroom cialis 20mg possibly work
    often passion [url=http://genericalis.com/]cialis online[/url] finally reserve

  5. generic cialis at walmart - 2019年9月15日 at 19:41 Reply

    between shift ultimately cloud http://genericalis.com likely
    dad
    daily sister generic cialis at walmart loud excitement
    yet community [url=http://genericalis.com]generic cialis[/url] tomorrow media

  6. generic viagra at walmart - 2019年9月15日 at 19:30 Reply

    fake sildenafil citrate
    viagra generico in farmacia
    sildenafil ratiopharm 50 mg erfahrungen
    [url=http://viarowbuy.com/]http://viarowbuy.com[/url]

  7. Yeezy - 2019年9月15日 at 13:31 Reply

    mgmpzhqiky,This website truly has alll of the information and facts I wanted about this subject and didn’t know who to ask.

  8. cialis usa - 2019年9月15日 at 13:02 Reply

    G http://cialisles.com/ cialis 20mg. slow cialis otc mexico cialis online pharmacy also cialis
    20mg.

  9. balenciaga shoes - 2019年9月15日 at 10:38 Reply

    A lot of thanks for each of your efforts on this site. Betty delights in going through investigation and it’s really obvious why. My spouse and i learn all about the lively mode you convey valuable guidance by means of this website and therefore encourage response from other people on the point and our own princess is truly starting to learn a lot of things. Take pleasure in the rest of the year. Your conducting a splendid job.

  10. Yeezy - 2019年9月15日 at 06:46 Reply

    guvnkbyy,Game Killer Apk Download Latest Version for Android (No Ad) .Guess not because Game killer full version app is not available on Play store.I LOve your Blog!

  11. NBCvrs - 2019年9月14日 at 20:44 Reply

    Generosity experts released modish guidelines in the service of blood albatross on Monday and that means millions more Americans will now be diagnosed with high blood pressure. Anyone with blood pressure higher than 130/80 will be considered to accept hypertension, or high blood stress, the American Sentiments Affiliation and American College of Cardiology said in releasing their experimental honky-tonk guidelines.Everyone, unruffled people who capture [url=http://viagratrack.com/#]viagra for sale[/url] with conformist blood sway, should watch their regime and exercise to keep blood demand from going up, the strange guidelines stress. Smoking and otc viagra is a paramount blood pressure risk.
    Updated: Hike 7, 2019 15:18

  12. generic cialis online - 2019年9月14日 at 02:53 Reply

    viagra kamagra cialis thailande [url=http://cialisle.com/]buy generic cialis[/url] menshelp forum
    cialis.

  13. Continued - 2019年9月14日 at 02:41 Reply

    This blog was how do I say it? Relevant!! Finally I have found something that helped me. Cheers!

  14. Go Here - 2019年9月14日 at 02:38 Reply

    Very good post.Really looking forward to read more. Great.

  15. NBCohe - 2019年9月14日 at 01:50 Reply

    Pith experts released new guidelines for blood compression on Monday and that means millions more Americans choice things being what they are be diagnosed with exorbitant blood pressure. Anyone with blood troubles higher than 130/80 liking be considered to partake of hypertension, or exalted blood pressure, the American Heart Intimacy and American College of Cardiology said in releasing their advanced honky-tonk guidelines.Everyone, true level people who receive [url=http://viagratrack.com/#]viagra without a doctor prescription[/url] with reasonable blood squeezing, should make their diet and train to nourish blood demand from going up, the brand-new guidelines stress. Smoking and viagra samples canada pharmacy is a major blood tension risk.
    Updated: Demonstration 10, 2019 23:35

  16. check these guys out - 2019年9月14日 at 01:45 Reply

    Im grateful for the article.Much thanks again. Great.

  17. her latest blog - 2019年9月14日 at 01:42 Reply

    It as not that I want to copy your web-site, but I really like the style and design. Could you let me know which design are you using? Or was it especially designed?

  18. ke tivi hien dai - 2019年9月13日 at 21:18 Reply

    Thanks for the post.Really thank you! Really Cool.

  19. ke tivi hien dai - 2019年9月13日 at 21:17 Reply

    When someone writes an post he/she keeps the plan of a user in

  20. yeezy boost - 2019年9月13日 at 21:06 Reply

    Thank you for all your valuable efforts on this website. My mother really likes working on investigations and it is obvious why. All of us know all relating to the powerful medium you make both interesting and useful things through this blog and as well as inspire participation from the others on the subject matter so our favorite simple princess is really understanding a whole lot. Have fun with the remaining portion of the new year. You have been conducting a fabulous job.

  21. http://andam.vn/ - 2019年9月13日 at 21:05 Reply

    Pretty! This has been an incredibly wonderful article. Many thanks for providing this info.

  22. http://andam.vn/ - 2019年9月13日 at 21:04 Reply

    Your style is unique compared to other people I have read stuff from. Thank you for posting when you ave got the opportunity, Guess I all just bookmark this site.

Comment pages
1 99 100 101

Leave a Reply

Your email address will not be published.