How to automate integration testing?

前端 未结 4 1931
旧巷少年郎
旧巷少年郎 2021-02-02 11:29

I\'d like to know something, I know that to make your test easier you should use mock during unit testing to only test the component you want, without external dependencies. But

4条回答
  •  一个人的身影
    2021-02-02 11:58

    I do not know what kind of platform you're on, but I use Java. Where I work, we create integration tests in JUnit and inject the proper dependencies using a DI container like Spring. They are run against a real data source, both by the developers themselves (normally a small subset) and the CI server.

    How often you run the integration tests depends on how long they take to run, in my opinion. Run them as often as you can. Leave the real person out of this, and let him or her run manual system tests in areas that are difficult or too expensive to automate testing for (for instance: spelling, position of different GUI components). Leave the editing of config files to a machine. Where I work, we have system variables (DEV; TEST and so on) set on the computers, and let the app choose a config file based on that.

提交回复
热议问题