|
本帖最后由 omicron15 于 2012-5-6 09:47 编辑
觉得不错,很多东西可以借鉴,希望大家喜欢,免去翻X看E文的痛苦
--------------
How Google TestsSoftware - Part One
Tuesday, January 25, 20119:08 AM
By James Whittaker
This is the firstin a series of posts on this topic.
The one question I get morethan any other is "How does Google test?" It's been explained in bitsand pieces on this blog but the explanation is due an update. The Googletesting strategy has never changed but the tactical ways we execute it hasevolved as the company has evolved. We're now a search, apps, ads, mobile,operating system, and so on and so forth company. Each of these Focus Areas (aswe call them) have to do things that make sense for their problem domain. As weadd new FAs and grow the existing ones, our testing has to expand and improve.What I am documenting in this series of posts is a combination of what we aredoing today and the direction we are trending toward in the foreseeable future.
Let's begin withorganizational structure and it's one that might surprise you. There isn't anactual testing organization at Google. Test exists within a Focus Area calledEngineering Productivity. Eng Prod owns any number of horizontal and verticalengineering disciplines, Test is the biggest. In a nutshell, Eng Prod is madeof:
1. A product team thatproduces internal and open source productivity tools that are consumed by allwalks of engineers across the company. We build and maintain code analyzers,IDEs, test case management systems, automated testing tools, build systems,source control systems, code review schedulers, bug databases... The idea is tomake the tools that make engineers more productive. Tools are a very large partof the strategic goal of prevention over detection.
2. A services team thatprovides expertise to Google product teams on a wide array of topics includingtools, documentation, testing, release management, training and so forth. Ourexpertise covers reliability, security, internationalization, etc., as well asproduct-specific functional issues that Google product teams might face. Everyother FA has access to Eng Prod expertise.
3. Embedded engineers thatare effectively loaned out to Google product teams on an as-needed basis. Someof these engineers might sit with the same product teams for years, otherscycle through teams wherever they are needed most. Google encourages all itsengineers to change product teams often to stay fresh, engaged and objective.Testers are no different but the cadence of changing teams is left to theindividual. I have testers on Chrome that have been there for several years andothers who join for 18 months and cycle off. Keeping a healthy balance betweenproduct knowledge and fresh eyes is something a test manager has to pay closeattention to.
So this means that testersreport to Eng Prod managers but identify themselves with a product team, likeSearch, Gmail or Chrome. Organizationally they are part of both teams. They sitwith the product teams, participate in their planning, go to lunch with them,share in ship bonuses and get treated like full members of the team. Thebenefit of the separate reporting structure is that it provides a forum fortesters to share information. Good testing ideas migrate easily within Eng Prodgiving all testers, no matter their product ties, access to the best technologywithin the company.
This separation of projectand reporting structures has its challenges. By far the biggest is that testersare an external resource. Product teams can't place too big a bet on them andmust keep their quality house in order. Yes, that's right: at Google it's theproduct teams that own quality, not testers. Every developer is expected to dotheir own testing. The job of the tester is to make sure they have the automationinfrastructure and enabling processes that support this self reliance. Testersenable developers to test.
What I like about thisstrategy is that it puts developers and testers on equal footing. It makes ustrue partners in quality and puts the biggest quality burden where it belongs:on the developers who are responsible for getting the product right. Anotherside effect is that it allows us a many-to-one dev-to-test ratio. Developersoutnumber testers. The better they are at testing the more they outnumber us.Product teams should be proud of a high ratio!
Ok, now we're all friendshere right? You see the hole in this strategy I am sure. It's big enough todrive a bug through. Developers can't test! Well, who am I to deny that? Noamount of corporate kool-aid could get me to deny it, especially coming off myGTAC talk last year where I pretty much made a game of developer vs. tester(spoiler alert: the tester wins).
Google's answer is to splitthe role. We solve this problem by having two types of testing roles at Googleto solve two very different testing problems. In my next post, I'll talk aboutthese roles and how we split the testing problem into two parts.
How Google TestsSoftware - Part Two
作者:James Whittaker
By James Whittaker
In order for the “you buildit, you break it” motto to be real, there are roles beyond the traditionaldeveloper that are necessary. Specifically, engineering roles that enable developersto do testing efficiently and effectively have to exist. At Google we havecreated roles in which some engineers are responsible for making others moreproductive. These engineers often identify themselves as testers but theiractual mission is one of productivity. They exist to make developers moreproductive and quality is a large part of that productivity. Here's a summaryof those roles:
The SWE or Software Engineeris the traditional developer role. SWEs write functional code that ships to users.They create design documentation, design data structures and overallarchitecture and spend the vast majority of their time writing and reviewingcode. SWEs write a lot of test code including test driven design, unit testsand, as we explain in future posts, participate in the construction of small,medium and large tests. SWEs own quality for everything they touch whether theywrote it, fixed it or modified it.
The SET or Software Engineerin Test is also a developer role except their focus is on testability. Theyreview designs and look closely at code quality and risk. They refactor code tomake it more testable. SETs write unit testing frameworks and automation. Theyare a partner in the SWE code base but are more concerned with increasingquality and test coverage than adding new features or increasing performance.
The TE or Test Engineer isthe exact reverse of the SET. It is a a role that puts testing first anddevelopment second. Many Google TEs spend a good deal of their time writingcode in the form of automation scripts and code that drives usage scenarios andeven mimics a user. They also organize the testing work of SWEs and SETs,interpret test results and drive test execution, particular in the late stagesof a project as the push toward release intensifies. TEs are product experts,quality advisers and analyzers of risk.
From a quality standpoint,SWEs own features and the quality of those features in isolation. They areresponsible for fault tolerant designs, failure recovery, TDD, unit tests andin working with the SET to write tests that exercise the code for theirfeature.
SETs are developers thatprovide testing features. A framework that can isolate newly developed code bysimulating its dependencies with stubs, mocks and fakes and submit queues formanaging code check-ins. In other words, SETs write code that allows SWEs totest their features. Much of the actual testing is performed by the SWEs, SETsare there to ensure that features are testable and that the SWEs are actively involvedin writing test cases.
Clearly SETs primary focusis on the developer. Individual feature quality is the target and enablingdevelopers to easily test the code they write is the primary focus of the SET.This development focus leaves one large hole which I am sure is already evidentto the reader: what about the user?
User focused testing is thejob of the Google TE. Assuming that the SWEs and SETs performed module andfeature level testing adequately, the next task is to understand how well thiscollection of executable code and data works together to satisfy the needs ofthe user. TEs act as a double-check on the diligence of the developers. Anyobvious bugs are an indication that early cycle developer testing wasinadequate or sloppy. When such bugs are rare, TEs can turn to their primarytask of ensuring that the software runs common user scenarios, is performantand secure, is internationalized and so forth. TEs perform a lot of testing andtest coordination tasks among TEs, contract testers, crowd sourced testers, dogfooders, beta users, early adopters. They communicate among all parties therisks inherent in the basic design, feature complexity and failure avoidancemethods. Once TEs get engaged, there is no end to their mission.
Ok, now that the roles arebetter understood, I'll dig into more details on how we choreograph the workitems among them. Until next time...thanks for your interest. |
|