How do you unit test business applications?

前端 未结 6 1203
执念已碎
执念已碎 2021-02-19 07:05

How are people unit testing their business applications? I\'ve seen a lot of examples of unit testing with \"simple to test\" examples. Ex. a calculator. How are people unit tes

6条回答
  •  渐次进展
    2021-02-19 07:24

    Mocking Frameworks enable you to test your business objects. Data Driven tests often end up becoming more of a intergration test than a unit test, they also carry with them the burden of managing the state of a data store pre and post execution of the test and the time taken in connecting and executing queries.

    In general i would avoid doing unit tests that touch the database from your business objects. As for Testing your database you need a different stratergy.

    That being said you can never totally get away from data driven testing only limiting the amout of tests that actually need to invoke your back end systems.

提交回复
热议问题