• <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++專欄軟件測試軟件設計
            久久精品国产精品亚洲精品| 久久久久人妻精品一区| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区 | 99久久精品免费看国产一区二区三区| 久久99精品久久只有精品| 精品久久久久国产免费| 无码精品久久一区二区三区| 久久亚洲AV成人无码电影| 久久精品国产福利国产琪琪| 久久ww精品w免费人成| 亚洲欧美日韩精品久久| 性做久久久久久久久浪潮| 国产精品美女久久久| 久久夜色精品国产亚洲| 久久精品国产72国产精福利| 99精品久久久久久久婷婷| 久久伊人色| 久久伊人中文无码| 久久国产精品无码HDAV| 亚洲国产成人乱码精品女人久久久不卡 | 国产99久久久国产精品小说 | 欧美性大战久久久久久| 精品无码久久久久久午夜| 日韩欧美亚洲综合久久影院Ds| 久久这里只有精品久久| 91精品国产高清久久久久久io | 高清免费久久午夜精品| 久久综合久久自在自线精品自| 久久久中文字幕日本| 久久久WWW成人| 狠狠久久综合伊人不卡| 91精品国产91久久久久久蜜臀| 亚洲综合熟女久久久30p| 久久夜色精品国产噜噜亚洲a| 国产精品免费久久久久影院 | 1000部精品久久久久久久久| 欧美一区二区三区久久综| 免费精品久久天干天干| 久久亚洲精品成人无码网站| 日韩人妻无码一区二区三区久久99| 四虎久久影院|