显示标签为“agile”的博文。显示所有博文
显示标签为“agile”的博文。显示所有博文

2010年9月18日星期六

Testing no-dojo session 6 - Agile testing part 2 - tons of bugs

After I posted Agile testing part 1, one developer commented it on twitter. "Nice article, your next challenge is how to sell your idea to developers." He said. The idea he meant was unit testing. Among all components I tested, there was only 1 component with unit testing. "Because it is easy to write unit test in this one." Developers said. That sounded like right. Do the easy part! And hey, the results didn't look too bad, on the contrary, it looked better. By avoiding unit testing, developers released earlier. A couple more bugs found by testers, so what?

It seemed like right for a while. Until some day, a developer needed to commit a piece of core code that might affect some other code, he was not sure about the consequence. So he came to me and asked,
"Is there a way to detect that my code doesn't break other code?"
"Yeah, unit testing." I said.
"What about automated regression?"
"Sure, but that doesn't detect every thing, and you have to wait 4 hours."

Developers always considered this automated function level regression could detect everything. Because it was built by testers. And if it failed to detect a change, blame testers! But what they didn't know was that functions in one component always involved other components, machines, network, and some other environment issues.
Brady as a developer with testing experience explained it this way, "let's assume 90% chance of each factor might work, and the chance to successfully execute a regression is 0.9*0.9*0.9*0.9*...*0.9." And the worst part was when a regression failed, tester needed to check up all factors to find the cause.

Pretty soon, developers found that it wasn't perfectly safe to commit code, even with automated function level regression. So they started to commit less, as little as possible.

Elisabeth mentioned the exact scene in the next half of the lecture - "Technical Debt", when people chose short term pleasure and ended in long term pain.

She also introduced what Agile testing iteration was:
* Automated acceptance testing => Automated unit testing => Manual exploratory testing
And after the code passed unit testing and acceptance testing, testers should still cover 3 kind of cases in exploratory testing:
* end-to-end - usability
* sequence - scenarios involve complex steps
* data - historical data

She explained why it was hard for management team to accept Agile:
* customers, testers, developers work together on acceptance cases
* testers and developers work on unit test
* all involve in exploratory testing
In agile, the whole team involved in all steps, therefore everyone was responsible for the potential risks. Traditional managers always were looking for someone to blame when things went wrong. That wouldn't work in Agile Team.

In the end, Q&A started. I got to say I seldom enjoyed Q&A session, but I loved this one. Elisabeth mentioned that Microsoft released a package with 63,000 bugs fixed. " I wander what kind of bug tracking system could handle this many bugs. Instead of providing more features in bug tracking system, I think they should reduce bug count in the first place." She said.

This one really touched me. Without the power of unit testing, our team had over 3000 bugs, and 1000 waiting to be fixed. Each release, testers would find over 200 bugs, and verify almost the same mount from last release. To make testers' lives easier, I developed a series of tools to help us, including batch creating, resolving, verifying and searching. But no matter how many tools I provided, I just didn't feel right. Now I knew, I wasn't focusing in source of the problem. Reducing bug in the first place, then I could just throw away all these tools.

Isn't it weird? When I finally get to the right answer, part of me feel happy for knowing it, the other part feel sad that I didn't know it earlier.

2010年9月14日星期二

Testing no-dojo session 5 - agile testing part 1

Last Friday we had a discussion with developers about whether our team was doing Agile. Developers claimed that according to a 10-question quiz which was supposed to help people check their Agility, our team matched "yes" to over 6 of these 10 questions. Therefore our team was an Agile Team, especially with the 0 document part. That was true, they did not provide any document to testers in the past 4 years.

But for what I knew about Agile, it was about practices and principles.
So I asked:"what was the practices and principles we had in our team?"
"0 document", developers answered.
"Any other one?"
"We release fast."
"Any other one?"
"Oh, and we do not follow process. That's quite enough. We match the major spirit of Agile."

I didn't continue my challenge, because I knew Agile only from several infoq videos. I chose not to discuss something I didn't quite understand. So the discussion ended.
This week while we were scheduling our dojo, Qia suggested 1 video lecture on agile testing. She got confused with the discussion, and wanted to know what Agile was, and how Agile we were doing in our team.

So we started our session with the lecture - Agile Testing by Elisabeth. In the beginning, Elisabeth introduced how she met XP, and got herself involved in her first Agile/XP project. With her former experience in a tradition team, she made a comparison between the 2 teams.

Then she started introducing Agile including 4 major methodologies: XP/Scrum/Lean Development/Crystal. She claimed that most people considered Agile was all about chaos, but a real XP team was quite disciplined.
* developer work with customer to come up automated acceptance testing - as a replacement of specification
* developer write unit test before they start coding - as design document
* developer commit code only after they pass their unit testing

Then she moved on to testing in Agile Team, how testing diffed between traditional team and agile team.
* plan for iteration
* instead of being the last line of defense, become team support
We ended up in the middle of the lecture and started discussion. We focused on 2 major questions
* are we agile
* how could we apply it

We all knew that developers refused to do unit-testing. "We tried, but it really slowed us down." They said. The schedule they referred here was called "development cycle", it counted from the day developers started coding till the day they released the package to testers. Without unit testing, developer could release the package in shorter time.

But hey, without unit testing, testers would find more bugs, need more time to investigate, more time to file it, more back and forth for developers to fix bug and release again and again. Developers knew that but they simply didn't care. Because after the day they released package, "testing cycle" started. Why developers should give a damn about how long it would take. The longer testing cycle took, the worse testers looked. Everyone loved developers, because they always beat the schedule. Everyone hated testers, because they always got beaten!

After the complain, I still found something I could do - become team support. So I went back my seat, found out the bug list for the latest release, and went through all the bugs 1 by 1. Among all 16 bugs, I found 5 bugs could be avoided if I could give comments to developers before code commit. So I sent out mail with the evidence. 30 minutes later I got a confirm from developers that from now on I would be invited in the code review. That was not exactly what I hoped for. But at least I would not need to file those not-so-smart bugs any more.

BTW, Elisabeth mentioned Mary in the section of lean development. Mary is one of my favorite speakers among all infoq speakers. The ideas she has on Lean development and Deliberate Practice lights my way in darkness. I would encourage everyone who considers software engineering as craftsmanship to watch her series on infoq.