Jump to content

Talk:Unit testing

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 03:11, 4 March 2022 (Archiving 1 discussion(s) to Talk:Unit testing/Archive 1) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconComputing: Software C‑class Mid‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software (assessed as High-importance).

History

I'd like to see information about the history of formal unit testing, when did it come about, for what technologies, when was it popularised etc???

Ian —Preceding unsigned comment added by 82.10.239.38 (talk) 19:26, 10 February 2008 (UTC)[reply]

I agree strongly. Also who invented the name? 06:53, 22 February 2012 (UTC) — Preceding unsigned comment added by 203.41.222.1 (talk)

+1 here as well. would love some history. my contribution: c2 wiki has entries as far back as 1999. all references in the wikipedia article do not go as far back. "testing" was mentionned in my CS training, but not explicitely TDD or Unit tests. I was wondering how old that thing was!!!! oooh and look at this history! It mentions tests in the Mercury space program (1950s') , Ada Lovelace (19th century) and Ward cunningham (1989). See also this, this, this and of course this. --TheAnarcat (talk) 14:00, 28 March 2015 (UTC)[reply]
+1 here as well. Unit testing has existed long before "Unit Testing Frameworks". Even the core definition of Unit Testing in this Wiki article is being related to specific software components. This definition is more about "Unit Testing Frameworks" rather than "Unit Testing". The core WIKI definition of "Unit Testing" being presented here is actually the definition of "Unit Tests in Unit Testing Frameworks". Completely wrong article resulting in incorrect other WIKI pages in the definitions and separations between "Functional Testing" and "Non Functional Testing" and "Unit Testing". — Preceding unsigned comment added by 115.70.45.139 (talk) 23:23, 13 February 2020 (UTC)[reply]

Missing 'Costs'

There is a 'Benefits' section, for balance the 'Costs' should also be noted. Such costs include :-

  • Additional development effort, often exceeding the cost of the feature being developed.
  • Ongoing maintenance liability. Any future changes to the code also requires a review and update of the tests.

Given there is a cost to implementing unit tests, there is a risk of a negative return on investment if the test suite doesn't actually identify software defects in less time than it took to write and maintain the unit tests. If the development team are sufficiently adept, it is very rare that defects will exist in a 'unit' in isolation. It is more likely that defects will be introduced at integration or system level where module testing would be of greater value.

Not all software developers agree that unit testing is worthwhile. — Preceding unsigned comment added by Johnpwilson (talkcontribs) 15:50, 11 November 2013 (UTC)[reply]

"negative return on investment if the test suite doesn't actually identify software defects in less time than it took to write and maintain the unit tests."
Not true, and a basic fallacy of testing. If code luckily happens to be perfect, there is still a value in testing it as it shows that the code is perfect and would also show if the code was imperfect. There is value to this and that value does not disappear just because high quality code isn't making use of it. The value of testing is greater than its obvious value from the bugs that are found, it also brings added value from demonstrating that some parts remain bug free. Viam Ferream (talk) 10:29, 1 September 2014 (UTC)[reply]
If not using unit testing, how exactly does one determine that the feature works, and that any previous, still-desired functionality remains intact?
Unit testing is not solely an additional cost; it is a tradeoff vs. the different sort of testing that would otherwise be required -- or releasing untested code. It generally replaces repetitive manual testing. — Preceding unsigned comment added by 2601:601:9900:11A0:41A8:4C8E:7078:97A0 (talk) 05:19, 3 March 2022 (UTC)[reply]
This is not a forum for discussing things like this, but you are missing the option of other forms of testing. Walter Görlitz (talk) 05:26, 3 March 2022 (UTC)[reply]

Problem with basic definition in summary

The definitions given in the summary of this article includes testing within a single unit and between multiple units which conflicts with the definitions given by others:

  • ISACA defines unit testing as "A testing technique that is used to test program logic within a particular program or module.". ISACA defines integration testing as "evaluat[ing] the connection of two or more components that pass information from one area to another."
  • softwaretesting.com gives a definition of unit testing as "a level of software testing where individual units/ components of a software are tested. The purpose is to validate that each unit of the software performs as designed."
  • NIST provides synonyms of instance testing and conformance testing and provides the definition "testing an artifact ... against the rules defined in the specification. This form of testing does not directly involve a system under test, but rather a testing artifact that was produced by the system under test."

Revision or verifiable supporting citations are needed. Stephen Charles Thompson (talk) 21:13, 17 October 2018 (UTC)[reply]

Softwaretesting.com is not a reliable source. What are your actual concerns? The definition here is in-line with dozens of books and the NIST definition. Walter Görlitz (talk) 21:32, 17 October 2018 (UTC)[reply]
cite the NIST definition, please, if you will. I'm looking for it now (e.g. [1]) Stephen Charles Thompson (talk) 21:35, 17 October 2018 (UTC)[reply]
I was making reference to what you linked to above. Perhaps the following will help: https://www.google.com/search?q=%22Unit+test%22+site%3Anist.gov Walter Görlitz (talk) 23:43, 17 October 2018 (UTC)[reply]

IEEE 29119 on automated unit testing

What does IEEE 29119 have to say about automated unit testing? I don't have access to the standard, but it would be extremely relevant. --Elephanthunter (talk) 00:30, 8 May 2019 (UTC)[reply]

TDD...

Concerning TDD: "When the tests pass, that code is considered complete."

Any description of TDD that downplays or dismisses the refactoring part of the cycle is an outlandishly false description of TDD. AlexMc (talk) 20:11, 29 August 2020 (UTC)[reply]

@AlexMc: I agree. WP:SOFIXIT. If you don't do so, or can't, please let me know and I'll see what I can do. Walter Görlitz (talk) 03:07, 31 August 2020 (UTC)[reply]

"Example" section could be much better

The "Example" section is copy / paste code, hardly an example of great design, and may exaggerate the impression that the test code will be far more work to write than the code under test.

This is a missed opportunity to provide a far more compact table-driven test example. Alternatively, this example could be reduced to about four test cases and still get the point across. — Preceding unsigned comment added by 2601:601:9900:11A0:41A8:4C8E:7078:97A0 (talk) 05:11, 3 March 2022 (UTC)[reply]