单元测试与功能测试 [英] Unit tests vs Functional tests

查看:100
本文介绍了单元测试与功能测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单元测试和功能测试之间有什么区别?单元测试还可以测试功能吗?

What is the difference between unit tests and functional tests? Can a unit test also test a function?

推荐答案

单元测试-测试单个单元,例如类中的方法(函数),并模拟所有依赖项.

Unit Test - testing an individual unit, such as a method (function) in a class, with all dependencies mocked up.

功能测试-AKA集成测试,测试系统中的一部分功能.这将测试许多方法,并可能与数据库或Web服务之类的依赖项进行交互.

Functional Test - AKA Integration Test, testing a slice of functionality in a system. This will test many methods and may interact with dependencies like Databases or Web Services.

这篇关于单元测试与功能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆