[Unit Test] Unit Test Brief Introduction
Levels of Testing
- Acceptance
- Performance
- Functional
- Integration
- Unit
Why Unit Testing
- Feedback Cycles
- Usage Model
- Eailier Bug Detection
- Refactoring
Test Driven Development (TDD)
`Write the tests before writing the code (incrementally)
- Better requirements understanding
- Better decomposition and design
- Better code testability
- Known expectation of code hebavior
- Bonus: unit tests & coverage
Frameworks
-General xUnit framework: Junit, Nunit CppUnit
-Mocking framework: mockito, easymock, powermocks
-Domain specific framework: HTTPUnit, xmlUnit, DBUnit
-Code Coverage: EclEmma Clover
-Performance Testing Tools: JMeter JUnitPerf JMeter + Badboy NeoLoad WAS
-Continuous Integration Tools: Jenkins, CruiseControl
-Web Service UI: SoapUI Rest-Client
Writing Unit Tests for legacy Code
- Legacy Code any code without tests
- Refactoring: Layer, Injection
- Characterisation Test
Rspec
Aptana Studio
SPAL
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步