I recently tweeted that I had figured out how to use Selenium to test for meta tag content. Here is in an example using http://www.protegra.com/. On the Protegra home page, I wanted to make sure the following 2 tags existed:
<meta name="title" content="Protegra.com" />
<meta name="description" content="Business. Technology. Solutions." />
Obviously, meta tags don't show on the page at all, but do exist in the HTML. To test this manually, I would need to open the page in a browser, click view source, search for 'meta' and then manually compare the results to the expected meta tags. To test this using Selenium, all you need to do is create a test case that opens up Protegra.com and then uses VerifyElementPresent to search for each meta tag. The VerifyElementPresent command allows you to enter the name of the meta tag and the expected content in the format of :
//meta[@name='name of the meta tag' and @content='the expected content']
The Selenium test case html for the two meta tags I'm looking for looks like this:
<tr>
<td>verifyElementPresent</td>
<td>//meta[@name='title' and @content='Protegra.com']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//meta[@name='description' and @content='Business. Technology. Solutions.']</td>
<td></td>
</tr>
Now I can run this test repeatedly to test for the expected meta tag content on the home page whenever I want without using manual effort. I can also create similar tests for each page throughout the site and run them all consecutively. Additionally, I could use Excel to generate the Selenium test case html for all my pages and meta tags without having to write the html manually or I could export this test case into C# (or any of the other programming languages supported by Selenium) and transform this test to lookup pages and meta tag values in a database table. Fast and easy.
Monday, July 5, 2010
Friday, July 2, 2010
But does it work? - an agile metric
I've said publicly at conferences and other gatherings that my passion for agile and lean began years ago after a particularly troubling project that tried to be agile. While that project had a strong team and eventually delivered a product, it had trouble with quality, scope and budget. In retrospect the biggest problem was that we had little knowledge of what it meant to be agile - our process was flawed. As a leader of that team, I took responsibility for the result and began a search to understand agile. Borrowing a phrase from the agile manifesto, I wanted to 'uncover better ways'.
After implementing several changes to our process, my projects over the years seem to have improved significantly. But how do you measure this? While no metric should stand alone, here is one quality metric that I'm experimenting with:
((# of high defects * 5) + (# of medium defects * 3) + (# of low defects * 1) / Total project hours * 100.
The 'troubled' project had a score of 18.7. My most recent project score was 1.2 which is almost a 1600% improvement on quality. I think I'll keep doing this agile thing.
P.S. I'm heading to Agile2010 this summer. Give me a shout if you are going and we can find ways to de-brief together over lunch or dinner in Orlando.
After implementing several changes to our process, my projects over the years seem to have improved significantly. But how do you measure this? While no metric should stand alone, here is one quality metric that I'm experimenting with:
((# of high defects * 5) + (# of medium defects * 3) + (# of low defects * 1) / Total project hours * 100.
The 'troubled' project had a score of 18.7. My most recent project score was 1.2 which is almost a 1600% improvement on quality. I think I'll keep doing this agile thing.
P.S. I'm heading to Agile2010 this summer. Give me a shout if you are going and we can find ways to de-brief together over lunch or dinner in Orlando.
Tuesday, June 8, 2010
User Stories in more detail
Several people at the conference last week asked me for more information about how to write user stories. I could write a long blog with lots of examples and explanation, but someone has already done that. Check out Scott Ambler's post here.
While Scott recommends capturing stories on cards, I like to capture them initially in a spreadsheet because it makes it easier to organize and prioritize. Once the project starts I print out the cards - instructions are in one of my earlier blogs.
While Scott recommends capturing stories on cards, I like to capture them initially in a spreadsheet because it makes it easier to organize and prioritize. Once the project starts I print out the cards - instructions are in one of my earlier blogs.
Monday, June 7, 2010
The last shall be first
At what point in the project do you start your testing effort? In many project plans that I have seen, QA and/or UAT is added to the end of the project. The development team hands over the code to the testing team who then writes and executes the scripts. The bugs are passed to the developer and the test & fix cycle begins. What fun.
Here is an alternative to the test & fix cycle:
1. Write test scripts before development starts on any particular feature. Test scripts help confirm the requirements with the client and allow developers to have a full understanding of how the code must work. The test scripts function as executable requirements and answer "How will I know when I'm done".
2. Minimize the time between when a features has been developed and when it is tested. This allows you to find defects or requirement misunderstanding early so that developers do not re-build the same defects or misunderstandings into future features. This helps increase the quality of the system while decreasing the time spent in the test-fix-test-fix cycle. Complete testing of any feature should occur in the same iteration that the code is written and should be part of your 'done' criteria.
Both of these two simple steps are based on the Lean Principles of Eliminate Waste and Build Quality In. For more information, check out this article from NetObjectives.
Here is an alternative to the test & fix cycle:
1. Write test scripts before development starts on any particular feature. Test scripts help confirm the requirements with the client and allow developers to have a full understanding of how the code must work. The test scripts function as executable requirements and answer "How will I know when I'm done".
2. Minimize the time between when a features has been developed and when it is tested. This allows you to find defects or requirement misunderstanding early so that developers do not re-build the same defects or misunderstandings into future features. This helps increase the quality of the system while decreasing the time spent in the test-fix-test-fix cycle. Complete testing of any feature should occur in the same iteration that the code is written and should be part of your 'done' criteria.
Both of these two simple steps are based on the Lean Principles of Eliminate Waste and Build Quality In. For more information, check out this article from NetObjectives.
Tuesday, June 1, 2010
PrairieDevCon Presentation links
Here are some additional links for my presentations at PrairieDevCon this week.
Introduction to Lean and Agile:
Planning Poker:
Introduction to Lean and Agile:
- Books
- Lean Software Development. Tom and Mary Poppendieck (2003)
- User Stories Applied. Mike Cohn (2004)
- The Art of Agile Development. James Shore and Shane Warden (2008)
- The Art of Lean Software Development. Curt Hibbs, Steve Jewett, Mike Sullivan (2009)
- Agile Estimating and Planning. Mike Cohn (2005)
- Sites
- Podcast Sites
- Newsgroups
- Other links to articles, blogs, videos
- www.martinfowler.com/articles/newMethodology.html
- http://agileinaflash.blogspot.com/2009/08/12-principles-for-agile-software.html
- www.infoq.com/Agile2009 (Videos from Agile 2009)
- http://www.netobjectives.com/files/BusinessCaseForAgility.pdf (requires account registration)
- http://groups.google.com/group/agile-developer-skills/web/draft-summary-of-chicago-meeting?hl=en&pli=1
- http://www.agilemanifesto.org/history.html - History of the Manifesto
- http://www.devx.com/architect/Article/32836/0/page/4 - comparison of seven popular agile methodologies
Planning Poker:
- Links
- www.planningpoker.com/detail.html
- http://www.youtube.com/watch?v=fb9Rzyi8b90&feature=PlayList&p=3F5BBA263D7DF99C&playnext=1&playnext_from=PL&index=2
- - Video of Mike Cohn explaining Planning Poker
Subscribe to:
Posts (Atom)