• <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
            應(yīng)用程序的接口不外乎三種,CLI——命令行接口,API——應(yīng)用編程接口和GUI。

            因?yàn)楝F(xiàn)在有大把集成快速開發(fā)功能的IDE可供選擇,因此GUI的實(shí)現(xiàn)變得非常的順手。工具水平提高了,這看起來是理所當(dāng)然的事情。其實(shí)呢?

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

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

            需要提供更豐富的接口,CLI是一種不錯的選擇,因?yàn)镃LI不但可以用在單元測試,更可以用到系統(tǒng)測試階段,前提是整個軟件要提供相當(dāng)?shù)腃LI接口,讓交互可以自動化起來。

            看一個Xerces參數(shù)處理的例子

            中間有一個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 創(chuàng)建更好的解決方案 閱讀(1423) 評論(0)  編輯 收藏 引用 所屬分類: TDDC++專欄軟件測試軟件設(shè)計(jì)
            久久天天躁狠狠躁夜夜躁2O2O| 午夜视频久久久久一区 | 久久久久无码精品国产不卡| 久久无码国产| 精品久久久久久无码中文字幕| 久久免费小视频| 国产高潮国产高潮久久久91 | 97久久精品午夜一区二区| 亚洲乱码精品久久久久..| 久久久久久精品成人免费图片 | 999久久久免费国产精品播放| 国内精品久久久久久野外| 久久精品国产免费一区| 久久线看观看精品香蕉国产| 狠狠色丁香久久综合婷婷| 青青草国产精品久久| 国产999精品久久久久久| 精品无码久久久久久久动漫| 日韩欧美亚洲国产精品字幕久久久| 蜜臀久久99精品久久久久久| 精品国产乱码久久久久软件| 久久婷婷五月综合色奶水99啪| 久久精品国产精品亚洲精品| 久久久久国产精品熟女影院| 久久精品女人天堂AV麻| 国产成人精品综合久久久久| 好久久免费视频高清| 久久久久99精品成人片| 久久婷婷国产剧情内射白浆| 精品国产一区二区三区久久久狼| 国产呻吟久久久久久久92| 一级做a爰片久久毛片看看| 久久香综合精品久久伊人| 精品久久久久中文字| 人妻少妇久久中文字幕| 国内精品久久久久久久coent | 综合网日日天干夜夜久久| 欧美激情精品久久久久| 久久人妻少妇嫩草AV蜜桃| 久久国产乱子精品免费女| 一本久久a久久精品综合香蕉|