about unit test

  • Use unify unit test framework CPPUnit 1.12.1/Visual stdio
  • Unit is a class or a function
  • Test per major component
  • Test by developer
  • Set up clean environment for each test: isolate each test
  • Test shall be automatic
  • Unit test code also in review
  • Same coding style as normal implementation
  • Only test public interfaces, no database, no network, no files operations, stub it.
  • One test one expectation
  • Meaningful naming
  • When see the result, you don’t need to debug the code

猜你喜欢

转载自www.cnblogs.com/zjbfvfv/p/10337568.html