釐清Development 、Testing、Staging、Production Environment

Watson Wang
5 min readJul 10, 2021

--

簡單說明一下這篇的用意,之前我在做QA intern(quality assurance)時,就很常需要去下載指定的型號軟體像是Stg v1.12.4之類的來做manual test或是寫automation測試,之前因為忙碌(懶?)一直沒有很仔細的去了解,該還的還是得還的🙂,一起了解一下吧。

如標題所示,這四個環境(dev/test/stg/prod)分別代表軟體開發會切割的四個階段。

Development

Developers test their code on a server designated as development to see whether that application will run with other code. Simply put, that server is a development box.

這一階段很簡單,就是開發環境,當開發團隊接到客戶條件時進行開發的環境,通常在這一階段會有最多的bug,也是最不穩定的一個階段。

Testing

The purpose of the test environment is to allow human testers to exercise new and changed code via either automated checks or non-automated techniques. After the developer accepts the new code and configurations through unit testing in the development environment, the items are moved to one or more test environments.

這一階段的目的是讓測試人員可以在不同的測試環境做各種不同的測試,不管是手動或是自動,並記錄下log在發生錯誤後傳給開發人員做及時修正。看操作環境的複雜程度,測試程序可以是依序或是同時進行。

Staging

Once the developer is satisfied that the application is ready for prime time, the application moves to a staging server. The staging server is a mirror copy of the production server; its primary purpose is to test the completed application on the mirrored copy of production to ensure that the application doesn’t break the existing production server applications.

當軟體開發團隊覺得現在的版本已經不錯時,就會將軟體移動部署到Staging Server上面,Staging的規格沒意外應該要盡量跟Production server(最後軟體服務的環境)一模一樣,例如:應該要放在remote server上以測試網路連線效果,以確保軟體不會在發佈出去後掛掉或是出什麼問題~在這一階段另一個重要用途是做負載測試,通常會因為環境而有很大的影響。

Production

Deploying to production is the most sensitive step; it may be done by deploying new code directly (overwriting old code, so only one copy is present at a time), or by deploying a configuration change. This can take various forms: deploying a parallel installation of a new version of code, and switching between them with a configuration change.

如果軟體服務在staging server中都沒有什麼問題,在manager或開發團隊同意後,工程師就會將軟體移動到Production server上面並正式開放user使用。

有各種方式可以部署到Production,像是在程式碼碼中切換舊code到新的,或是部署一個新的server再慢慢切換舊server的網路流量過去,切換動作需要盡量迅速,以避免一些版本不相容的問題出現。

小結

在大致理解這些不同環境配置後,之後再次聽到應該就不會再困惑了🥸,很多大型開發團隊都會有這些配置步驟,希望這篇有幫助到其他跟我一樣本來不清楚的人~

參考

--

--