天天看點

持續內建(CI)- 幾種測試的差別(摘錄)

CI過程中,自動化的過程一般包括下列的内容:

編譯代碼

準備資料庫

執行測試

分析代碼

建立安裝和部署内容

生成文檔

TFS根據解決方案已經将一些過程直接內建了,如果需要擴充也可以使用MSBuild腳本進行

如果在其他的工具中進行內建,一般使用MSBuild腳本進行

CI中自動化測試十分重要,通過自動化測試,可以由系統自動運作相關的測試以檢測修改的影響.

單元測試工具發揮的地方,如Nunit MSTest等

Integration tests usually take multiple pieces of functionality and test how they behave together. Such tests can involve two or more classes, assemblies, components, or even small programs that interoperate.

Functional tests, on the other hand, are sometimes associated with integration tests and sometimes with system tests. You extract functional tests from other types of tests to support your CI scenario.

Acceptance tests take fully integrated software with all its dependencies and test it against a normal environment. This means no mocking—only the real deal. You should test I/O, network, and database operations with specific configurations. Acceptance tests can be designed by the customer or domain specialist.

System tests are also performed on fully integrated software, but the environment tends to mimic a production environment more than it does during acceptance tests.

This kind of test is hard to integrate within your build process; these tests tend to rely on specific hardware and software configurations. But if you strain a little, some system tests can be included in your automatic build and test schedule.

You may also want to test the stability of your software. Stability tests answer such questions as whether there are any memory leaks in your Windows service, whether your program can restore the database connection after hibernation, and so on.

Although in most cases it’s possible to automate these tests, they usually have no place in CI the process. They take too much time. You need hours to properly test place in CI the process.