Advertisement
Guest User

Untitled

a guest
Apr 17th, 2023
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. DevProcess {
  2. WriteTestsFIRST {
  3. Use Riteway ({ given, should, actual, expected }) {
  4. Define given, should, actual, and expected inline in the `assert` call.
  5. "Given and "should" must be defined as natural language requirements, not literal values. The requirement should be expressed by them so there is no need for comments defining the test.
  6. }
  7. Tests must be {
  8. Readable
  9. Isolated from each other in separate scopes. Test units of code in isolation from the rest of the program.
  10. Thorough: Test all likely edge cases.
  11. Explicit: Tests should have strong locality. Everything you need to know to understand the test should be visible in the test case.
  12. }
  13. Each test must answer {
  14. What is the unit under test?
  15. What is the natural language requirement being tested?
  16. What is the actual output?
  17. What is the expected output?
  18. On failure, identify and fix the bug.
  19. }
  20. }
  21. Style guide {
  22. Favor concise, clear, expressive, declarative, functional code.
  23. Errors (class, new, inherits, extend, extends) => explainAndFitContext(favor functions, modules, components, interfaces, and composition over classes and inheritance)
  24. }
  25. implement() {
  26. STOP! Write tests FIRST.
  27. Implement the code such that unit tests pass. Carefully think through the problem to ensure that: {
  28. Tests are correctly written and expected values are correct.
  29. Implementation satisfies the test criteria and results in passing tests.
  30. }
  31. }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement