• 《Cracking the Coding Interview》——第12章:测试——题目4


    2014-04-25 00:35

    题目:没有专门的测试工具,你要如何对一个网页进行压力测试?

    解法:拼手速,拼电脑数量呗。快捷键+复制粘贴网址,狂搞一番。话说回来,有脚本语言的情况下,直接写个脚本来模拟大量的访问行为肯定是更合理的,手速再快比不过程序。没有工具时,应该想着如何制造工具,而不是赤手空拳去搞。

    代码:

     1 // 12.4 How would you load test a webpage, if you're not allowed to use any test tools?
     2 // Answer:
     3 //     As far as what I've learned, load testing is a testing method which puts the system under limited resources and exposes it to excessive pressure.
     4 //    1. Browser side:
     5 //        1.a. Use a PC with low configuration, but it must sufficient to see the webpage.
     6 //        1.b. Use various browsers to see their different performances.
     7 //        1.c. Open multiple instances of this webpage, see if it fails to respond.
     8 //    2. Server side:
     9 //        2.a. Deploy the web server on a server(maybe a PC) with low configuration.
    10 //        2.b. Try to visit it with multiple clients(many users at the same time).
    11 //        2.c. If the system includes some storage, try to fill it up with POST or GET actions on the webpage.
    12 int main()
    13 {
    14     return 0;
    15 }
  • 相关阅读:
    Transaction 'IREG', Abend 'APCT', at '????'.
    CICS中设置是否具有可修改性
    常用命令总结
    常用语句总结
    _func_
    数组排序返回索引-python和c++的实现
    数组的并行求和-cuda实现
    Pytorch 多GPU训练-多计算节点并行-All you need
    Pytorch 多GPU训练-单运算节点-All you need
    Windows 编程中的问题
  • 原文地址:https://www.cnblogs.com/zhuli19901106/p/3687764.html
Copyright © 2020-2023  润新知