TDD: Testing Test Center

Can TDD focus on a different type of testing than unit testing?

+7
design-patterns unit-testing tdd testing
source share
7 answers

Although this is possible with some interpretation of TDD, I believe that the main topic of TDD is writing tests before any production code. Given this, you will not have a large system for recording integration or functional tests, so testing will certainly be at the unit level.

+4
source share

Behavioral Development (BDD) applies TDD ideas at the level of integration testing and functional testing.

+3
source share

The red-green-refractory TDD cycle should be fast, very fast. Quick feedback keeps you in the groove. I saw TDD approaches that tell the whole story, express it as a test, and then lead the development to pass this (big) test. This is nominally TDD (or maybe BDD), but it doesn't seem right to me. Tiny steps, unit tests, this is how I learned TDD, how I think about it and how it works best for me.

+3
source share

Technically, TDD is a way to do something, not just unit testing, theoretically it should manage the entire development process.

Theoretically, the philosophy is that testing drives for development, for a more complex scenario, such as integration between systems, you must define an integration test, and then code to pass these integration tests (even if the test is not automated) ...

+2
source share

Of course yes. TDD relies on automated tests, which are an orthogonal issue for the “type” of tests.

+2
source share

If you focus on the idea, and not on technical implementation, then yes. What I am saying is if you forget about unit testing for a moment and focus on the idea of ​​writing tests first before writing an implementation in order to achieve a more precise design than can be done even at the system level.

Imagine this, you have some requirements. Based on this, you write user acceptance testing tests - high-level tests that provide capture functionality. Then you start development - you already have use cases in the form of a UAT test. You know exactly what is expected, therefore it is easier to implement the desired functionality.

Another example is a scrum-based project. At a planning meeting, you discuss / create / have user stories that are later developed during the sprint. These user stories may be UAT tests.

In any case, I see TDD as a way of defining a design rather than a test cycle / phase / application testing methodology. The reason TDD is seen as a synonym for unit testing is because unit tests are as close as possible to the developer. They seem like a natural way for a developer to express the functional design of a class / method.

0
source share

Of course! TDD does not require unit tests, but not at all. Unfortunately, this seems like a general misunderstanding.

As a specific example, I am fully in charge of developing an open source library (for Java) with integration tests. I do not write separate unit tests for inner classes. Instead, for each new feature or improvement, I first add a failure test (integration) and then modify or add to the existing production code until the test passes. With a possible refactoring step, this is pure TDD, even if no unit tests are written.

0
source share

All Articles