Talk:Unit testing
![]() | This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||
|
|
|
This page has archives. Sections older than 180 days may be automatically archived by Lowercase sigmabot III when more than 6 sections are present. |
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)
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)
- +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)
The history section needed rewriting as it is completely inaccurate and misleading. Indeed, unit testing is a term used since the infancy of software engineering in the sixties (if not earlier), as a number of mentions in academic paper prove (e.g. Experiences with the goddard computing system during manned spaceflight missions, 1964, or System integration as a programming function', 1969, or An analysis of the resources used in the SAFEGUARD system software development, 1976, or The value of a proper software quality assurance methodology, 1978, which mentioned also unit test automation, to name only a few). This in now DONE — Preceding unsigned comment added by Cth027 (talk • contribs) 00:48, 22 March 2024 (UTC)
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 (talk • contribs) 15:50, 11 November 2013 (UTC)
- "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)
- 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)
- 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)
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)
- Meh. I doubt that. Feel free to prove me wrong. Stevebroshar (talk) 14:28, 15 April 2024 (UTC)
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)
- @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)
- Improve it. Less complaining and more doing. Stevebroshar (talk) 14:28, 15 April 2024 (UTC)
"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)
- The missed opportunity is yours. I suggest less complaining and more doing. Stevebroshar (talk) 14:26, 15 April 2024 (UTC)
JUnit in history section
Ridiculous that JUnit is listed as the first Unit Testing Framework in the history section, SUnit was first of the xUnit genre and was in regular use, JUnit was a later port. — Preceding unsigned comment added by 84.9.199.214 (talk) 23:55, 28 March 2023 (UTC)
- If you're confident about this, feel free to click the edit button and fix the article, preferably with a citation to a reliable source. –Novem Linguae (talk) 02:39, 29 March 2023 (UTC)
- The history section was significantly developed and this issue should be addressed. --Christophe (talk) 23:53, 24 March 2024 (UTC)
Describtion of several "schools"
I am not an expert in this topic so I am not able to provide the text myself. But to my knowledge there do exist minimum two "schools" of testing with several names.
- "Classical" school, also names as "Detroit" and in rare cases "Chicago" school. It focus on behavior and not on code blocks. - "London" school, or "mockist" school.
This schools are described and compared in the book "Khorikov (2020) Unit Testing - Principles, Practices, and Patterns" for example. Christian Buhtz (talk) 12:55, 15 April 2024 (UTC)
- Not saying that that book doesn't talk about such things ... but I've never heard of any of those terms: 'school' of unit testing, classical, detroit, chicago, london, mockist. And I do consider myself an expert in software and unit testing. In general and IMO, it's a weakness of WP is that just because something can be cited does not mean it's notable. At the same time, I cannot claim to know everything about the subject. Stevebroshar (talk) 14:22, 15 April 2024 (UTC)
- C-Class Computing articles
- Mid-importance Computing articles
- C-Class software articles
- High-importance software articles
- C-Class software articles of High-importance
- All Software articles
- All Computing articles
- C-Class Computer science articles
- Mid-importance Computer science articles
- WikiProject Computer science articles