Jose: I heard from other team members that you are implementing TDD.For now, I am the only colleague responsible for quality, but ... your tests are only for code, and I am already testing functions, so what are the benefits of doing this?
Vanilla: Uh, what you do is a lot of manual operations.And our tests are automated, and—
Jose: And they are written by your developers?Doesn't it make much sense to write your own tests to detect the code you wrote?That ’s not every test can pass directly, because do n’t you just want the test to pass?
Vanilla: It ’s like this, just like unit testing—
Jose: Unit testing?More like a fantasy unicorn test.Do you really think you are testing?Are they really valuable?
Vanilla: Well, unit testing is fast, mainly to test the developer's intentions.
Jose: I don't need any bad unit tests to tell me the developer's intentions.Every developer hopes that the fewer tests they perform, the better, so that they have time to write more functions and make debugging changes later.If everyone comes to me to complain, I ca n’t take care of them at all, and my test time will be cut in half!
Vanilla: Think about it, I wrote 20 unit tests in the past 4 days.Did you know that they can test every line of code you and I write?
Jose: Just every line of code you write.What a shortcut!Dude, you need to be awake!
Vanlla: Think again, Jose—
Jose: This is not even a secret, Pop!I heard from the product owner that these unit tests don't even test the function.What can they do?
Vanilla: They don't test functions directly.Directly, this word is key!However, they test the code and implement the code of the product function.
Jose: Hear what you are saying, man.You are crazy.
Vanilla: Not really!
Jose: Whether it ’s micro testing or not, developers write tests?This is a completely different matter, two distinct things!
Vanilla: Stop and stop!Do you think developers are not capable of writing tests?
Jose: It is a very fundamental question.Because ... wait, I seem to think of something.
Vanilla: What the hell do you want to say?
Jose: Wait a moment.I think, ah, I suddenly understood.It's coming, yes, it's coming!(Make a quoted gesture)
Vanilla: Brother, it's such a toss me!You are really ... a lovely colleague.I would like to ask you to look at the names of these micro-tests. (Keyboard clicks are heard) Did you see these names? They ...
Jose: (Surprised) These names are very straightforward to explain what they are testing.I finally understand that your testing is not just about doing things.Excellent!You will become an excellent tester.You are really a superman.I didn't understand your logical control link at first.Give the whole thing to others, and they will find it quicker and more convenient to hand me the test directly.It's hard to get you to write more than 20 tests, this is not your job as a developer.can you help me?If you have failed the micro test, can you let me know?My boss has been paying attention to how many vulnerabilities I have discovered.If these micro-tests can be helpful, please let me know so that I can submit bug reports they find.
Commentary:
Writing micro-tests with developers is somewhat controversial in many companies. The traditional view is that this is the job of quality control.However, the function of quality control is to prepare for product release, and the quality control manager and his team usually test after development is complete.Therefore, it is confusing to have them test during development.In fact, in TDD, a small part of the test is even completed before development.Because micro-tests run so fast, developers like Vanilla Pop can even complete many rounds of tests every day and every hour.This allows developers to use tests to quickly check the written code, see if their work is flawed, and find errors before the code is submitted.Such an error detection mechanism occurs before the traditional quality control process or even macro testing.In this case, TDD actually shortened the development cycle, allowing developers to write more functions every day while making fewer mistakes.
Because specialized testers will question the various ideas that developers tell them, Vanilla Pop needs to win the support of testers and hold developers accountable for code defects, especially after they have been willing to accept writing automated microtests.Jose will continue to write automated acceptance tests (macro tests) for functions, instead of focusing on how many error counts can be submitted to the manager; the focus should not be on the beginning of the design sprint cycle. ATDD (Acceptance Test Driven Development), which reports how much code is "covered" by automated testing.
用户评论