UNIT TESTING is a level of software testing where individual units/ components of a software are tested. The purpose is to validate that each unit of the software performs as designed. A unit is the smallest testable part of any software. It usually has one or a few inputs and usually a single output.
What's a unit test, how to write a good unit test, tools for testing.
4. Why
Unit Test
● Satisfy with requirement,verification function
implementation
● Protecting business value
● Confidence in making change
● Protect existing functions from being broken
● Communication to next developer
● Quickly know if the software is broken
4
5. “I need someone who
has a different perspective to show me what I’ve missed.”
5
Still need QA(Quality Assurance)
8. TYPES
8
● Integration test
● Automated test
● Regression test
● Manual test
● Smoke test
● UI test
● E2E test
● Contract test
● UAT(User Acceptance Test)
11. “A unit test is an automated piece
of code that invokes a unit of work
in the system and then checks a
single assumption about the
behavior of that unit of work.
- Roy Osherove (Art of unit testing)”
Unit Test 是指对软件中的最小可测试单元进行检查和验证。
11
23. Example No.2
User need a tool, so they can calculate the max number in any array.
Scenario User start to type a array
Given a array with 5 different number
When user use this tool
Then user should get the max number
Given a empty array
When user use this tool
Then user should be informed they input a empty array
23