• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆-60  評論-98  文章-0  trackbacks-0
            應用程序的接口不外乎三種,CLI——命令行接口,API——應用編程接口和GUI。

            因為現在有大把集成快速開發功能的IDE可供選擇,因此GUI的實現變得非常的順手。工具水平提高了,這看起來是理所當然的事情。其實呢?

            單一的GUI接口,帶來實現上的便利,用戶只和GUI打交道,他們也沒話說,那測試人員呢?有沒有換位思考過,各位DEV們?

            GUI有一個特點就是不穩定,元素的增減,是否顯示,顯示的位置,控件更新,都會引起GUI的變化,隨之引發了自動化腳本失效,這是個很讓人撓頭的問題,冒煙測試停住了,回歸也要大量人工介入。

            需要提供更豐富的接口,CLI是一種不錯的選擇,因為CLI不但可以用在單元測試,更可以用到系統測試階段,前提是整個軟件要提供相當的CLI接口,讓交互可以自動化起來。

            看一個Xerces參數處理的例子

            中間有一個usage(),輸出使用幫助到屏幕

             1    int argInd;
             2    for (argInd = 1; argInd < argC; argInd++)
             3    {
             4        // Break out on first parm not starting with a dash
             5        if (argV[argInd][0!= '-')
             6            break;
             7
             8        // Watch for special case help request
             9        if (!strcmp(argV[argInd], "-?"))
            10        {
            11            usage();
            12            return 2;
            13        }

            14         else if (!strncmp(argV[argInd], "-v="3)
            15              ||  !strncmp(argV[argInd], "-V="3))
            16        {
            17            const char* const parm = &argV[argInd][3];
            18
            19            if (!strcmp(parm, "never"))
            20                valScheme = AbstractDOMParser::Val_Never;
            21            else if (!strcmp(parm, "auto"))
            22                valScheme = AbstractDOMParser::Val_Auto;
            23            else if (!strcmp(parm, "always"))
            24                valScheme = AbstractDOMParser::Val_Always;
            25            else
            26            {
            27                XERCES_STD_QUALIFIER cerr << "Unknown -v= value: " << parm << XERCES_STD_QUALIFIER endl;
            28                return 2;
            29            }

            30        }

            31         else if (!strcmp(argV[argInd], "-n")
            32              ||  !strcmp(argV[argInd], "-N"))
            33        {
            34            doNamespaces = true;
            35        }

            36         else if (!strcmp(argV[argInd], "-s")
            37              ||  !strcmp(argV[argInd], "-S"))
            38        {
            39            doSchema = true;
            40        }

            41         else if (!strcmp(argV[argInd], "-f")
            42              ||  !strcmp(argV[argInd], "-F"))
            43        {
            44            schemaFullChecking = true;
            45        }

            46         else if (!strcmp(argV[argInd], "-l")
            47              ||  !strcmp(argV[argInd], "-L"))
            48        {
            49            doList = true;
            50        }

            51         else if (!strcmp(argV[argInd], "-special:nel"))
            52        {
            53            // turning this on will lead to non-standard compliance behaviour
            54            // it will recognize the unicode character 0x85 as new line character
            55            // instead of regular character as specified in XML 1.0
            56            // do not turn this on unless really necessary
            57
            58             recognizeNEL = true;
            59        }

            60         else if (!strcmp(argV[argInd], "-p")
            61              ||  !strcmp(argV[argInd], "-P"))
            62        {
            63            printOutEncounteredEles = true;
            64        }

            65         else if (!strncmp(argV[argInd], "-locale="8))
            66        {
            67             // Get out the end of line
            68             strcpy(localeStr, &(argV[argInd][8]));
            69        }
                        
            70         else
            71        {
            72            XERCES_STD_QUALIFIER cerr << "Unknown option '" << argV[argInd]
            73                 << "', ignoring it\n" << XERCES_STD_QUALIFIER endl;
            74        }

            75    }

            76
            77    //
            78    //  There should be only one and only one parameter left, and that
            79    //  should be the file name.
            80    //
            81    if (argInd != argC - 1)
            82    {
            83        usage();
            84        return 1;
            85    }
            posted on 2009-05-20 10:12 創建更好的解決方案 閱讀(1433) 評論(0)  編輯 收藏 引用 所屬分類: TDDC++專欄軟件測試軟件設計
            日本国产精品久久| 久久精品亚洲欧美日韩久久| 青青青青久久精品国产h久久精品五福影院1421| 日日躁夜夜躁狠狠久久AV| 久久久噜噜噜久久中文福利| 久久99精品国产一区二区三区| 免费观看成人久久网免费观看| 亚洲国产精品综合久久网络| 久久人与动人物a级毛片| 国产一级持黄大片99久久| 亚洲午夜精品久久久久久浪潮| 久久精品人人做人人爽电影蜜月 | 精品永久久福利一区二区| 97久久精品人人澡人人爽| 东方aⅴ免费观看久久av| 色综合久久久久网| 9久久9久久精品| 国产激情久久久久久熟女老人| 国产成人久久久精品二区三区| 日韩精品久久无码人妻中文字幕 | 久久亚洲国产精品123区| 国产精品对白刺激久久久| 一本一本久久a久久精品综合麻豆| 日本久久久精品中文字幕| 天天爽天天狠久久久综合麻豆| 精品久久久久久国产免费了| 91精品国产色综合久久| 久久精品日日躁夜夜躁欧美| 久久国产精品-国产精品| 久久亚洲中文字幕精品一区| 久久久久国色AV免费看图片| 国产69精品久久久久99| 99久久这里只有精品| 国产精品免费看久久久| 欧美黑人激情性久久| 久久亚洲精品成人av无码网站 | 亚洲国产精品一区二区三区久久| 精品久久久久久久久久中文字幕| 国产L精品国产亚洲区久久| 久久99精品久久久久久不卡| 久久成人国产精品二三区|