Programming/C#
테스트 자동화
brent.lee
2019. 9. 13. 15:09
반응형
Benefits of automated Testing
-
Test your code frequently, in less time
-
Catch bugs before deploying
-
Deploy with confidence
-
Refactor with confidence
-
Focus more on the quality
-
Refactoring means chaging the structure of the code without changing its behavior.
Types of tests
-
Unit Test : Tests a unit of an application without its external dependencies.Cheap to write , Execute fast, Don't give a lot of confidence
-
Integration Test : Tests the application with its external dependencies.Take longer to execute, Give more confidence
-
End-to-End Test : Drives an application through its UI.Give you the greatest confidence, Very slow, Very brittle

With TDD you write your tests before writing the production code
Test-driven Development
-
Write a failing test.
-
Write teh simplest code to make the test pass.
-
Refactor if necessary.
세 스텝을 반복해서 목적하는 코드를 완성하는것.
Benefits of TDD
-
Testable Source Code
-
Full Coverage by Tests.
-
Simpler Implementation.
Characteristics of good unit tests
-
First-class citizens
-
Clean,readable and maintainable
-
No logic
-
Isolated
-
Not too specific/general
What to test and what not to test
-
Language features
-
3rd-party code
Naming and organising tests
-
[MethodName]_[Scenario]_[ExpectedBehaviour]
Basic techniques
Writing reliable tests
반응형