Talk:Unit testing

Latest comment: 1 month ago by Lukasz Kostrzewa in topic Describtion of several "schools"

IEEE 29119 on automated unit testing

edit

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

Meh. I doubt that. Feel free to prove me wrong. Stevebroshar (talk) 14:28, 15 April 2024 (UTC)Reply

TDD...

edit

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
Improve it. Less complaining and more doing. Stevebroshar (talk) 14:28, 15 April 2024 (UTC)Reply

"Example" section could be much better

edit

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

The missed opportunity is yours. I suggest less complaining and more doing. Stevebroshar (talk) 14:26, 15 April 2024 (UTC)Reply

JUnit in history section

edit

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)Reply

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)Reply
The history section was significantly developed and this issue should be addressed. --Christophe (talk) 23:53, 24 March 2024 (UTC)Reply

Describtion of several "schools"

edit

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)Reply

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)Reply
Martin Fowler in his article "Mocks Aren't Stubs" (https://martinfowler.com/articles/mocksArentStubs.html) writes about the two school of thoughts.
He also refers to these two approches as solitary and sociable unit tests in his Unit Test bliki (https://martinfowler.com/bliki/UnitTest.html). I think this is reliable and notable source of information :-) Lukasz Kostrzewa (talk) 20:27, 4 September 2024 (UTC)Reply

What is testing criteria?

edit

The section on 'testing criteria' means nothing to me. Here's the content as of today: During development, a programmer may code criteria, or results that are known to be good, into the test to verify the unit's correctness. During test execution, frameworks log tests that fail any criterion and report them in a summary. For this, the most commonly used approach is test - function - expected value.

That's wordy and doesn't make much sense to me.

Seems to be about expected results. I don't think that needs a whole section to describe.

I wonder if the section was added for this concept of testing criteria: https://notes.nicolevanderhoeven.com/Test+criteria#:~:text=A%20test%20criterion%20is%20a,%22acceptable%22%20for%20your%20application. Stevebroshar (talk) 15:04, 15 April 2024 (UTC)Reply