4

It seems highly impractical to have a test case/ticket for every unit test; however, the only experiences I have to draw from are from college, and an internship -both of which stressed having each unit test associated with a ticket. This seems especially time consuming when it comes to combination testing.

Is this an industry standard or expectation?

8
  • What do you call a "ticket"?
    – Embedded
    Nov 15, 2017 at 8:18
  • Sorry: Like a Jira ticket, or Bugzilla ticket.
    – Artezul
    Nov 15, 2017 at 8:22
  • OK, what is it? A problem/bug/etc in the software? If yes, then why should be every test associated with such a ticket? If the test is PASSED then there is no ticket for it. And if the software have no bug (let's imagine an almost impossible thing) then there are no tickets at all.
    – Embedded
    Nov 15, 2017 at 8:24
  • It was software that lacked tests; I was tasked to achieve a degree of coverage. They wanted a test case for every unit test for documentation purposes.
    – Artezul
    Nov 15, 2017 at 8:30
  • 2
    We tried using Jira items to track our higher-level tests and it was a nightmare to keep in sync--I can't imagine having to do that for each unit test. A big advantage of unit tests is that they're relatively cheap compared to other, larger tests. If you introduce a heavy documentation burden for each unit test, you lose that advantage.
    – c32hedge
    Nov 15, 2017 at 13:47

3 Answers 3

3

In the comments, you mention that you were doing an inventory of missing tests, and that they wanted tickets for tests you were adding.

This sounds pretty reasonable, as long as they're not expecting a ticket for each and every test. Using a four-function calculator as an example, I could definitely see tickets of the form "Add unit test coverage for multiplying negatives and positive values" that might encompass several unit tests (or the combination testing you mention).

If they're expecting tickets like "Add unit test coverage for a negative times a positive" and "Add unit test cover for a negative times a negation", etc, then that's crazy.

In other words, I can see value in tracking the work being done (or what unit tests still need writing), but not in spelling out each and every test case.

3
  • Would there be circumstances in an industry that'd require that kind of detail? I'm sorry for having to ask because I can't find much information about the.. methodology / documentation side of testing. I can find dozens of sources on how to write a good unit test.
    – Artezul
    Nov 16, 2017 at 0:51
  • Sure, highly regulated industries (e.g. medical devices) could have that level of detail.
    – ernie
    Nov 16, 2017 at 0:51
  • They could, it doesn't mean they have....
    – Ray Oei
    Nov 16, 2017 at 14:50
2
Is this an industry standard or expectation?

No and hopefully it will never be. Hopefully TDD will be. People who think you can document in a workflow-tracker when and how to create unit-tests really miss the point.

1

well, this question is very wide. I can tell you that I've seen two approaches:

1. developers should do the unit tests in the same ticket of the feature that they are developing - and the unit test goes in the same commit of the features. (I've to say that this approach is the usual that I know and also I think it's more efficient).

2. the second is divide the tickets into classes or modules of the system. I've seen this approach in huge systems that the unit testing wasn't a practice at the initial phase of the product.

Thus, I think the first scenario is the one I like more and I have seen more.

2
  • I agree it's a bit open ended due to lack of specifics. I have no issue implementing unit tests for a wide variety of cases; however, providing documention for all of them is something I have difficulty accepting as I don't see the benefit to it. I can understand documenting the concept being tested and how, but not for each iteration of test for that one concept.
    – Artezul
    Nov 16, 2017 at 0:45
  • @user29084 I agree with you. I also think that the best documentation for unit tests is the convention name that better fits for you and of course for the project. Nov 16, 2017 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.