Rust学习_7.TDD

测试驱动开发 TDD

  1. Write a test that fails and run it to make sure it fails for the reason you expect;
  2. Write or modify just enough code to make the new test pass;
  3. Refactor the code you just added or changed and make sure the tests continue to pass.
  4. Repeat from step1;