본문 바로가기
Programming/C#

테스트 자동화

Benefits of automated Testing
  1. Test your code frequently, in less time
  2. Catch bugs before deploying
  3. Deploy with confidence
  4. Refactor with confidence
  5. Focus more on the quality
  • Refactoring means chaging the structure of the code without changing its behavior.
 
Types of tests
  1. Unit Test : Tests a unit of an application without its external dependencies.
    Cheap to write , Execute fast, Don't give a lot of confidence
  2. Integration Test : Tests the application with its external dependencies.
    Take longer to execute, Give more confidence
  3. 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
  1. Write a failing test.
  2. Write teh simplest code to make the test pass.
  3. Refactor if necessary. 
세 스텝을 반복해서 목적하는 코드를 완성하는것.
 
Benefits of TDD
  1. Testable Source Code
  2. Full Coverage by Tests.
  3. Simpler Implementation.
 
 
Characteristics of good unit tests
  1. First-class citizens
  2. Clean,readable and maintainable
  3. No logic
  4. Isolated
  5. Not too specific/general
What to test and what not to test
  1. Language features
  2. 3rd-party code
Naming and organising tests
 
  • [MethodName]_[Scenario]_[ExpectedBehaviour]
Basic techniques
Writing reliable tests
 
 
 
 
 
 
 

'Programming > C#' 카테고리의 다른 글

Delete All Files  (0) 2021.06.14
OOP 설계의 기본 원칙 SOLID  (0) 2019.09.15
닷넷에서 오라클에 접근하는 7가지 방법  (0) 2017.12.08
세션의 SET 옵션 확인하기  (0) 2017.12.08
LinqToDataSet Helper  (0) 2017.09.29