Testing a device against reception tests

Are you for this or that? Or both?

My understanding is unit tests:

  • check the system from the point of view of the developer
  • help developers use TDD
  • keep code modular
  • helps detect errors at low levels of detail

Acceptance tests:

  • check the system in terms of business and QC / QA
  • They are high level because they are often written by people who are not familiar with the internal workings of the code.

It seems to me that both of them are necessary. However, to minimize redundant work, is it worth trying to include unit tests in acceptance tests? In other words, let the latter be called the first. Does it make sense to move in the opposite direction?

What are your thoughts on the whole about unit tests against acceptance tests and how to manage them in relation to each other?

+46
unit-testing tdd testing acceptance-testing
Nov 09 '10 at 21:57
source share
5 answers

Acceptance and integration tests tell you if your code and its completion work; unit tests tell you where it doesn't work.

If you have worked well with the admission and integration exams, and they pass, your code implements all the functions that it should use, and it works. It’s great to know (it’s also great to know that it’s not). But if it does not work, the acceptance test will not give you a detailed understanding of what went wrong; since it tests many functionalities, it can be a bird's-eye view. This is where module tests simulate. Good unit tests tell you exactly what went wrong with which part of your code. It is harder to find out if you have written enough block tests than acceptance tests, but when you have a failed acceptance test without a corresponding unit test failure, it's time to write that unit test.

This is all in terms of testing. And, of course, TDD is not (and ATDD is not) about testing. As for driving your design, acceptance tests give you a wide roadmap (“here where you want to go”), while unit tests lead you to the next intersection (“turn left”). They are both valuable in this regard, and, again, their value is complementary.

Do not confuse them; make no mistake. Unit tests, in particular, should not depend on anything else, and it would be a mistake to restrain your unit tests, making acceptance tests dependent on them. Of course, they can share some infrastructure code, but they must be independent.

+65
Nov 10 2018-10-10
source share

However, to minimize redundant work, is it worth trying to include unit tests in acceptance tests?

No.

In other words, let the last [trick] invoke the former [unit]. Does it make sense to move in the opposite direction?

Do not worry.

Acceptance tests are often political. You show them to people who, by their gut instinct, decide to accept or reject.

Then you argue about the validity of acceptance tests.

Then you argue about the scope and the next version.

Acceptance tests are not - usually - technical. If they were, then you would have had formal unit tests, and that would be so.

Do not try to refine the policy. Take it. Let it happen.




You can hope that acceptance test acceptance (ATDD) will result in "acceptance tests written and agreed by the entire team before development." But you should think that everything that is written in advance is the best at best and in the worst case can be negotiated.

The premise of all Agile methods is that you can only agree to get something available. Everything after this is negotiable.

The premise for all tests (TDD, ATDD, or anything else) is that the test is an agreement with the hardware. Other than that, no. With any TDD (or ATDD) method, you can agree - in principle - to the test results, but you did not agree to the test itself.

It may occur that the test is not easy to record. Or, even worse, you cannot write. You may agree with results that seem verifiable but turn out to be poorly defined. Now what? These are things that you cannot know until you start development and get the details.

All tests are important. And no particular test can be a superset or subset of any other kind of testing. They always partially overlap sets. Trying to combine in order to somehow save some work is likely to be a waste of time.

More testing is better than anything else. Combining all tests is more valuable than trying to force a subset-superset relationship between tests.

+11
Nov 09 '10 at
source share

Unit Tests - my specific function does what it should do, no more and no less.

Acceptance test - my application does what it should do.

Example: an application for calculating the roots of quadratic functions. Accepts inputs a, b and c, returns the roots x1 and x2. This application is created by the functions that I write to add two numbers, subtract two numbers, multiply two numbers, divide two numbers, and take the square root of two numbers.

Unit tests - make sure my division and multiplication functions work correctly, my square root works correctly, my additions and subtractions work correctly.

Acceptance tests - check that my application calculates the roots of quadratic functions.

Since my whole application is designed to calculate the roots, I should not have a unit test, which also calculates the roots, because there is no separate function that does this.

+9
Apr 17 '13 at 16:31
source share

As a result of the above,

  • Acceptance tests make sure you create the right thing
  • In unit tests, make sure you build the thing on the right
+3
Mar 11 '17 at 7:02
source share

This is just my personal opinion on some types of tests:

However, to minimize redundant work, is it a good idea to try to include unit tests in acceptance tests?

I would prefer S. Lott no and add that there is a danger that unit tests will be falsified to some extent, which may lead to some errors. For example, during a fallout, someone can test several states, but probably not all of them where the tester can use different data to identify a potential error.

In other words, call the former. Does going in the opposite direction make sense?

I'll be careful ever to tie them together. Unit tests are tests of the smallest bits of functionality, which are often so small that the end user does not understand that there can be hundreds of tests to get a web form for entering data into the CRM system. Acceptance tests are more about what the user of the application wants, which may be more subjective, for example. "Does it look beautiful?" against "Does this look right?" It may be that the mark is “good enough” with acceptance tests, which I'm not sure will work with unit tests. Typically, if the unit test fails, then someone must decide to either fix the code or delete the test, since each of them may be a good option, depending on the circumstances.

What are your overall thoughts on unit tests against acceptance tests and how to manage them in relation to each other?

Unit tests relate to checking the simplest code fragments. There may be integration tests, but this level is higher as soon as all the small pieces are checked to see if the combination of parts combines, for example. there were Saturday cartoons that I watched growing, which had toys that could be assembled like Voltron or various Transformers, such as the Designers who formed Devastator. Acceptance tests are usually from an end-user perspective: "Can I do X with the application now?" receiving the answer "Yes" before something goes out the door. Although some cases of errors can be checked in the acceptance test, usually a thorough check of all possible combinations that could be entered into the application is not carried out. However, unit tests may cover boundary conditions and several other random cases.

+2
Nov 09 '10 at
source share



All Articles