In this small passage, I would like to briefly introduce the key points of implementing unit testing, also describe unit test review check points.
1. When should unit test be started?
Unit test is very improtant, and can be started as soon as APIs is defined.
2. Why unit test?
Hunting errors as early as possible, make sure APIs work correctly.
Hunting errors which cannot be found by regression testing, functional testing.
Start before UI ready.
3. Key points of unit test implementation?
(1) Focus on errors hunting.
(2) Follow coding conventions when writting unit test code.
(3) Make test coverage as one of the important target of unit test, especially concentrate on Path Coverage.
(4) Make sure all unit test code is executed when source code changes. That is to say, when a large range of source code of the software changes, testers need to run a full cycle of unit test code to ensure that no regression errors are introduced.
(5) For some embedded software, all the test code need to implement only on develpment environment. What's more, the test code should be executed on target HW.
4. Unit test review check points?
(1) Static code check. To verify if the module to test follows common coding conventions, for examples, Naming conventions, comments formats, etc.
(2) Configuration files check.
(3) Write data drive test code.
(4) Improve test coverage.