Should unit tests log?

Should unit tests log?

Yes, we should test logging when the logging is doing something that is required. For example, you have hooks in some external application that scans the log for certain events. In that case you certainly want to ensure the logging is done.

How do you test for TDD?

How to perform TDD Test

  1. Add a test.
  2. Run all tests and see if any new test fails.
  3. Write some code.
  4. Run tests and Refactor code.
  5. Repeat.

Why do you need test driven development ( TDD )?

TDD ensures that your system actually meets requirements defined for it. It helps to build your confidence about your system. In TDD more focus is on production code that verifies whether testing will work properly. In traditional testing, more focus is on test case design.

When do you write the ” real ” code in TDD?

The “real” code is the code you write to make your test pass. Really. It’s that simple. When people talk about writing the bare minimum to make the test green, that just means that your real code should follow the YAGNI principle. The idea of the refactor step is just to clean up what you’ve written once you’re happy that it meets the requirements.

What are the two levels of TDD acceptance?

There are two levels of TDD Acceptance TDD (ATDD): With ATDD you write a single acceptance test. This test fulfills the requirement of the specification or satisfies the behavior of the system. After that write just enough production/functionality code to fulfill that acceptance test.

What’s the difference between TDD and traditional testing?

In TDD, you achieve 100% coverage test. Every single line of code is tested, unlike traditional testing. The combination of both traditional testing and TDD leads to the importance of testing the system rather than perfection of the system. In Agile Modeling (AM), you should “test with a purpose”.

https://www.youtube.com/watch?v=F_coGacDJM8