반응형

1. Python and Testing

반응형

- Remember what caused the bug? The one line of code with the subtle logic error.

- Testing is commonly divided into several categories based on how complex the component being tested is.


Unit Testing

- Unit tests test a single unit in isolation, verifying that it works as expected without considering what the rest of the program might do. This protects each unit from inheriting bugs from the mistakes made elsewhere and makes it easy to narrow down where the real problems are.


Integration testing

- Ignoring the distinction between unit testing and integration testing is dangerous because such multipurpose tests often make assumptions about the correctness of some of the units they involve.


System testing

- System tests check parts of the program after the whole thing has been plugged together. In a sense, system tests are an extreme form of the integration tests.


Acceptance testing

- Tests that are written to confirm that the program actually does what was expected are called acceptance tests.


Regression testing

- A regression is when a part of your code that once functioned correctly stops doing so. Most often, that is a result of changes made elsewhere in the code undermining the assumptions of the now-buggy section.

- Tests that make sure that the working code doesn't become buggy are called regression tests.

Test-driven development

- In test-driven development, you always write the tests first. Once you have tests for the code you're about to write, and only then, you will write the code that makes the tests pass. 


Summary

- You can tell the computer how to check your code, instead of having to do the checks yourself. 

반응형

이 글을 공유하기

댓글

Designed by JB FACTORY