DEV Community

Samuel K.M
Samuel K.M

Posted on

Testing

Problems with manual testing:

  1. Difficult to write effectively
  2. Impacts actual program
  3. Very hard to read
  4. Only a temporary fix

Automated tests:

  1. Results displayed in an informative way
  2. Test files are different from source code
  3. Output is easy to read and understand
  4. Guarantees code works as expected
  5. Instantly see if anything has broken when making changes

Unit Tests:
Gurantee an individual piece of code or function work as its supposed to
Integration Tests:
Used when adding new code to already existing code to ensure changes dont break.
End to End Tests:
Timeconsuming , run from start to end for all application functions , methods etc

Behavior Driven environment is like writing a plan before you write your program. You write test before actual code.

Red, Green & Refactor

  • write tests even though they will fail
  • write easiest code to pass the test
  • Go back and improve the code
  • repeat

Top comments (0)